some service scan improovements
[enigma2.git] / lib / python / Screens / Ci.py
index f349d63aa81e2c46651ad916c8732004fadd651b..5028301e9275c37ad57b2dadf9ce931aa7cdeaa5 100644 (file)
@@ -6,7 +6,9 @@ from Components.Label import Label
 from Components.config import config, ConfigSubsection, ConfigSelection, ConfigSubList, getConfigListEntry, KEY_LEFT, KEY_RIGHT, KEY_0, ConfigNothing, ConfigPIN
 from Components.ConfigList import ConfigList
 
-from enigma import eTimer, eDVBCI_UI
+from Components.SystemInfo import SystemInfo
+
+from enigma import eTimer, eDVBCI_UI, eDVBCIInterfaces
 
 MAX_NUM_CI = 4
 
@@ -22,11 +24,12 @@ class MMIDialog(Screen):
 
                print "MMIDialog with action" + str(action)
 
+               self.mmiclosed = False
                self.tag = None
                self.slotid = slotid
 
                self.timer = eTimer()
-               self.timer.timeout.get().append(self.keyCancel)
+               self.timer.callback.append(self.keyCancel)
 
                #else the skins fails
                self["title"] = Label("")
@@ -113,10 +116,9 @@ class MMIDialog(Screen):
 
        def keyCancel(self):
                self.timer.stop()
-               if not self.tag:
+               if not self.tag or self.mmiclosed:
                        self.closeMmi()
-                       return
-               if self.tag == "WAIT":
+               elif self.tag == "WAIT":
                        self.handler.stopMMI(self.slotid)
                        self.closeMmi()
                elif self.tag in [ "MENU", "LIST" ]:
@@ -174,11 +176,13 @@ class MMIDialog(Screen):
                self.timer.stop()
                if len(screen) > 0 and screen[0][0] == "CLOSE":
                        timeout = screen[0][1]
+                       self.mmiclosed = True
                        if timeout > 0:
                                self.timer.start(timeout*1000, True)
                        else:
                                self.keyCancel()
                else:
+                       self.mmiclosed = False
                        self.tag = screen[0][0]
                        for entry in screen:
                                if entry[0] == "PIN":
@@ -222,6 +226,7 @@ class CiMessageHandler:
                self.ci = { }
                self.dlgs = { }
                eDVBCI_UI.getInstance().ciStateChanged.get().append(self.ciStateChanged)
+               SystemInfo["CommonInterface"]= eDVBCIInterfaces.getInstance().getNumOfSlots() > 0
 
        def setSession(self, session):
                self.session = session