From: Stefan Pluecken Date: Wed, 23 Jul 2008 20:12:12 +0000 (+0000) Subject: add LanguageWizard to adapt to the wizard design of the start wizard X-Git-Tag: 2.6.0~994 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/60c335d6a15c3c6e417833bac39273bae4fc89f7 add LanguageWizard to adapt to the wizard design of the start wizard --- diff --git a/data/skin_default.xml b/data/skin_default.xml index 40613606..cc478d12 100644 --- a/data/skin_default.xml +++ b/data/skin_default.xml @@ -394,6 +394,26 @@ self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count > 7 and 2 or 3) + + + + + {"template": [ + MultiContentEntryText(pos = (80, 10), size = (200, 50), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the language name, + MultiContentEntryPixmap(pos = (10, 5), size = (60, 40), png = 2), # index 2 is the pixmap + ], + "fonts": [gFont("Regular", 20)], + "itemHeight": 50 + } + + + + + + + + + diff --git a/lib/python/Screens/LanguageSelection.py b/lib/python/Screens/LanguageSelection.py index 7d5596fd..0fe53d65 100644 --- a/lib/python/Screens/LanguageSelection.py +++ b/lib/python/Screens/LanguageSelection.py @@ -4,8 +4,12 @@ from Components.ActionMap import ActionMap from Components.Language import language from Components.config import config from Components.Sources.List import List +from Components.Label import Label +from Components.Pixmap import Pixmap -from Tools.Directories import * +from Screens.Rc import Rc + +from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE from Tools.LoadPixmap import LoadPixmap @@ -85,3 +89,27 @@ class LanguageSelection(Screen): def changed(self): self.run() self.updateList() + +class LanguageWizard(LanguageSelection, Rc): + def __init__(self, session): + LanguageSelection.__init__(self, session) + Rc.__init__(self) + self.onLayoutFinish.append(self.selectKeys) + + self["wizard"] = Pixmap() + self["text"] = Label() + self.setText() + + def selectKeys(self): + self.clearSelectedKeys() + self.selectKey("UP") + self.selectKey("DOWN") + + def changed(self): + self.run() + self.updateList() + self.setText() + + def setText(self): + self["text"].setText(_("Please use the UP and DOWN keys to select your language. Afterwards press the OK button.")) + diff --git a/lib/python/Screens/StartWizard.py b/lib/python/Screens/StartWizard.py index ae806ab6..aab81f63 100644 --- a/lib/python/Screens/StartWizard.py +++ b/lib/python/Screens/StartWizard.py @@ -7,7 +7,7 @@ from Screens.Rc import Rc from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap from Components.config import config, ConfigBoolean, configfile, ConfigSubsection -from LanguageSelection import LanguageSelection +from LanguageSelection import LanguageWizard config.misc.firstrun = ConfigBoolean(default = True) config.misc.startwizard = ConfigSubsection() @@ -28,5 +28,5 @@ class StartWizard(DefaultSatLists, Rc): config.misc.firstrun.save() configfile.save() -wizardManager.registerWizard(LanguageSelection, config.misc.languageselected.value, priority = 5) +wizardManager.registerWizard(LanguageWizard, config.misc.languageselected.value, priority = 5) wizardManager.registerWizard(StartWizard, config.misc.firstrun.value, priority = 20)