+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.run()
+
+ if (len(self.wizard[self.currStep]["list"]) > 0):
+ nextStep = self.wizard[self.currStep]["list"][self["list"].l.getCurrentSelectionIndex()][1]
+ if nextStep == "end":
+ self.currStep = self.numSteps
+ elif nextStep == "next":
+ pass
+ else:
+ self.currStep = int(nextStep) - 1
+
+ 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 keyNumberGlobal(self, number):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyNumberGlobal(number)
+
+ def left(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyLeft()
+ print "left"
+
+ def right(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyRight()
+ print "right"
+
+ def up(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ 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["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):
+ self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps))
+ self["stepslider"].setValue(self.currStep)
+
+ self["text"].setText(self.wizard[self.currStep]["text"])
+
+ 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):
+ 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"])