5 from enigma import eListboxPythonMultiContent, gFont
6 from Screens.Screen import Screen
7 from Screens.MessageBox import MessageBox
9 from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigInteger, ConfigYesNo, ConfigText, ConfigSelection
10 from Components.ConfigList import ConfigListScreen
11 from Components.Sources.StaticText import StaticText
12 from Components.MenuList import MenuList
13 from Components.MultiContent import MultiContentEntryText
15 from Components.ActionMap import ActionMap
17 class WebIfConfigScreen(ConfigListScreen, Screen):
19 <screen name="WebIfConfigScreen" position="center,center" size="560,400" title="Webinterface: Main Setup">
20 <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
21 <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
22 <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" />
23 <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" />
24 <widget name="config" position="5,50" size="550,360" scrollbarMode="showOnDemand" zPosition="1"/>
27 def __init__(self, session, args=0):
28 Screen.__init__(self, session)
31 ConfigListScreen.__init__(self, [])
34 self["key_red"] = StaticText(_("Cancel"))
35 self["key_green"] = StaticText(_("OK"))
36 self["key_yellow"] = StaticText("")
37 self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
42 "cancel": self.cancel,
46 self.onLayoutFinish.append(self.layoutFinished)
49 ConfigListScreen.keyLeft(self)
53 ConfigListScreen.keyRight(self)
56 def createSetup(self):
58 getConfigListEntry(_("Start Webinterface"), config.plugins.Webinterface.enabled),
59 getConfigListEntry(_("Enable /media"), config.plugins.Webinterface.includemedia),
60 getConfigListEntry(_("Allow zapping via Webinterface"), config.plugins.Webinterface.allowzapping),
61 getConfigListEntry(_("Autowrite timer"), config.plugins.Webinterface.autowritetimer),
62 getConfigListEntry(_("Load movie-length"), config.plugins.Webinterface.loadmovielength),
63 getConfigListEntry(_("Enable HTTP Access"), config.plugins.Webinterface.http.enabled)
66 if config.plugins.Webinterface.http.enabled.value == True:
68 getConfigListEntry(_("Enable Authentication (HTTP)"), config.plugins.Webinterface.http.auth)
73 list.append( getConfigListEntry(_("Enable HTTPS Access"), config.plugins.Webinterface.https.enabled) )
75 if config.plugins.Webinterface.https.enabled.value == True:
77 getConfigListEntry(_("Listening Port (HTTPS)"), config.plugins.Webinterface.https.port),
78 getConfigListEntry(_("Enable Authentication (HTTPS)"), config.plugins.Webinterface.https.auth)
83 #Auth for Streaming (127.0.0.1 Listener)
84 list.append(getConfigListEntry(_("Enable Streaming Authentication"), config.plugins.Webinterface.streamauth))
86 self["config"].list = list
87 self["config"].l.setList(list)
89 def layoutFinished(self):
90 self.setTitle(_("Webinterface: Main Setup"))
93 print "[Webinterface] Saving Configuration"
95 for x in self["config"].list:
97 self.close(True, self.session)
100 print "[Webinterface] Cancel setup changes"
101 for x in self["config"].list:
103 self.close(False, self.session)