-from Screen import *
-from Components.MenuList import MenuList
+from Screen import Screen
from Components.ActionMap import ActionMap
from Components.ActionMap import NumberActionMap
-from Components.Header import Header
-from Components.Button import Button
from Components.Label import Label
-from Components.HTMLComponent import *
-from Components.GUIComponent import *
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, eListboxPythonStringContent, eListboxPythonConfigContent
+from enigma import eTimer, eDVBCI_UI
-TYPE_MENU = 0
-TYPE_CONFIG = 1
MAX_NUM_CI = 4
def InitCiConfig():
self["subtitle"] = Label("")
self["bottom"] = Label("")
self["entries"] = ConfigList([ ])
- self.listtype = TYPE_CONFIG
self["actions"] = NumberActionMap(["SetupActions"],
{
try:
List.instance.moveSelectionTo(0)
except:
- List.l.setList(list)
- return
-
- if self.tag and self.tag == "ENQ":
- type = TYPE_CONFIG
- else:
- type = TYPE_MENU
-
- if type != self.listtype:
- if type == TYPE_CONFIG:
- List.l = eListboxPythonConfigContent()
- else:
- List.l = eListboxPythonStringContent()
- List.instance.setContent(List.l)
- self.listtype = type
-
+ pass
List.l.setList(list)
def showWait(self):
self["subtitle"].setText("")
self["bottom"].setText("")
list = [ ]
- list.append( ("wait for ci...", 0) )
+ list.append( (_("wait for ci..."), ConfigNothing()) )
self.updateList(list)
def showScreen(self):
elif eDVBCI_UI.getInstance().availableMMI(slot) == 1:
if self.session:
self.dlgs[slot] = self.session.openWithCallback(self.dlgClosed, CiMmi, slot, 3)
- else:
- print "no session"
def dlgClosed(self, slot):
- del self.dlgs[slot]
+ if slot in self.dlgs:
+ del self.dlgs[slot]
def registerCIMessageHandler(self, slot, func):
self.unregisterCIMessageHandler(slot)
class CiSelection(Screen):
def __init__(self, session):
Screen.__init__(self, session)
-
self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
{
"left": self.keyLeft,
menuList.list = self.list
menuList.l.setList(self.list)
self["entries"] = menuList
+ self["entries"].onSelectionChanged.append(self.selectionChanged)
+ self["text"] = Label(_("Slot %d")%(1))
+
+ def selectionChanged(self):
+ cur_idx = self["entries"].getCurrentIndex()
+ self["text"].setText(_("Slot %d")%((cur_idx / 4)+1))
def keyConfigEntry(self, key):
try:
self.state[slot] = state
slotidx=0
- while self.list[slotidx][2] != slot:
+ while len(self.list[slotidx]) < 3 or self.list[slotidx][3] != slot:
slotidx += 1
slotidx += 1 # do not change Reset
self.dlg = self.session.openWithCallback(self.dlgClosed, CiMmi, slot, action)
def cancel(self):
- CiHandler.unregisterCIMessageHandler(0)
+ for slot in range(MAX_NUM_CI):
+ state = eDVBCI_UI.getInstance().getState(slot)
+ if state != -1:
+ CiHandler.unregisterCIMessageHandler(slot)
self.close()