diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-11 01:42:36 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-11 01:42:36 +0000 |
| commit | fe798a5d31319171dbb76c6d9fec268e691d3f77 (patch) | |
| tree | c4165575c6780e0b9f96428d8b69b14a5de7aea8 /lib/python/Screens | |
| parent | 490bc59fbd4777f1a5041a71c1de7c5e76ff1eae (diff) | |
| download | enigma2-fe798a5d31319171dbb76c6d9fec268e691d3f77.tar.gz enigma2-fe798a5d31319171dbb76c6d9fec268e691d3f77.zip | |
finish language-menu - the RT_VALIGN_CENTER doesn't work in eListboxPythonMultiContent... why?
add language-screen to the start-wizard, which breaks the startwizard. bug in screen-handling?
Diffstat (limited to 'lib/python/Screens')
| -rw-r--r-- | lib/python/Screens/LanguageSelection.py | 10 | ||||
| -rw-r--r-- | lib/python/Screens/Wizard.py | 44 |
2 files changed, 33 insertions, 21 deletions
diff --git a/lib/python/Screens/LanguageSelection.py b/lib/python/Screens/LanguageSelection.py index a0441b6d..42f54207 100644 --- a/lib/python/Screens/LanguageSelection.py +++ b/lib/python/Screens/LanguageSelection.py @@ -3,6 +3,8 @@ from Screen import Screen from Components.MenuList import MenuList from Components.ActionMap import ActionMap from Components.Language import language +from Components.LanguageList import * + class LanguageSelection(Screen): def __init__(self, session): @@ -10,16 +12,18 @@ class LanguageSelection(Screen): self.list = [] list = language.getLanguageList() - for x in list: - self.list.append((x, None)) + for x in language.lang: + print x + self.list.append(LanguageEntryComponent(x[2], x[0])) - self["list"] = MenuList(self.list) + self["list"] = LanguageList(self.list) self["actions"] = ActionMap(["OkCancelActions"], { "ok": self.save, "cancel": self.close }) + print "INIT LANGUAGESELECTION" def save(self): self.run() diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 38235b12..07c5f9af 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -118,8 +118,12 @@ class WelcomeWizard(Screen, HelpableScreen): #}) def ok(self): + print "OK" if (self.wizard[self.currStep]["config"]["screen"] != None): - self.configInstance.run() + try: # don't die, if no run() is available + self.configInstance.run() + except: + print "Failed to run configInstance" if (len(self.wizard[self.currStep]["list"]) > 0): nextStep = self.wizard[self.currStep]["list"][self["list"].l.getCurrentSelectionIndex()][1] @@ -137,6 +141,8 @@ class WelcomeWizard(Screen, HelpableScreen): else: self.currStep += 1 self.updateValues() + + print "Now: " + str(self.currStep) def keyNumberGlobal(self, number): if (self.wizard[self.currStep]["config"]["screen"] != None): @@ -154,23 +160,28 @@ class WelcomeWizard(Screen, HelpableScreen): def up(self): if (self.wizard[self.currStep]["config"]["screen"] != None): - self[self.currConfig].instance.moveSelection(self[self.currConfig].instance.moveUp) + self["config"].instance.moveSelection(self["config"].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): - self[self.currConfig].instance.moveSelection(self[self.currConfig].instance.moveDown) + self["config"].instance.moveSelection(self["config"].instance.moveDown) elif (len(self.wizard[self.currStep]["list"]) > 0): self["list"].instance.moveSelection(self["config"].instance.moveDown) print "down" def updateValues(self): + print "Updating values in step " + str(self.currStep) self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps)) self["stepslider"].setValue(self.currStep) self["text"].setText(self.wizard[self.currStep]["text"]) + + if self.wizard[self.currStep]["code"] != "": + print self.wizard[self.currStep]["code"] + exec(self.wizard[self.currStep]["code"]) self["list"].instance.setZPosition(1) self.list = [] @@ -182,25 +193,22 @@ class WelcomeWizard(Screen, HelpableScreen): self["config"].instance.setZPosition(1) if (self.wizard[self.currStep]["config"]["screen"] != None): - 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"]) + if self.wizard[self.currStep]["config"]["type"] == "standalone": + print "Type is standalone" + self.session.openWithCallback(self.ok, 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[self.currConfig].l.setList(self.configInstance[self.currConfig].list) - self.configInstance[self.currConfig] = self[self.currConfig] + self["config"].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"])) + self["config"].l.setList(self.configInstance["config"].list) + self.configInstance["config"] = self["config"] else: self["config"].l.setList([]) - if self.wizard[self.currStep]["code"] != "": - print self.wizard[self.currStep]["code"] - exec(self.wizard[self.currStep]["code"]) + def listActiveWizards(): wizards = [ ] |
