aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-30 14:15:56 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-30 14:15:56 +0000
commit494169d25068e3d3dd2dcc8b37b42d32df6935e7 (patch)
tree7252c705e1887ded09184f318335650886e93c64 /lib/python
parentb81011256e7383001bd35d09a25325e98d3bfa81 (diff)
downloadenigma2-494169d25068e3d3dd2dcc8b37b42d32df6935e7.tar.gz
enigma2-494169d25068e3d3dd2dcc8b37b42d32df6935e7.zip
jumping to an entry beginning with a character nearly works now
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/ServiceList.py12
-rw-r--r--lib/python/Screens/ChannelSelection.py5
2 files changed, 15 insertions, 2 deletions
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)
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index 565655f9..3cca57fa 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -276,9 +276,10 @@ class ChannelSelectionBase(Screen):
self.setRoot(self.bouquet_root)
def keyNumberGlobal(self, number):
+ char = self.numericalTextInput.getKey(number)
print "You pressed number " + str(number)
- print "You would go to character " + str(self.numericalTextInput.getKey(number))
- # TODO let the servicelist jump to the next entry strating with the chosen character
+ print "You would go to character " + str(char)
+ self.servicelist.moveToChar(char)
def enterBouquet(self, action):
if action[:7] == "bouquet":