1 # for localized messages
5 from Screens.Screen import Screen
6 from Components.ConfigList import ConfigListScreen
9 from Screens.Setup import SetupSummary
12 from Components.ActionMap import ActionMap
13 from Components.Button import Button
16 from Components.config import config, getConfigListEntry
18 class AutoTimerSettings(Screen, ConfigListScreen):
19 """Configuration of AutoTimer"""
21 skin = """<screen name="AutoTimerSettings" title="Configure AutoTimer behavior" position="75,155" size="565,280">
22 <widget name="config" position="5,5" size="555,225" scrollbarMode="showOnDemand" />
23 <ePixmap position="0,235" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
24 <ePixmap position="140,235" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
25 <widget name="key_red" position="0,235" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
26 <widget name="key_green" position="140,235" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
29 def __init__(self, session):
30 Screen.__init__(self, session)
33 self.setup_title = _("AutoTimer Settings")
34 self.onChangedEntry = []
37 getConfigListEntry(_("Poll automatically"), config.plugins.autotimer.autopoll),
38 getConfigListEntry(_("Poll Interval (in h)"), config.plugins.autotimer.interval),
39 getConfigListEntry(_("Show in Extensionmenu"), config.plugins.autotimer.show_in_extensionsmenu),
40 getConfigListEntry(_("Modify existing Timers"), config.plugins.autotimer.refresh),
41 getConfigListEntry(_("Guess existing Timer based on Begin/End"), config.plugins.autotimer.try_guessing),
42 getConfigListEntry(_("Add timer as disabled on conflict"), config.plugins.autotimer.disabled_on_conflict),
43 getConfigListEntry(_("Editor for new AutoTimers"), config.plugins.autotimer.editor),
46 ConfigListScreen.__init__(self, list, session = session, on_change = self.changed)
49 self["key_red"] = Button(_("Cancel"))
50 self["key_green"] = Button(_("OK"))
53 self["actions"] = ActionMap(["SetupActions"],
55 "cancel": self.keyCancel,
63 self.onLayoutFinish.append(self.setCustomTitle)
65 def setCustomTitle(self):
66 self.setTitle(_("Configure AutoTimer behavior"))
69 for x in self.onChangedEntry:
75 def getCurrentEntry(self):
76 return self["config"].getCurrent()[0]
78 def getCurrentValue(self):
79 return str(self["config"].getCurrent()[1].getText())
81 def createSummary(self):