add new converter (useable to get movie creation time and duration)
[enigma2.git] / lib / gui / elistboxcontent.cpp
index fbbbb6ff2b7070480cdbace34895d5a0d0b38b9c..b397ddcae40e66fba82ea58cfe4d380ad0417f1f 100644 (file)
@@ -392,7 +392,7 @@ eListboxPythonMultiContent::eListboxPythonMultiContent()
 eListboxPythonMultiContent::~eListboxPythonMultiContent()
 {
        Py_XDECREF(m_buildFunc);
-       Py_XDECREF(m_callableFunc);
+       Py_XDECREF(m_selectableFunc);
 }
 
 void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
@@ -726,11 +726,11 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                                        pwidth = PyTuple_GET_ITEM(item, 3),
                                                        pheight = PyTuple_GET_ITEM(item, 4),
                                                        ppixmap = PyTuple_GET_ITEM(item, 5),
-                                                       pforeColor, pbackColor, pbackColorSelected;
+                                                       pbackColor, pbackColorSelected;
 
                                if (!(px && py && pwidth && pheight && ppixmap))
                                {
-                                       eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PIXMAP, x, y, width, height, pixmap [, foreColor, backColor, backColorSelected] ))");
+                                       eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PIXMAP, x, y, width, height, pixmap [, backColor, backColorSelected] ))");
                                        goto error_out;
                                }
 
@@ -747,29 +747,23 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                if (size > 6)
                                {
-                                       pforeColor = PyTuple_GET_ITEM(item, 6);
-                                       if (pforeColor == Py_None)
-                                               pforeColor=ePyObject();
-                               }
-                               if (size > 7)
-                               {
-                                       pbackColor = PyTuple_GET_ITEM(item, 7);
+                                       pbackColor = PyTuple_GET_ITEM(item, 6);
                                        if (pbackColor == Py_None)
                                                pbackColor=ePyObject();
                                }
-                               if (size > 8)
+                               if (size > 7)
                                {
-                                       pbackColorSelected = PyTuple_GET_ITEM(item, 8);
+                                       pbackColorSelected = PyTuple_GET_ITEM(item, 7);
                                        if (pbackColorSelected == Py_None)
                                                pbackColorSelected=ePyObject();
                                }
 
                                eRect rect(x, y, width, height);
                                painter.clip(rect);
-                               if (pbackColor || pbackColorSelected || pforeColor)
+                               if (pbackColor || pbackColorSelected)
                                {
                                        gRegion rc(rect);
-                                       clearRegion(painter, style, pforeColor, pbackColor, pbackColorSelected, selected, rc, sel_clip);
+                                       clearRegion(painter, style, ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip);
                                        reset_colors=true;
                                }
                                
@@ -803,11 +797,11 @@ void eListboxPythonMultiContent::setBuildFunc(ePyObject cb)
        Py_XINCREF(m_buildFunc);
 }
 
-void eListboxPythonMultiContent::setCallableFunc(ePyObject cb)
+void eListboxPythonMultiContent::setSelectableFunc(ePyObject cb)
 {
-       Py_XDECREF(m_callableFunc);
-       m_callableFunc=cb;
-       Py_XINCREF(m_callableFunc);
+       Py_XDECREF(m_selectableFunc);
+       m_selectableFunc=cb;
+       Py_XINCREF(m_selectableFunc);
 }
 
 int eListboxPythonMultiContent::currentCursorSelectable()
@@ -815,15 +809,15 @@ int eListboxPythonMultiContent::currentCursorSelectable()
        /* each list-entry is a list of tuples. if the first of these is none, it's not selectable */
        if (m_list && cursorValid())
        {
-               if (m_callableFunc && PyCallable_Check(m_callableFunc))
+               if (m_selectableFunc && PyCallable_Check(m_selectableFunc))
                {
                        ePyObject args = PyList_GET_ITEM(m_list, m_cursor); // borrowed reference!
                        if (PyTuple_Check(args))
                        {
-                               ePyObject ret = PyObject_CallObject(m_callableFunc, args);
+                               ePyObject ret = PyObject_CallObject(m_selectableFunc, args);
                                if (ret)
                                        return ret == Py_True;
-                               eDebug("call m_callableFunc failed!!! assume not callable");
+                               eDebug("call m_selectableFunc failed!!! assume not callable");
                        }
                        else
                                eDebug("m_list[m_cursor] is not a tuple!!! assume not callable");