From d06c9d21f74e5ccf4492d34285db7b6adfc2e94c Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Sun, 11 Jun 2006 22:16:21 +0000 Subject: [PATCH] prevent endless loop --- lib/python/Screens/ChoiceBox.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py index 522ee3c5..9711da2d 100644 --- a/lib/python/Screens/ChoiceBox.py +++ b/lib/python/Screens/ChoiceBox.py @@ -61,14 +61,16 @@ class ChoiceBox(Screen): def up(self): while 1: self["list"].instance.moveSelection(self["list"].instance.moveUp) - if self["list"].l.getCurrentSelection()[0][0] != "--": + if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0: break def down(self): while 1: self["list"].instance.moveSelection(self["list"].instance.moveDown) - if self["list"].l.getCurrentSelection()[0][0] != "--": - break + if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == len(self["list"].list) - 1: + break + + def keyNumberGlobal(self, number): print "pressed", number if self.keymap.has_key(str(number)): -- 2.30.2