2 from Screens.Screen import Screen
3 from Components.ConfigList import ConfigListScreen
6 from Screens.Setup import SetupSummary
9 from Components.ActionMap import ActionMap
10 from Components.Button import Button
13 from Components.config import config, getConfigListEntry
15 class AutoTimerSettings(Screen, ConfigListScreen):
16 """Configuration of AutoTimer"""
18 skin = """<screen name="AutoTimerSettings" title="Configure AutoTimer behavior" position="75,155" size="565,280">
19 <widget name="config" position="5,5" size="555,225" scrollbarMode="showOnDemand" />
20 <ePixmap position="0,235" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
21 <ePixmap position="140,235" zPosition="4" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
22 <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" />
23 <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" />
26 def __init__(self, session):
27 Screen.__init__(self, session)
30 self.setup_title = "AutoTimer Settings"
31 self.onChangedEntry = []
34 getConfigListEntry(_("Poll automatically"), config.plugins.autotimer.autopoll),
35 getConfigListEntry(_("Poll Interval (in h)"), config.plugins.autotimer.interval),
36 getConfigListEntry(_("Modify existing Timers"), config.plugins.autotimer.refresh),
37 getConfigListEntry(_("Guess existing Timer based on Begin/End"), config.plugins.autotimer.try_guessing),
38 getConfigListEntry(_("Editor for new AutoTimers"), config.plugins.autotimer.editor),
41 ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
44 self["key_red"] = Button(_("Cancel"))
45 self["key_green"] = Button(_("OK"))
48 self["actions"] = ActionMap(["SetupActions"],
50 "cancel": self.keyCancel,
59 for x in self.onChangedEntry:
65 def getCurrentEntry(self):
66 return self["config"].getCurrent()[0]
68 def getCurrentValue(self):
69 return str(self["config"].getCurrent()[1].getText())
71 def createSummary(self):