reenable fresh harddisk-init
[enigma2.git] / lib / python / Components / ServiceList.py
index 89b40ed2260eaa48bcaaaad8f35992a819f1fb18..84e9e82e3b33996cf874bc520bb58dd96decc83a 100644 (file)
@@ -3,6 +3,8 @@ from GUIComponent import *
 
 from enigma import *
 
+from string import upper
+
 class ServiceList(HTMLComponent, GUIComponent):
 
        MODE_NORMAL = 0
@@ -28,6 +30,18 @@ class ServiceList(HTMLComponent, GUIComponent):
 
        def moveDown(self):
                self.instance.moveSelection(self.instance.moveDown)
+               
+       def moveToChar(self, char):
+               # TODO fill with life
+               print "Next char: "
+               index = self.l.getNextBeginningWithChar(char)
+               indexup = self.l.getNextBeginningWithChar(upper(char))
+               if indexup != 0:
+                       if (index > indexup or index == 0):
+                               index = indexup
+
+               self.instance.moveSelectionTo(index)
+               print "Moving to character " + str(char)
 
        def GUIcreate(self, parent):
                self.instance = eListbox(parent)