finish language-menu - the RT_VALIGN_CENTER doesn't work in eListboxPythonMultiConten...
[enigma2.git] / lib / python / Screens / LanguageSelection.py
1 from Screen import Screen
2
3 from Components.MenuList import MenuList
4 from Components.ActionMap import ActionMap
5 from Components.Language import language
6 from Components.LanguageList import *
7
8
9 class LanguageSelection(Screen):
10         def __init__(self, session):
11                 Screen.__init__(self, session)
12                 
13                 self.list = []
14                 list = language.getLanguageList()
15                 for x in language.lang:
16                         print x
17                         self.list.append(LanguageEntryComponent(x[2], x[0]))
18
19                 self["list"] = LanguageList(self.list)
20                 
21                 self["actions"] = ActionMap(["OkCancelActions"], 
22                 {
23                         "ok": self.save,
24                         "cancel": self.close
25                 })
26                 print "INIT LANGUAGESELECTION"
27                 
28         def save(self):
29                 self.run()
30                 self.close()
31         
32         def run(self):
33                 language.activateLanguage(self["list"].l.getCurrentSelectionIndex())