add more configPaths
[enigma2.git] / lib / python / Components / ServiceList.py
index b1bd217069f6c131a26736876104177248267269..73727403d5dba723cc90ac6f7e5878c0496ef462 100644 (file)
@@ -4,6 +4,10 @@ from GUIComponent import *
 from enigma import *
 
 class ServiceList(HTMLComponent, GUIComponent):
+
+       MODE_NORMAL = 0
+       MODE_FAVOURITES = 1
+       
        def __init__(self):
                GUIComponent.__init__(self)
                self.l = eListboxServiceContent()
@@ -19,7 +23,7 @@ class ServiceList(HTMLComponent, GUIComponent):
        def moveDown(self):
                self.instance.moveSelection(self.instance.moveDown)
 
-       def GUIcreate(self, parent, skindata):
+       def GUIcreate(self, parent):
                self.instance = eListbox(parent)
                self.instance.setContent(self.l)
        
@@ -32,6 +36,9 @@ class ServiceList(HTMLComponent, GUIComponent):
                # mark stuff
        def clearMarked(self):
                self.l.clearMarked()
+               
+       def clearMarks(self):
+               self.l.initMarked()
        
        def isMarked(self, ref):
                return self.l.isMarked(ref)
@@ -42,3 +49,26 @@ class ServiceList(HTMLComponent, GUIComponent):
        def removeMarked(self, ref):
                self.l.removeMarked(ref)
 
+       def getMarked(self):
+               i = self.l
+               i.markedQueryStart()
+               ref = eServiceReference()
+               marked = [ ]
+               while i.markedQueryNext(ref) == 0:
+                       marked.append(ref)
+                       ref = eServiceReference()
+
+               return marked
+
+       def setMode(self, mode):
+               if mode == self.MODE_NORMAL:
+                       self.instance.setItemHeight(20)
+                       self.l.setVisualMode(eListboxServiceContent.visModeSimple)
+               else:
+                       self.instance.setItemHeight(40)
+                       self.l.setElementFont(self.l.celServiceName, gFont("Arial", 30))
+                       self.l.setElementPosition(self.l.celServiceName, eRect(40, 0, self.instance.size().width(), 40))
+                       self.l.setElementFont(self.l.celServiceNumber, gFont("Arial", 20))
+                       self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 10, 40, 30))
+
+                       self.l.setVisualMode(eListboxServiceContent.visModeComplex)