don't change language on pressing EXIT
[enigma2.git] / lib / python / Screens / LanguageSelection.py
index e5be57e..83d0340 100644 (file)
@@ -11,6 +11,8 @@ class LanguageSelection(Screen):
        def __init__(self, session):
                Screen.__init__(self, session)
                
+               self.oldActiveLanguage = language.getActiveLanguage()
+               
                self.list = []
                self["list"] = LanguageList(self.list)
                self.updateList()
@@ -19,7 +21,7 @@ class LanguageSelection(Screen):
                self["actions"] = ActionMap(["OkCancelActions", "DirectionActions"], 
                {
                        "ok": self.save,
-                       "cancel": self.close,
+                       "cancel": self.cancel,
                        "up": self.up,
                        "down": self.down,
                        "left": self.left,
@@ -39,6 +41,10 @@ class LanguageSelection(Screen):
                self.run()
                self.close()
        
+       def cancel(self):
+               language.activateLanguage(self.oldActiveLanguage)
+               self.close()
+       
        def run(self):
                language.activateLanguage(self["list"].l.getCurrentSelection()[0])
                config.osd.language.value = self["list"].l.getCurrentSelection()[0]