add vcr scart switch to main menu
[enigma2.git] / lib / python / Components / MovieList.py
index 2e010ab6964897ad640c62739ddc5e2db1591702..0c0bba9b042b9044612b3d39d4857e999fd6286e 100644 (file)
@@ -1,6 +1,7 @@
 from HTMLComponent import *
 from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
+from ServiceReference import ServiceReference
 
 from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
 
@@ -60,9 +61,15 @@ class MovieList(HTMLComponent, GUIComponent):
                self.l = eListboxPythonMultiContent()
                self.load(root)
                self.l.setList(self.list)
-               self.l.setFont(0, gFont("Arial", 30))
-               self.l.setFont(1, gFont("Arial", 18))
-       
+               self.l.setFont(0, gFont("Regular", 30))
+               self.l.setFont(1, gFont("Regular", 18))
+
+       def moveToIndex(self, index):
+               self.instance.moveSelectionTo(index)
+
+       def getCurrentIndex(self):
+               return self.instance.getCurrentIndex()
+
        def getCurrent(self):
                return self.l.getCurrentSelection()
        
@@ -99,7 +106,19 @@ class MovieList(HTMLComponent, GUIComponent):
                # now process them...
                for ref in movieList:
                        self.list.append(MovieListEntry(ref, serviceHandler))
+                       
+       def moveTo(self, serviceref):
+               found = 0
+               count = 0
+               for x in self.list:
+                       if str(ServiceReference(x[0])) == str(ServiceReference(serviceref)):
+                               found = count
+                       count += 1
+               self.instance.moveSelectionTo(found)
 
        def reload(self):
                self.load(self.root)
                self.l.setList(self.list)
+
+       def moveDown(self):
+               self.instance.moveSelection(self.instance.moveDown)