X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fgui%2Felistboxcontent.cpp;h=1dc4f48ce434b760dd6f302c9e46063455190d2b;hp=7bb84c3d0a1cf828c7d6569bfd29dfb98e0e9d03;hb=322f606a88150a635adf7b42da6a96667aed0058;hpb=d37c356fa54be2fd93a92566c686a468a741cd0f diff --git a/lib/gui/elistboxcontent.cpp b/lib/gui/elistboxcontent.cpp index 7bb84c3..1dc4f48 100644 --- a/lib/gui/elistboxcontent.cpp +++ b/lib/gui/elistboxcontent.cpp @@ -343,7 +343,6 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, if (PyTuple_Check(item)) { /* handle left part. get item from tuple, convert to string, display. */ - text = PyTuple_GET_ITEM(item, 0); text = PyObject_Str(text); /* creates a new object - old object was borrowed! */ const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : ""; @@ -357,7 +356,9 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, int value_alignment_left = !*string; /* now, handle the value. get 2nd part from tuple*/ - value = PyTuple_GET_ITEM(item, 1); + if (PyTuple_Size(item) >= 2) // when no 2nd entry is in tuple this is a non selectable entry without config part + value = PyTuple_GET_ITEM(item, 1); + if (value) { ePyObject args = PyTuple_New(1); @@ -468,7 +469,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, } } /* type is borrowed */ - } else + } else if (value) eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple."); if (value) Py_DECREF(value); @@ -639,7 +640,8 @@ static ePyObject lookupColor(ePyObject color, ePyObject data) if ((icolor & 0xFF000000) == 0xFF000000) { int index = icolor & 0xFFFFFF; - eDebug("[eListboxPythonMultiContent] template color index: %d", index); + if (PyTuple_GetItem(data, index) == Py_None) + return ePyObject(); return PyTuple_GetItem(data, index); } @@ -966,6 +968,9 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c if (ppixmap) { ePtr pixmap; + if (PyInt_Check(ppixmap) && data) /* if the pixmap is in fact a number, it refers to the data list */ + ppixmap = PyTuple_GetItem(data, PyInt_AsLong(ppixmap)); + if (SwigFromPython(pixmap, ppixmap)) { eDebug("eListboxPythonMultiContent (Pixmap) get pixmap failed");