X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/75db34c299094d2ae87941ed464e8efa79848e16..c7a430797475bebdaf1e638f13bcae7b4026ee73:/lib/dvb_ci/dvbci_ui.cpp diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index ddb42fdb..56ca25fc 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -43,14 +43,21 @@ eDVBCI_UI *eDVBCI_UI::getInstance() int eDVBCI_UI::getState(int slot) { if (slot < MAX_SLOTS) + { + if (eDVBCIInterfaces::getInstance()->getSlotState(slot) == eDVBCISlot::stateInvalid) + eDVBCIInterfaces::getInstance()->reset(slot); return slotdata[slot].state; + } return 0; } void eDVBCI_UI::setState(int slot, int newState) { if (slot < MAX_SLOTS) + { slotdata[slot].state = newState; + /*emit*/ ciStateChanged(slot); + } } std::string eDVBCI_UI::getAppName(int slot) @@ -113,6 +120,28 @@ int eDVBCI_UI::availableMMI(int slot) return false; } +int eDVBCI_UI::mmiScreenClose(int slot, int timeout) +{ + if (slot >= MAX_SLOTS) + return 0; + + slot_ui_data &data = slotdata[slot]; + + data.mmiScreenReady = 0; + + if (data.mmiScreen) + Py_DECREF(data.mmiScreen); + data.mmiScreen = PyList_New(1); + + PyObject *tuple = PyTuple_New(2); + PyTuple_SET_ITEM(tuple, 0, PyString_FromString("CLOSE")); + PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong(timeout)); + PyList_SET_ITEM(data.mmiScreen, 0, tuple); + data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; +} + int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) { if (slot >= MAX_SLOTS) @@ -140,6 +169,8 @@ int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; } @@ -213,10 +244,16 @@ int eDVBCI_UI::mmiScreenFinish(int slot) { printf("eDVBCI_UI::mmiScreenFinish\n"); slotdata[slot].mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); } return 0; } +void eDVBCI_UI::mmiSessionDestroyed(int slot) +{ + /*emit*/ ciStateChanged(slot); +} + int eDVBCI_UI::getMMIState(int slot) { return eDVBCIInterfaces::getInstance()->getMMIState(slot);