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.Label import Label
14 from Components.Pixmap import Pixmap
17 from Components.config import config, getConfigListEntry
19 class AutoTimerSettings(Screen, ConfigListScreen):
20 def __init__(self, session):
21 Screen.__init__(self, session)
22 self.skinName = "Setup"
25 self.setup_title = _("AutoTimer Settings")
26 self.onChangedEntry = []
28 ConfigListScreen.__init__(
31 getConfigListEntry(_("Poll automatically"), config.plugins.autotimer.autopoll),
32 getConfigListEntry(_("Poll Interval (in h)"), config.plugins.autotimer.interval),
33 getConfigListEntry(_("Show in Extensionmenu"), config.plugins.autotimer.show_in_extensionsmenu),
34 getConfigListEntry(_("Modify existing Timers"), config.plugins.autotimer.refresh),
35 getConfigListEntry(_("Guess existing Timer based on Begin/End"), config.plugins.autotimer.try_guessing),
36 getConfigListEntry(_("Add timer as disabled on conflict"), config.plugins.autotimer.disabled_on_conflict),
37 getConfigListEntry(_("Editor for new AutoTimers"), config.plugins.autotimer.editor),
40 on_change = self.changed
44 self["oktext"] = Label(_("OK"))
45 self["canceltext"] = Label(_("Cancel"))
47 self["cancel"] = Pixmap()
48 self["title"] = Label(_("AutoTimer Settings"))
51 self["actions"] = ActionMap(["SetupActions"],
53 "cancel": self.keyCancel,
61 self.onLayoutFinish.append(self.setCustomTitle)
63 def setCustomTitle(self):
64 self.setTitle(_("Configure AutoTimer behavior"))
67 for x in self.onChangedEntry:
73 def getCurrentEntry(self):
74 return self["config"].getCurrent()[0]
76 def getCurrentValue(self):
77 return str(self["config"].getCurrent()[1].getText())
79 def createSummary(self):