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(_("Modify existing Timers"), config.plugins.autotimer.refresh),
40 getConfigListEntry(_("Guess existing Timer based on Begin/End"), config.plugins.autotimer.try_guessing),
41 getConfigListEntry(_("Add timer as disabled on conflict"), config.plugins.autotimer.disabled_on_conflict),
42 getConfigListEntry(_("Editor for new AutoTimers"), config.plugins.autotimer.editor),
45 ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
48 self["key_red"] = Button(_("Cancel"))
49 self["key_green"] = Button(_("OK"))
52 self["actions"] = ActionMap(["SetupActions"],
54 "cancel": self.keyCancel,
62 self.onLayoutFinish.append(self.setCustomTitle)
64 def setCustomTitle(self):
65 self.setTitle(_("Configure AutoTimer behavior"))
68 for x in self.onChangedEntry:
74 def getCurrentEntry(self):
75 return self["config"].getCurrent()[0]
77 def getCurrentValue(self):
78 return str(self["config"].getCurrent()[1].getText())
80 def createSummary(self):