+ 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 = []
+ if (len(self.wizard[self.currStep]["list"]) > 0):
+ self["list"].instance.setZPosition(2)
+ for x in self.wizard[self.currStep]["list"]:
+ self.list.append((_(x[0]), None))
+ self["list"].l.setList(self.list)
+
+ self["config"].instance.setZPosition(1)
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ 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["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([])
+ else: # condition false
+ self.currStep += 1
+ self.updateValues()
+
+ def delReferences(self):
+ del self.configInstance
+
+class WizardManager:
+ def __init__(self):
+ self.wizards = []
+
+ def registerWizard(self, wizard):
+ self.wizards.append(wizard)
+
+ def getWizards(self):
+ if config.misc.firstrun.value:
+ return self.wizards
+ else:
+ return []
+
+wizardManager = WizardManager()