From 494169d25068e3d3dd2dcc8b37b42d32df6935e7 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Wed, 30 Nov 2005 14:15:56 +0000 Subject: jumping to an entry beginning with a character nearly works now --- lib/python/Components/ServiceList.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/python/Components') diff --git a/lib/python/Components/ServiceList.py b/lib/python/Components/ServiceList.py index 89b40ed2..e04594ee 100644 --- a/lib/python/Components/ServiceList.py +++ b/lib/python/Components/ServiceList.py @@ -3,6 +3,8 @@ from GUIComponent import * from enigma import * +from string import upper + class ServiceList(HTMLComponent, GUIComponent): MODE_NORMAL = 0 @@ -28,6 +30,16 @@ 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 (index > indexup): + index = indexup + self.instance.moveSelectionTo(index) + print "Moving to character " + str(char) def GUIcreate(self, parent): self.instance = eListbox(parent) -- cgit v1.2.3