fix bluescreen in ci menu when no entries in a menulist an ok is pressed
[enigma2.git] / lib / python / Screens / Ci.py
index 01df794..ecc5604 100644 (file)
@@ -89,7 +89,11 @@ class CiMmi(Screen):
                        print "do nothing - wait"
                elif self.tag == "MENU":
                        print "answer MENU"
-                       eDVBCI_UI.getInstance().answerMenu(self.slotid, self["entries"].getCurrent()[1])
+                       cur = self["entries"].getCurrent()
+                       if cur:
+                               eDVBCI_UI.getInstance().answerMenu(self.slotid, cur[1])
+                       else:
+                               eDVBCI_UI.getInstance().answerMenu(self.slotid, 0)
                        self.showWait() 
                elif self.tag == "LIST":
                        print "answer LIST"
@@ -124,14 +128,20 @@ class CiMmi(Screen):
                else:
                        print "give cancel action to ci"        
 
+       def keyConfigEntry(self, key):
+               try:
+                       self["entries"].handleKey(key)
+               except AttributeError:
+                       pass
+
        def keyNumberGlobal(self, number):
-               self["entries"].handleKey(config.key[str(number)])
+               self.keyConfigEntry(config.key[str(number)])
 
        def keyLeft(self):
-               self["entries"].handleKey(config.key["prevElement"])
+               self.keyConfigEntry(config.key["prevElement"])
 
        def keyRight(self):
-               self["entries"].handleKey(config.key["nextElement"])
+               self.keyConfigEntry(config.key["nextElement"])
 
        def updateList(self, list):
                List = self["entries"]
@@ -156,7 +166,6 @@ class CiMmi(Screen):
 
                List.l.setList(list)
 
-
        def showWait(self):
                self.tag = "WAIT"
                self["title"].setText("")