added setup screens
[vuplus_dvbapp] / lib / python / Screens / Menu.py
index 3b54577..11b265e 100644 (file)
@@ -4,6 +4,7 @@ from Components.ActionMap import ActionMap
 from Components.Header import Header
 
 # hack ... must be made dynamic
+from Screens.Setup import Setup
 from ServiceScan import ServiceScan
 from ScartLoopThrough import ScartLoopThrough
 from Components.Button import Button
@@ -11,6 +12,8 @@ from Components.Label import Label
 from Components.ProgressBar import ProgressBar
 from ConfigMenu import *
 
+from About import *
+
 from TimerEdit import *
 
 from enigma import quitMainloop
@@ -26,53 +29,50 @@ def doGlobal(screen):
        screen["clock"] = Clock()
 
 
+#              <item text="TV-Mode">self.setModeTV()</item>
+#              <item text="Radio-Mode">self.setModeRadio()</item>
+#              <item text="File-Mode">self.setModeFile()</item>
+#              <item text="Scart">self.openDialog(ScartLoopThrough)</item>
+#                      <item text="Sleep Timer"></item>
+
 mdom = xml.dom.minidom.parseString(
         """
-       <menu text="Mainmenu" title="the real Mainmenu">
+       <menu text="Mainmenu" title="Mainmenu">
                <item text="Standby debug">quitMainloop()</item>
-               <item text="Automatic Scan">self.openDialog(ServiceScan)</item>
-
-               <item text="TV-Mode">self.setModeTV()</item>
-               <item text="Radio-Mode">self.setModeRadio()</item>
-               <item text="File-Mode">self.setModeFile()</item>
-               <item text="Scart">self.openDialog(ScartLoopThrough)</item>
                <item text="Timer">self.openDialog(TimerEditList)</item>
                <menu text="Setup">
-                       <menu text="Service Organising">
+                       <menu text="Service Organising -disabled-">
                                <item text="New Bouquets"></item>
                                <item text="Add to Bouquets"></item>
                                <item text="Edit Bouquets"></item>
                        </menu>
                        <menu text="Service Searching">
-                               <item text="Satelliteconfig"></item>
-                               <item text="Satfinder"></item>
-                               <item text="Rotor Control"></item>
-                               <item text="Edit Transponder"></item>
+                               <item text="Satelliteconfig">self.openSetup("satconfig")</item>
+                               <item text="Satfinder -disabled-"></item>
+                               <item text="Rotor Control -disabled-"></item>
+                               <item text="Edit Transponder -disabled-"></item>
                                <item text="Automatic Scan">self.openDialog(ServiceScan)</item>
-                               <item text="Automatic 'Multisat' Scan"></item>
-                               <item text="Manual Scan"></item>
                        </menu>
                        <menu text="System">
-                               <item text="Time Date"></item>
-                               <item text="Video Audio"></item>
-                               <item text="UHF Modulator"></item>
+                               <item text="Timezone">self.openSetup("timezone")</item>
+                               <item text="Video Audio">self.openSetup("avsetup")</item>
+                               <item text="UHF Modulator">self.openSetup("rfmod")</item>
                                <item text="Harddisk"></item>
-                               <item text="Keyboard"></item>
-                               <item text="OSD">self.openDialog(configOSD)</item>
-                               <item text="Language"></item>
-                               <item text="LCD"></item>
+                               <item text="Remote Control">self.openSetup("rc")</item>
+                               <item text="Keyboard">self.openSetup("keyboard")</item>
+                               <item text="OSD">self.openSetup("osd")</item>
+                               <item text="LCD">self.openSetup("lcd")</item>
                        </menu>
                        <item text="Common Interface"></item>
-                       <item text="Parental Control"></item>
-                       <item text="Expert"></item>
+                       <item text="Parental Control">self.openSetup("parental")</item>
+                       <item text="Expert">self.openSetup("expert")</item>
                </menu>
-               <item text="Games"></item>
-               <item text="Information"></item>
+               <item text="Games (not found)"></item>
+               <item text="Information">self.openDialog(About)</item>
                <menu text="Standby">
-                       <item text="PowerOff"></item>
-                       <item text="Restart"></item>
-                       <item text="Standby"></item>
-                       <item text="Sleep Timer">self.goSetup()</item>
+                       <item text="PowerOff">quitMainloop()</item>
+                       <item text="Restart">quitMainloop()</item>
+                       <item text="Standby">quitMainloop()</item>
                </menu>
        </menu>""")
 
@@ -122,37 +122,7 @@ class configOSD(Screen):
                self["sld_gamma"] = ProgressBar()
                self["sld_gamma"].setValue(50)
 
-
-
-
 class Menu(Screen):
-       #add file load functions for the xml-file
-       #remove old code (i.e. goScan / goClock...)
-
-       def openDialog(self, dialog):
-               self.session.open(dialog)
-
-       def goSetup(self):
-               self.session.open(configTest)
-       
-       def setModeTV(self):
-               print "set Mode to TV"
-               pass
-
-       def setModeRadio(self):
-               print "set Mode to Radio"
-               pass
-
-       def setModeFile(self):
-               print "set Mode to File"
-               pass
-
-       def goScan(self):
-               self.session.open(ServiceScan)
-       
-       def goClock(self):
-               self.session.open(clockDisplay, Clock())
-
        def okbuttonClick(self):
                print "okbuttonClick"
                selection = self["menu"].getCurrent()
@@ -164,6 +134,12 @@ class Menu(Screen):
        def nothing(self):                                                                                                                                      #dummy
                pass
 
+       def openDialog(self, dialog):                           # in every layer needed
+               self.session.open(dialog)
+
+       def openSetup(self, dialog):
+               self.session.open(Setup, dialog)
+
        def addMenu(self, destList, node):
                MenuTitle = getValbyAttr(node, "text")
                if MenuTitle != "":                                                                                                                                     #check for title
@@ -206,3 +182,56 @@ class Menu(Screen):
                        a = getValbyAttr(parent, "text")
                self["title"] = Header(a)
 
+class FixedMenu(Screen):
+       def okbuttonClick(self):
+               selection = self["menu"].getCurrent()
+               selection[1]()
+
+       def __init__(self, session, title, list):
+               Screen.__init__(self, session)
+               
+               self["menu"] = MenuList(list)   
+                                                       
+               self["actions"] = ActionMap(["OkCancelActions"], 
+                       {
+                               "ok": self.okbuttonClick,
+                               "cancel": self.close
+                       })
+               
+               self["title"] = Header(title)
+
+
+class MainMenu(Menu):
+       #add file load functions for the xml-file
+       #remove old code (i.e. goScan / goClock...)
+       
+       def __init__(self, *x):
+               Menu.__init__(self, *x)
+               self.skinName = "Menu"
+
+       def openDialog(self, dialog):
+               self.session.open(dialog)
+
+       def openSetup(self, dialog):
+               self.session.open(Setup, dialog)
+
+       def goSetup(self):
+               self.session.open(configTest)
+       
+       def setModeTV(self):
+               print "set Mode to TV"
+               pass
+
+       def setModeRadio(self):
+               print "set Mode to Radio"
+               pass
+
+       def setModeFile(self):
+               print "set Mode to File"
+               pass
+
+       def goScan(self):
+               self.session.open(ServiceScan)
+       
+       def goClock(self):
+               self.session.open(clockDisplay, Clock())