adding timers works now
[enigma2.git] / lib / gui / elistboxcontent.cpp
index f804ee0e399b1a695ed9d84503396d69ad15f60d..356187862df98fa2ca79d6e99265befb6b106a2d 100644 (file)
@@ -365,6 +365,10 @@ void eListboxPythonStringContent::setList(PyObject *list)
                m_list = list;
                Py_INCREF(m_list);
        }
                m_list = list;
                Py_INCREF(m_list);
        }
+
+       //always invalidate when we get a new list
+       if (m_listbox)
+               m_listbox->invalidate();
 }
 
 PyObject *eListboxPythonStringContent::getCurrentSelection()
 }
 
 PyObject *eListboxPythonStringContent::getCurrentSelection()
@@ -384,6 +388,12 @@ void eListboxPythonStringContent::invalidateEntry(int index)
                m_listbox->entryChanged(index);
 }
 
                m_listbox->entryChanged(index);
 }
 
+void eListboxPythonStringContent::invalidate()
+{
+       if (m_listbox)
+               m_listbox->invalidate();
+}
+
 //////////////////////////////////////
 
 void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
 //////////////////////////////////////
 
 void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
@@ -428,13 +438,16 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                
                                        /* CallObject will call __call__ which should return the value tuple */
                                value = PyObject_CallObject(value, args);
                                
                                        /* CallObject will call __call__ which should return the value tuple */
                                value = PyObject_CallObject(value, args);
+                               
+                               if (PyErr_Occurred())
+                                       PyErr_Print();
 
                                Py_DECREF(args);
                                        /* the PyInt was stolen. */
                        }
                        
                                /*  check if this is really a tuple */
 
                                Py_DECREF(args);
                                        /* the PyInt was stolen. */
                        }
                        
                                /*  check if this is really a tuple */
-                       if (PyTuple_Check(value))
+                       if (value && PyTuple_Check(value))
                        {
                                        /* convert type to string */
                                PyObject *type = PyTuple_GetItem(value, 0);
                        {
                                        /* convert type to string */
                                PyObject *type = PyTuple_GetItem(value, 0);
@@ -513,7 +526,8 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                                        }
                                }
                                Py_XDECREF(type);
                                        }
                                }
                                Py_XDECREF(type);
-                       }
+                       } else
+                               eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple.");
                                /* value is borrowed */
                }
 
                                /* value is borrowed */
                }