+ self.setTitle(_cached("T2"))
+
+ if justlocal:
+ return
+
+ language.activateLanguage(lang)
+ config.misc.languageselected.value = 0
+ config.misc.languageselected.save()
+ print "ok"
+
+ def updateList(self):
+ first_time = not self.list
+
+ languageList = language.getLanguageList()
+ if not languageList: # no language available => display only english
+ list = [ LanguageEntryComponent("en", _cached("en_EN"), "en_EN") ]
+ else:
+ list = [ LanguageEntryComponent(file = x[1][2].lower(), name = _cached("%s_%s" % x[1][1:3]), index = x[0]) for x in languageList]
+ self.list = list
+
+ #list.sort(key=lambda x: x[1][7])
+
+ print "updateList"
+ if first_time:
+ self["languages"].list = list
+ else:
+ self["languages"].updateList(list)
+ print "done"
+
+ def changed(self):
+ self.run(justlocal = True)
+ 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(justlocal = True)
+ self.updateList()
+ self.setText()
+
+ def setText(self):
+
+ self["text"].setText(_cached("T1"))