more space for service numbers
[enigma2.git] / lib / python / Components / ServiceList.py
index 85f004c069289eefac7891480c1f906385c90347..6145adefffae00fe418f2411cf313727e7c1bf3d 100644 (file)
@@ -5,6 +5,8 @@ from enigma import *
 
 from string import upper
 
+from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
+
 class ServiceList(HTMLComponent, GUIComponent):
        MODE_NORMAL = 0
        MODE_FAVOURITES = 1
@@ -12,6 +14,27 @@ class ServiceList(HTMLComponent, GUIComponent):
        def __init__(self):
                GUIComponent.__init__(self)
                self.l = eListboxServiceContent()
+
+               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "folder.png"))
+               if pic:
+                       self.l.setPixmap(self.l.picFolder, pic)
+
+               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "marker-fs8.png"))
+               if pic:
+                       self.l.setPixmap(self.l.picMarker, pic)
+
+               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_s-fs8.png"))
+               if pic:
+                       self.l.setPixmap(self.l.picDVB_S, pic)
+
+               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_c-fs8.png"))
+               if pic:
+                       self.l.setPixmap(self.l.picDVB_C, pic)
+
+               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_t-fs8.png"))
+               if pic:
+                       self.l.setPixmap(self.l.picDVB_T, pic)
+
                self.root = None
                self.mode = self.MODE_NORMAL
 
@@ -47,6 +70,14 @@ class ServiceList(HTMLComponent, GUIComponent):
                self.instance.moveSelectionTo(index)
                print "Moving to character " + str(char)
 
+       def moveToNextMarker(self):
+               idx = self.l.getNextMarkerPos()
+               self.instance.moveSelectionTo(idx)
+
+       def moveToPrevMarker(self):
+               idx = self.l.getPrevMarkerPos()
+               self.instance.moveSelectionTo(idx)
+
        def moveToIndex(self, index):
                self.instance.moveSelectionTo(index)
 
@@ -88,8 +119,11 @@ class ServiceList(HTMLComponent, GUIComponent):
                if not justSet:
                        self.l.sort()
 
-       def addService(self, service):
-               self.l.addService(service)
+       def removeCurrent(self):
+               self.l.removeCurrent()
+
+       def addService(self, service, beforeCurrent=False):
+               self.l.addService(service, beforeCurrent)
 
        def finishFill(self):
                self.l.FillFinished()
@@ -133,8 +167,8 @@ class ServiceList(HTMLComponent, GUIComponent):
                else:
                        self.instance.setItemHeight(28)
                        self.l.setElementFont(self.l.celServiceNumber, gFont("Regular", 20))
-                       self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, 40, 28))
+                       self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 0, 50, 28))
                        self.l.setElementFont(self.l.celServiceName, gFont("Regular", 22))
-                       self.l.setElementPosition(self.l.celServiceName, eRect(50, 0, self.instance.size().width()-50, 28))
+                       self.l.setElementPosition(self.l.celServiceName, eRect(60, 0, self.instance.size().width()-60, 28))
                        self.l.setElementFont(self.l.celServiceInfo, gFont("Regular", 18))
                        self.l.setVisualMode(eListboxServiceContent.visModeComplex)