update timerlist when timerstate changes
[enigma2.git] / lib / python / Screens / LanguageSelection.py
index a51c067af46764a569f95111d7b9d7e7bfc846ed..399e20ec6509ad82b5056b7932ec077b7c42deb8 100644 (file)
@@ -12,18 +12,16 @@ class LanguageSelection(Screen):
                Screen.__init__(self, session)
                
                self.list = []
-               list = language.getLanguageList()
-               for x in language.lang:
-                       print x
-                       self.list.append(LanguageEntryComponent(x[2], x[0]))
-
                self["list"] = LanguageList(self.list)
+               self.updateList()
                
-               self["actions"] = ActionMap(["OkCancelActions"], 
+               self["actions"] = ActionMap(["WizardActions"], 
                {
                        "ok": self.save,
-                       "cancel": self.close
-               })
+                       "back": self.close,
+                       "up": self.up,
+                       "down": self.down
+               }, -1)
                
        def save(self):
                self.run()
@@ -33,3 +31,24 @@ class LanguageSelection(Screen):
                language.activateLanguage(self["list"].l.getCurrentSelectionIndex())
                config.osd.language.value = self["list"].l.getCurrentSelectionIndex()
                config.osd.language.save()
+               self.session.currentDialog.instance.setTitle(_("Language selection"))
+
+       def updateList(self):
+               self.list = []
+               if len(language.lang) == 0: # no language available => display only english
+                       self.list.append(LanguageEntryComponent("en", _("English")))
+               else:
+                       for x in language.lang:
+                               self.list.append(LanguageEntryComponent(x[2], _(x[0])))
+               
+               self["list"].l.setList(self.list)
+
+       def up(self):
+               self["list"].instance.moveSelection(self["list"].instance.moveUp)
+               self.run()
+               self.updateList()
+               
+       def down(self):
+               self["list"].instance.moveSelection(self["list"].instance.moveDown)
+               self.run()
+               self.updateList()