fixed scrolling problem in mediaplaer and filelist
[enigma2-plugins.git] / webinterface / src / WebIfConfig.py
1 Version = '$Header$';\r
2 \r
3 from enigma import *\r
4 from Screens.Screen import Screen\r
5 from Components.config import config, getConfigListEntry\r
6 from Components.ConfigList import *\r
7 from Components.Label import Label\r
8 from Components.ActionMap import ActionMap\r
9         \r
10 class WebIfConfigScreen(ConfigListScreen,Screen):\r
11     skin = """\r
12         <screen position="100,100" size="550,400" title="Webinterface Setup" >\r
13         <widget name="config" position="0,0" size="550,360" scrollbarMode="showOnDemand" />\r
14         <widget name="buttonred" position="10,360" size="100,40" backgroundColor="red" valign="center" halign="center" zPosition="2"  foregroundColor="white" font="Regular;18"/> \r
15         <widget name="buttongreen" position="120,360" size="100,40" backgroundColor="green" valign="center" halign="center" zPosition="2"  foregroundColor="white" font="Regular;18"/> \r
16         </screen>"""\r
17     def __init__(self, session, args = 0):\r
18         self.session = session\r
19         Screen.__init__(self, session)\r
20         self.list = []\r
21         self.list.append(getConfigListEntry(_("start Webinterface"), config.plugins.Webinterface.enable))\r
22         self.list.append(getConfigListEntry(_("use Authorization"), config.plugins.Webinterface.useauth))\r
23         self.list.append(getConfigListEntry(_("use Port"), config.plugins.Webinterface.port))\r
24         self.list.append(getConfigListEntry(_("enable /hdd"), config.plugins.Webinterface.includehdd))\r
25         self.list.append(getConfigListEntry(_("write debug-file"), config.plugins.Webinterface.debug))\r
26         self.list.append(getConfigListEntry(_("autowrite timer"), config.plugins.Webinterface.autowritetimer))\r
27         self.list.append(getConfigListEntry(_("load movie-length"), config.plugins.Webinterface.loadmovielength))\r
28         ConfigListScreen.__init__(self, self.list)\r
29         self["buttonred"] = Label(_("cancel"))\r
30         self["buttongreen"] = Label(_("ok"))\r
31         self["setupActions"] = ActionMap(["SetupActions"],\r
32         {\r
33             "green": self.save,\r
34             "red": self.cancel,\r
35             "save": self.save,\r
36             "cancel": self.cancel,\r
37             "ok": self.save,\r
38         }, -2)\r
39 \r
40     def save(self):\r
41         print "saving"\r
42         for x in self["config"].list:\r
43             x[1].save()\r
44         self.close(True,self.session)\r
45 \r
46     def cancel(self):\r
47         print "cancel"\r
48         for x in self["config"].list:\r
49             x[1].cancel()\r
50         self.close(False,self.session)\r