Initial
[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 #from Components.Button import Button
11
12 # Configuration
13 from Components.config import config, getConfigListEntry
14
15 from sets import Set
16
17 class StartupToStandbyConfiguration(Screen, ConfigListScreen):
18         """Configuration of Startup To Standby"""
19
20         skin = """<screen name="StartupToStandbyConfiguration" title="Configure StartupToStandby" position="75,155" size="565,280">
21                 <widget name="config" position="5,5" size="555,100" scrollbarMode="showOnDemand" />
22         </screen>"""
23
24         def __init__(self, session):
25                 Screen.__init__(self, session)
26
27                 # Summary
28                 self.setup_title = "StartupToStandby Configuration"
29                 self.onChangedEntry = []
30
31                 # -
32                 self.list = [
33                         getConfigListEntry(_("Enabled"), config.plugins.startuptostandby.enabled),
34                 ]
35
36                 # Define Actions
37                 self["actions"] = ActionMap(["SetupActions","ColorActions"],
38                         {
39                                 "cancel": self.close,
40                         }
41                 )
42
43                 ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
44
45                 # Trigger change
46                 self.changed()
47
48         def changed(self):
49                 for x in self.onChangedEntry:
50                         try:
51                                 x()
52                         except:
53                                 pass
54
55         def getCurrentEntry(self):
56                 return self["config"].getCurrent()[0]
57
58         def getCurrentValue(self):
59                 return str(self["config"].getCurrent()[1].getText())
60
61         def createSummary(self):
62                 return SetupSummary
63