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 EmissionSetup(Screen, ConfigListScreen):
16 def __init__(self, session):
17 Screen.__init__(self, session)
18 self.skinName = [ "EmissionSetup", "Setup" ]
21 self.setup_title = _("eMission settings")
22 self.onChangedEntry = []
24 ConfigListScreen.__init__(
27 getConfigListEntry(_("Hostname"), config.plugins.emission.hostname),
28 getConfigListEntry(_("Username"), config.plugins.emission.username),
29 getConfigListEntry(_("Password"), config.plugins.emission.password),
30 getConfigListEntry(_("Port"), config.plugins.emission.port),
31 getConfigListEntry(_("Auto-add torrent enclosures from SimpleRSS"), config.plugins.emission.autodownload_from_simplerss),
34 on_change = self.changed
38 self["key_green"] = StaticText(_("OK"))
39 self["key_red"] = StaticText(_("Cancel"))
42 self["actions"] = ActionMap(["SetupActions"],
44 "cancel": self.keyCancel,
52 self.onLayoutFinish.append(self.setCustomTitle)
54 def setCustomTitle(self):
55 self.setTitle(self.setup_title)
58 for x in self.onChangedEntry:
61 def getCurrentEntry(self):
62 return self["config"].getCurrent()[0]
64 def getCurrentValue(self):
65 return str(self["config"].getCurrent()[1].getText())
67 def createSummary(self):