2 from Screens.Screen import Screen
3 from Components.ConfigList import ConfigListScreen
6 from Screens.Setup import SetupSummary
9 from Components.ActionMap import ActionMap
10 from Components.Sources.StaticText import StaticText
13 from Components.config import config, getConfigListEntry
15 class PipzapSetup(Screen, ConfigListScreen):
16 skin = """<screen name="PipzapSetup" position="center,center" size="565,370">
17 <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
18 <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
19 <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
20 <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
21 <widget name="config" position="5,50" size="555,250" scrollbarMode="showOnDemand" />
22 <ePixmap pixmap="skin_default/div-h.png" position="0,301" zPosition="1" size="565,2" />
23 <widget source="help" render="Label" position="5,305" size="555,63" font="Regular;21" />
26 def __init__(self, session):
27 Screen.__init__(self, session)
30 self.setup_title = _("pipzap Setup")
31 self.onChangedEntry = []
33 ConfigListScreen.__init__(
36 getConfigListEntry(_("Enable Hotkey"), config.plugins.pipzap.enable_hotkey, _("Use the STOP-Key to quickly enable/disable pipzap in TV-Mode? Changing this setting requires a restart.")),
37 getConfigListEntry(_("Show in Plugin menu"), config.plugins.pipzap.show_in_plugins, _("Adds an entry to the Plugin menu to toggle pipzap")),
40 on_change = self.changed
42 def selectionChanged():
43 if self["config"].current:
44 self["config"].current[1].onDeselect(self.session)
45 self["config"].current = self["config"].getCurrent()
46 if self["config"].current:
47 self["config"].current[1].onSelect(self.session)
48 for x in self["config"].onSelectionChanged:
50 self["config"].selectionChanged = selectionChanged
51 self["config"].onSelectionChanged.append(self.updateHelp)
54 self["key_green"] = StaticText(_("OK"))
55 self["key_red"] = StaticText(_("Cancel"))
56 self["help"] = StaticText()
59 self["actions"] = ActionMap(["SetupActions"],
61 "cancel": self.keyCancel,
69 self.onLayoutFinish.append(self.setCustomTitle)
71 def setCustomTitle(self):
72 self.setTitle(_("pipzap Setup"))
75 cur = self["config"].getCurrent()
77 self["help"].text = cur[2]
80 for x in self.onChangedEntry:
83 def getCurrentEntry(self):
84 return self["config"].getCurrent()[0]
86 def getCurrentValue(self):
87 return str(self["config"].getCurrent()[1].getText())
89 def createSummary(self):