+ self.codeafter=False
+ self.runCode(self.wizard[self.currStep]["code"])
+ if self.runCode(self.wizard[self.currStep]["code_async"]):
+ if self.updateValues in self.onShown:
+ self.onShown.remove(self.updateValues)
+ else:
+ self.afterAsyncCode()
+
+ def afterAsyncCode(self):
+ if not self.updateValues in self.onShown:
+ self.onShown.append(self.updateValues)
+
+ if self.codeafter:
+ if self.wizard[self.prevStep]["nextstep"] is not None:
+ self.currStep = self.getStepWithID(self.wizard[self.prevStep]["nextstep"])
+ if self.gotoStep is not None:
+ self.currStep = self.getStepWithID(self.gotoStep)
+ self.currStep += 1
+ self.updateValues()
+ print "Now: " + str(self.currStep)
+ else:
+ if self.showList:
+ print "showing list,", self.currStep
+ for renderer in self.renderer:
+ rootrenderer = renderer
+ while renderer.source is not None:
+ print "self.list:", self["list"]
+ if renderer.source is self["list"]:
+ print "setZPosition"
+ rootrenderer.instance.setZPosition(1)
+ renderer = renderer.source
+
+ #self["list"].instance.setZPosition(1)
+ self.list = []
+ if (self.wizard[self.currStep].has_key("dynamiclist")):
+ print "dynamic list, calling", self.wizard[self.currStep]["dynamiclist"]
+ newlist = eval("self." + self.wizard[self.currStep]["dynamiclist"] + "()")
+ #self.wizard[self.currStep]["evaluatedlist"] = []
+ for entry in newlist:
+ #self.wizard[self.currStep]["evaluatedlist"].append(entry)
+ self.list.append(entry)
+ #del self.wizard[self.currStep]["dynamiclist"]
+ if (len(self.wizard[self.currStep]["list"]) > 0):
+ #self["list"].instance.setZPosition(2)
+ for x in self.wizard[self.currStep]["list"]:
+ self.list.append((self.getTranslation(x[0]), x[1]))
+ self.wizard[self.currStep]["evaluatedlist"] = self.list
+ self["list"].list = self.list
+ self["list"].index = 0
+ else:
+ self["list"].hide()
+
+ if self.showConfig:
+ print "showing config"
+ self["config"].instance.setZPosition(1)
+ if self.wizard[self.currStep]["config"]["type"] == "dynamic":
+ print "config type is dynamic"
+ self["config"].instance.setZPosition(2)
+ self["config"].l.setList(eval("self." + self.wizard[self.currStep]["config"]["source"])())
+ elif (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 "wizard screen", 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)
+ callbacks = self.configInstance["config"].onSelectionChanged
+ self.configInstance["config"].destroy()
+ print "clearConfigList", self.configInstance["config"], self["config"]
+ self.configInstance["config"] = self["config"]
+ self.configInstance["config"].onSelectionChanged = callbacks
+ print "clearConfigList", self.configInstance["config"], self["config"]
+ else:
+ self["config"].l.setList([])
+ self.handleInputHelpers()
+
+
+ else:
+ if self.has_key("config"):
+ self["config"].hide()
+
+ def timeoutCounterFired(self):
+ self.timeoutCounter -= 1
+ print "timeoutCounter:", self.timeoutCounter
+ if self.timeoutCounter == 0:
+ if self.wizard[self.currStep]["timeoutaction"] == "selectnext":
+ print "selection next item"
+ self.down()
+ else:
+ if self.wizard[self.currStep]["timeoutaction"] == "changestep":
+ self.finished(gotoStep = self.wizard[self.currStep]["timeoutstep"])
+ self.updateText()
+
+ def handleInputHelpers(self):
+ if self["config"].getCurrent() is not None:
+ if isinstance(self["config"].getCurrent()[1], ConfigText) or isinstance(self["config"].getCurrent()[1], ConfigPassword):
+ if self.has_key("VKeyIcon"):
+ self["VirtualKB"].setEnabled(True)
+ self["VKeyIcon"].boolean = True
+ if self.has_key("HelpWindow"):
+ if self["config"].getCurrent()[1].help_window.instance is not None:
+ helpwindowpos = self["HelpWindow"].getPosition()
+ from enigma import ePoint
+ self["config"].getCurrent()[1].help_window.instance.move(ePoint(helpwindowpos[0],helpwindowpos[1]))
+ else:
+ if self.has_key("VKeyIcon"):
+ self["VirtualKB"].setEnabled(False)
+ self["VKeyIcon"].boolean = False
+ else:
+ if self.has_key("VKeyIcon"):
+ self["VirtualKB"].setEnabled(False)
+ self["VKeyIcon"].boolean = False
+
+ def KeyText(self):
+ from Screens.VirtualKeyBoard import VirtualKeyBoard
+ self.currentConfigIndex = self["config"].getCurrentIndex()
+ self.session.openWithCallback(self.VirtualKeyBoardCallback, VirtualKeyBoard, title = self["config"].getCurrent()[0], text = self["config"].getCurrent()[1].getValue())
+
+ def VirtualKeyBoardCallback(self, callback = None):
+ if callback is not None and len(callback):
+ if isinstance(self["config"].getCurrent()[1], ConfigText) or isinstance(self["config"].getCurrent()[1], ConfigPassword):
+ if self.has_key("HelpWindow"):
+ if self["config"].getCurrent()[1].help_window.instance is not None:
+ helpwindowpos = self["HelpWindow"].getPosition()
+ from enigma import ePoint
+ self["config"].getCurrent()[1].help_window.instance.move(ePoint(helpwindowpos[0],helpwindowpos[1]))
+ self["config"].instance.moveSelectionTo(self.currentConfigIndex)
+ self["config"].setCurrentIndex(self.currentConfigIndex)
+ self["config"].getCurrent()[1].setValue(callback)
+ self["config"].invalidate(self["config"].getCurrent())