From 939e78997bc25b22b3270ae3e298b0cc49becdbf Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sun, 11 Dec 2005 03:31:42 +0000 Subject: rename a baseclass wizard for further wizards derive a StartWizard-class from this wizard-baseclass each wizard now has a listbox, a configlist, a text-label and a xml file describing the wizard --- lib/python/Screens/Wizard.py | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) (limited to 'lib/python/Screens/Wizard.py') diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 07c5f9af..97b07bfd 100644 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -14,19 +14,7 @@ from xml.sax.handler import ContentHandler config.misc.firstrun = configElementBoolean("config.misc.firstrun", 1); -class WelcomeWizard(Screen, HelpableScreen): - - skin = """ - - - - - - - - - - """ +class Wizard(Screen, HelpableScreen): class parseWizard(ContentHandler): def __init__(self, wizard): @@ -61,25 +49,20 @@ class WelcomeWizard(Screen, HelpableScreen): self.wizard[self.lastStep]["code"] = self.wizard[self.lastStep]["code"] + ch def __init__(self, session): - self.skin = WelcomeWizard.skin - Screen.__init__(self, session) HelpableScreen.__init__(self) self.wizard = {} parser = make_parser() - print "Reading startwizard.xml" + print "Reading " + self.xmlfile wizardHandler = self.parseWizard(self.wizard) parser.setContentHandler(wizardHandler) - parser.parse('/usr/share/enigma2/startwizard.xml') + parser.parse('/usr/share/enigma2/' + self.xmlfile) self.numSteps = len(self.wizard) self.currStep = 1 self["text"] = Label() - self["rc"] = MovingPixmap() - self["arrowdown"] = MovingPixmap() - self["arrowup"] = MovingPixmap() self["config"] = ConfigList([]) @@ -208,12 +191,17 @@ class WelcomeWizard(Screen, HelpableScreen): else: self["config"].l.setList([]) - - -def listActiveWizards(): - wizards = [ ] - - if config.misc.firstrun.value: - wizards.append(WelcomeWizard) +class WizardManager: + def __init__(self): + self.wizards = [] - return wizards + def registerWizard(self, wizard): + self.wizards.append(wizard) + + def getWizards(self): + if config.misc.firstrun.value: + return self.wizards + else: + return [] + +wizardManager = WizardManager() -- cgit v1.2.3