From: Stefan Pluecken Date: Wed, 7 Dec 2005 14:39:36 +0000 (+0000) Subject: use steps in startwizard X-Git-Tag: 2.6.0~4794 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/7ee8589392aca17526ca30264689f204afc9646a?hp=22143de3c8c4780166beeb1e0a1575768c76bfe4 use steps in startwizard --- diff --git a/data/arrowdown.png b/data/arrowdown.png new file mode 100755 index 00000000..02b55735 Binary files /dev/null and b/data/arrowdown.png differ diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 6e0e94ba..0a6eb590 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -10,4 +10,4 @@ install_PYTHON = \ InputDevice.py ServicePosition.py SetupDevices.py Harddisk.py \ AVSwitch.py Network.py RFmod.py DiskInfo.py NimManager.py Lcd.py \ EpgList.py ScrollLabel.py Timezones.py Language.py HelpMenuList.py \ - BlinkingPixmap.py Pixmap.py ConditionalWidget.py + BlinkingPixmap.py Pixmap.py ConditionalWidget.py Slider.py diff --git a/lib/python/Components/Pixmap.py b/lib/python/Components/Pixmap.py index 2a54ea98..5f4b9691 100644 --- a/lib/python/Components/Pixmap.py +++ b/lib/python/Components/Pixmap.py @@ -17,6 +17,9 @@ class Pixmap(Widget): def removeWidget(self, w): pass + def move(self, x, y): + self.instance.move(ePoint(int(x), int(y))) + class PixmapConditional(ConditionalWidget, Pixmap): def __init__(self, withTimer = True): ConditionalWidget.__init__(self) diff --git a/lib/python/Components/Slider.py b/lib/python/Components/Slider.py new file mode 100644 index 00000000..dae13d9c --- /dev/null +++ b/lib/python/Components/Slider.py @@ -0,0 +1,19 @@ +from HTMLComponent import * +from GUIComponent import * +from VariableValue import * +from VariableText import * + +from enigma import eSlider + +class Slider(HTMLComponent, GUIComponent, VariableValue): + def __init__(self, min, max): + VariableValue.__init__(self) + GUIComponent.__init__(self) + + self.min = min + self.max = max + + def createWidget(self, parent): + g = eSlider(parent) + g.setRange(self.min, self.max) + return g \ No newline at end of file diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 664cca83..b199634d 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -2,6 +2,7 @@ from Screen import Screen from Screens.HelpMenu import HelpableScreen from Components.Label import Label +from Components.Slider import Slider from Components.ActionMap import HelpableActionMap from Components.config import config, configElementBoolean from Components.Pixmap import Pixmap @@ -12,31 +13,54 @@ class WelcomeWizard(Screen, HelpableScreen): skin = """ - + + + - + """ + + text = [_("Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox."), + _("Bla"), + _("Blub")] def __init__(self, session): self.skin = WelcomeWizard.skin + self.numSteps = 3 + self.currStep = 1 Screen.__init__(self, session) HelpableScreen.__init__(self) - self["text"] = Label(_("Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox.")); + self["text"] = Label() self["rc"] = Pixmap() - self["circle"] = Pixmap() + self["arrowdown"] = Pixmap() + + self["step"] = Label() + + self["stepslider"] = Slider(1, self.numSteps) + + self.updateValues() self["actions"] = HelpableActionMap(self, "OkCancelActions", { "ok": (self.ok, _("Close this Screen...")), }) + def updateValues(self): + self["text"].setText(self.text[self.currStep - 1]) + self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps)) + self["stepslider"].setValue(self.currStep) + def ok(self): - config.misc.firstrun.value = 0; - config.misc.firstrun.save() - self.session.close() + if (self.currStep == self.numSteps): # wizard finished + config.misc.firstrun.value = 0; + config.misc.firstrun.save() + self.session.close() + else: + self.currStep += 1 + self.updateValues() def listActiveWizards(): wizards = [ ]