getConfigListEntry now supports more than two arguments
[enigma2.git] / lib / python / Components / MovieList.py
index a47741c431787c3d8a22b537e6ac72104545f3bd..1a61d20ff224039c0daeb3916f19d7c54ff94211 100644 (file)
@@ -59,18 +59,20 @@ class MovieList(HTMLComponent, GUIComponent):
        def getCurrentIndex(self):
                return self.instance.getCurrentIndex()
 
+       def getCurrentEvent(self):
+               l = self.l.getCurrentSelection()
+               return l and l[0] and l[1] and l[1].getEvent(l[0])
+
        def getCurrent(self):
-               return self.l.getCurrentSelection()[0]
+               l = self.l.getCurrentSelection()
+               return l and l[0]
 
-       def GUIcreate(self, parent):
-               self.instance = eListbox(parent)
-               self.instance.setContent(self.l)
-               self.instance.setItemHeight(75)
+       GUI_WIDGET = eListbox
+       
+       def postWidgetCreate(self, instance):
+               instance.setContent(self.l)
+               instance.setItemHeight(75)
        
-       def GUIdelete(self):
-               self.instance.setContent(None)
-               self.instance = None
-
        def reload(self, root = None):
                if root is not None:
                        self.load(root)
@@ -88,9 +90,10 @@ class MovieList(HTMLComponent, GUIComponent):
                return len(self.list)
 
        def updateLengthOfIndex(self, index):
-               x = self.list[index]
-               self.list[index] = (x[0], x[1], x[2], x[1].getLength(x[0]))
-               self.l.invalidateEntry(index)
+               if len(self.list) > index:
+                       x = self.list[index]
+                       self.list[index] = (x[0], x[1], x[2], x[1].getLength(x[0]))
+                       self.l.invalidateEntry(index)
 
        def load(self, root):
                # this lists our root service, then building a