+ config.misc.languageselected.value = 0
+ config.misc.languageselected.save()
+ self.setTitle(_("Language selection"))
+ print "ok"
+
+ def updateList(self):
+ print "update list"
+ first_time = len(self.list) == 0
+
+ self.list = []
+ if len(language.getLanguageList()) == 0: # no language available => display only english
+ self.list.append(LanguageEntryComponent("en", _("English"), "en_EN"))
+ else:
+ for x in language.getLanguageList():
+ self.list.append(LanguageEntryComponent(file = x[1][2].lower(), name = _(x[1][0]), index = x[0]))
+ #self.list.sort(key=lambda x: x[1][7])
+
+ print "updateList"
+ if first_time:
+ self["languages"].list = self.list
+ else:
+ self["languages"].updateList(self.list)
+ print "done"
+
+ def changed(self):
+ self.run()
+ self.updateList()
+
+class LanguageWizard(LanguageSelection, Rc):
+ def __init__(self, session):
+ LanguageSelection.__init__(self, session)
+ Rc.__init__(self)
+ self.onLayoutFinish.append(self.selectKeys)
+
+ self["wizard"] = Pixmap()
+ self["text"] = Label()
+ self.setText()
+
+ def selectKeys(self):
+ self.clearSelectedKeys()
+ self.selectKey("UP")
+ self.selectKey("DOWN")
+
+ def changed(self):
+ self.run()
+ self.updateList()
+ self.setText()
+
+ def setText(self):
+ self["text"].setText(_("Please use the UP and DOWN keys to select your language. Afterwards press the OK button."))
+