add language selection to the start-wizard
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 10 Dec 2005 23:11:45 +0000 (23:11 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sat, 10 Dec 2005 23:11:45 +0000 (23:11 +0000)
data/menu.xml
data/setup.xml
data/skin.xml
data/startwizard.xml
lib/python/Components/MenuList.py
lib/python/Screens/LanguageSelection.py
lib/python/Screens/Wizard.py

index 485a304..7bdc32a 100644 (file)
@@ -41,6 +41,7 @@
                                <!--<item text="Satfinder"></item>-->
                        </menu>
                        <menu text="System">
                                <!--<item text="Satfinder"></item>-->
                        </menu>
                        <menu text="System">
+                               <item text="Language"><screen module="LanguageSelection" /></item>
                                <item text="Timezone"><setup id="timezone" /></item>
                                <item text="Video Audio"><setup id="avsetup" /></item>
                                <item text="UHF Modulator"><setup id="RFmod" /></item>
                                <item text="Timezone"><setup id="timezone" /></item>
                                <item text="Video Audio"><setup id="avsetup" /></item>
                                <item text="UHF Modulator"><setup id="RFmod" /></item>
index bdb6bde..e04a51d 100644 (file)
@@ -39,7 +39,7 @@
                        <item text="Alpha">config.osd.alpha</item>
                        <item text="Brightness">config.osd.bright</item>
                        <item text="Contrast">config.osd.contrast</item>
                        <item text="Alpha">config.osd.alpha</item>
                        <item text="Brightness">config.osd.bright</item>
                        <item text="Contrast">config.osd.contrast</item>
-                       <item text="Language">config.osd.language</item>
+<!--                   <item text="Language">config.osd.language</item>-->
                </setup>
                <setup key="lcd" title="LCD Setup">
                        <item text="Brightness">config.lcd.bright</item>
                </setup>
                <setup key="lcd" title="LCD Setup">
                        <item text="Brightness">config.lcd.bright</item>
index b7b0240..71b4b16 100644 (file)
@@ -70,6 +70,9 @@
                        <widget name="ok" position="140,240" size="38,20" font="Arial;20" backgroundColor="green" />
                        <widget name="cancel" position="240,240" size="70,20" font="Arial;20" backgroundColor="red" />
                </screen>
                        <widget name="ok" position="140,240" size="38,20" font="Arial;20" backgroundColor="green" />
                        <widget name="cancel" position="240,240" size="70,20" font="Arial;20" backgroundColor="red" />
                </screen>
+               <screen name="LanguageSelection" position="100,125" size="540,280" title="Language selection">
+                       <widget name="list" position="10,50" size="520,175" />
+               </screen>
                <screen name="NimSelection" position="140,165" size="400,100" title="select Slot">
                        <widget name="nimlist" position="20,10" size="360,75" />
                </screen>
                <screen name="NimSelection" position="140,165" size="400,100" title="select Slot">
                        <widget name="nimlist" position="20,10" size="360,75" />
                </screen>
index 89352ab..aade9c0 100644 (file)
@@ -1,6 +1,7 @@
 <wizard>
                <step number="1">
                        <text value="Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox.\n\nPress the OK button on your remote control to move to the next step." />
 <wizard>
                <step number="1">
                        <text value="Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox.\n\nPress the OK button on your remote control to move to the next step." />
+                       <config screen="LanguageSelection" module="LanguageSelection" type="MenuList" />
                        <code>
 self["arrowdown"].moveTo(557, 232, 10)
 self["rc"].moveTo(500, 50, 10)         
                        <code>
 self["arrowdown"].moveTo(557, 232, 10)
 self["rc"].moveTo(500, 50, 10)         
@@ -23,7 +24,7 @@ self["arrowup"].startMoving()
                </step>
                <step number="3">
                        <text value="Please set up tuner A" />
                </step>
                <step number="3">
                        <text value="Please set up tuner A" />
-                       <config screen="NimSetup" module="Satconfig" args="0" />
+                       <config screen="NimSetup" module="Satconfig" args="0" type="ConfigList" />
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
@@ -35,7 +36,7 @@ self["arrowdown"].startMoving()
                </step>
                <step number="4">
                        <text value="Please set up tuner B" />
                </step>
                <step number="4">
                        <text value="Please set up tuner B" />
-                       <config screen="NimSetup" module="Satconfig" args="1" />
+                       <config screen="NimSetup" module="Satconfig" args="1" type="ConfigList" />
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
@@ -54,7 +55,7 @@ self["arrowdown"].startMoving()
                </step>
                <step number="6">
                        <text value="What do you want to scan?" />
                </step>
                <step number="6">
                        <text value="What do you want to scan?" />
-                       <config screen="ScanSimple" module="ScanSetup" />
+                       <config screen="ScanSimple" module="ScanSetup" type="ConfigList" />
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
                        <code>
 self["arrowup"].moveTo(740, 355, 10)
 self["arrowup"].startMoving()
index 6fb3354..03e6be6 100644 (file)
@@ -6,8 +6,9 @@ from enigma import eListboxPythonStringContent, eListbox
 class MenuList(HTMLComponent, GUIComponent):
        def __init__(self, list):
                GUIComponent.__init__(self)
 class MenuList(HTMLComponent, GUIComponent):
        def __init__(self, list):
                GUIComponent.__init__(self)
+               self.list = list
                self.l = eListboxPythonStringContent()
                self.l = eListboxPythonStringContent()
-               self.l.setList(list)
+               self.l.setList(self.list)
        
        def getCurrent(self):
                return self.l.getCurrentSelection()
        
        def getCurrent(self):
                return self.l.getCurrentSelection()
index e69de29..ca7f219 100644 (file)
@@ -0,0 +1,25 @@
+from Screen import Screen
+
+from Components.MenuList import MenuList
+from Components.ActionMap import ActionMap
+
+class LanguageSelection(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               
+               self.list = []
+               self.list.append(("English", None))
+               self.list.append(("German", None))
+               self["list"] = MenuList(self.list)
+               
+               self["actions"] = ActionMap(["OkCancelActions"], 
+               {
+                       "ok": self.save,
+                       "cancel": self.close
+               })
+               
+       def save(self):
+               pass
+       
+       def run(self):
+               print "select the language here"
\ No newline at end of file
index 7687f44..38235b1 100644 (file)
@@ -39,7 +39,7 @@ class WelcomeWizard(Screen, HelpableScreen):
                        self.currContent = name
                        if (name == "step"):
                                self.lastStep = int(attrs.get('number'))
                        self.currContent = name
                        if (name == "step"):
                                self.lastStep = int(attrs.get('number'))
-                               self.wizard[self.lastStep] = {"text": "", "list": [], "config": {"screen": None, "args": None }, "code": ""}
+                               self.wizard[self.lastStep] = {"text": "", "list": [], "config": {"screen": None, "args": None, "type": "" }, "code": ""}
                        elif (name == "text"):
                                self.wizard[self.lastStep]["text"] = str(attrs.get('value'))
                        elif (name == "listentry"):
                        elif (name == "text"):
                                self.wizard[self.lastStep]["text"] = str(attrs.get('value'))
                        elif (name == "listentry"):
@@ -50,6 +50,7 @@ class WelcomeWizard(Screen, HelpableScreen):
                                if (attrs.has_key('args')):
                                        print "has args"
                                        self.wizard[self.lastStep]["config"]["args"] = str(attrs.get('args'))
                                if (attrs.has_key('args')):
                                        print "has args"
                                        self.wizard[self.lastStep]["config"]["args"] = str(attrs.get('args'))
+                               self.wizard[self.lastStep]["config"]["type"] = str(attrs.get('type'))
                def endElement(self, name):
                        self.currContent = ""
                        if name == 'code':
                def endElement(self, name):
                        self.currContent = ""
                        if name == 'code':
@@ -153,14 +154,14 @@ class WelcomeWizard(Screen, HelpableScreen):
 
        def up(self):
                if (self.wizard[self.currStep]["config"]["screen"] != None):
 
        def up(self):
                if (self.wizard[self.currStep]["config"]["screen"] != None):
-                       self["config"].instance.moveSelection(self["config"].instance.moveUp)
+                       self[self.currConfig].instance.moveSelection(self[self.currConfig].instance.moveUp)
                elif (len(self.wizard[self.currStep]["list"]) > 0):
                        self["list"].instance.moveSelection(self["config"].instance.moveUp)
                print "up"
                
        def down(self):
                if (self.wizard[self.currStep]["config"]["screen"] != None):
                elif (len(self.wizard[self.currStep]["list"]) > 0):
                        self["list"].instance.moveSelection(self["config"].instance.moveUp)
                print "up"
                
        def down(self):
                if (self.wizard[self.currStep]["config"]["screen"] != None):
-                       self["config"].instance.moveSelection(self["config"].instance.moveDown)
+                       self[self.currConfig].instance.moveSelection(self[self.currConfig].instance.moveDown)
                elif (len(self.wizard[self.currStep]["list"]) > 0):
                        self["list"].instance.moveSelection(self["config"].instance.moveDown)
                print "down"
                elif (len(self.wizard[self.currStep]["list"]) > 0):
                        self["list"].instance.moveSelection(self["config"].instance.moveDown)
                print "down"
@@ -181,14 +182,19 @@ class WelcomeWizard(Screen, HelpableScreen):
 
                self["config"].instance.setZPosition(1)
                if (self.wizard[self.currStep]["config"]["screen"] != None):
 
                self["config"].instance.setZPosition(1)
                if (self.wizard[self.currStep]["config"]["screen"] != None):
-                       self["config"].instance.setZPosition(2)
+                       if self.wizard[self.currStep]["config"]["type"] == "ConfigList":
+                               self.currConfig = "config"
+                       elif self.wizard[self.currStep]["config"]["type"] == "MenuList":
+                               self.currConfig = "list"
+
+                       self[self.currConfig].instance.setZPosition(2)
                        print self.wizard[self.currStep]["config"]["screen"]
                        if self.wizard[self.currStep]["config"]["args"] == None:
                                self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"])
                        else:
                                self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"], eval(self.wizard[self.currStep]["config"]["args"]))
                        print self.wizard[self.currStep]["config"]["screen"]
                        if self.wizard[self.currStep]["config"]["args"] == None:
                                self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"])
                        else:
                                self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"], eval(self.wizard[self.currStep]["config"]["args"]))
-                       self["config"].l.setList(self.configInstance["config"].list)
-                       self.configInstance["config"] = self["config"]
+                       self[self.currConfig].l.setList(self.configInstance[self.currConfig].list)
+                       self.configInstance[self.currConfig] = self[self.currConfig]
                else:
                        self["config"].l.setList([])
 
                else:
                        self["config"].l.setList([])