- get rid of custom title source and use builtin Title,
[enigma2-plugins.git] / startuptostandby / src / StartupToStandbyConfiguration.py
1 # GUI (Screens)
2 from Screens.Screen import Screen
3 from Components.ConfigList import ConfigListScreen
4
5 # GUI (Summary)
6 from Screens.Setup import SetupSummary
7
8 # GUI (Components)
9 from Components.ActionMap import ActionMap
10
11 # Configuration
12 from Components.config import config, getConfigListEntry
13
14 class StartupToStandbyConfiguration(Screen, ConfigListScreen):
15         """Configuration of Startup To Standby"""
16
17         skin = """<screen name="StartupToStandbyConfiguration" title="Configure StartupToStandby" position="75,155" size="565,280">
18                 <widget name="config" position="5,5" size="555,100" scrollbarMode="showOnDemand" />
19         </screen>"""
20
21         def __init__(self, session):
22                 Screen.__init__(self, session)
23
24                 # Summary
25                 self.setup_title = "StartupToStandby Configuration"
26                 self.onChangedEntry = []
27
28                 # Define Actions
29                 self["actions"] = ActionMap(["SetupActions"],
30                         {
31                                 "cancel": self.keySave,
32                         }
33                 )
34
35                 ConfigListScreen.__init__(
36                         self,
37                         [getConfigListEntry(_("Enabled"), config.plugins.startuptostandby.enabled)],
38                         session = session,
39                         on_change = self.changed
40                 )
41
42                 # Trigger change
43                 self.changed()
44
45         def changed(self):
46                 for x in self.onChangedEntry:
47                         try:
48                                 x()
49                         except:
50                                 pass
51
52         def getCurrentEntry(self):
53                 return self["config"].getCurrent()[0]
54
55         def getCurrentValue(self):
56                 return str(self["config"].getCurrent()[1].getText())
57
58         def createSummary(self):
59                 return SetupSummary
60