cleanup imports
[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                 # -
29                 self.list = [
30                         getConfigListEntry(_("Enabled"), config.plugins.startuptostandby.enabled),
31                 ]
32
33                 # Define Actions
34                 self["actions"] = ActionMap(["SetupActions","ColorActions"],
35                         {
36                                 "cancel": self.close,
37                         }
38                 )
39
40                 ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
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