aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-08-22 10:56:45 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-08-22 10:56:45 +0000
commitec5be08b08e4163539937341316230241f6d2eda (patch)
tree6e94e17941c8465a17fd0451f3c8539023fab4e8 /lib/python
parent15f37e32dc291af25d072c1f7321302cdd2bb0bb (diff)
downloadenigma2-ec5be08b08e4163539937341316230241f6d2eda.tar.gz
enigma2-ec5be08b08e4163539937341316230241f6d2eda.zip
fix bluescreen appearing when ChoiceBox is empty
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/ChoiceBox.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
index 9711da2d..6f23fdcd 100644
--- a/lib/python/Screens/ChoiceBox.py
+++ b/lib/python/Screens/ChoiceBox.py
@@ -59,16 +59,18 @@ class ChoiceBox(Screen):
pass
def up(self):
- while 1:
- self["list"].instance.moveSelection(self["list"].instance.moveUp)
- if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0:
- break
+ if len(self["list"].list) > 0:
+ while 1:
+ self["list"].instance.moveSelection(self["list"].instance.moveUp)
+ 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] != "--" or self["list"].l.getCurrentSelectionIndex() == len(self["list"].list) - 1:
- break
+ if len(self["list"].list) > 0:
+ while 1:
+ self["list"].instance.moveSelection(self["list"].instance.moveDown)
+ if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == len(self["list"].list) - 1:
+ break
def keyNumberGlobal(self, number):
@@ -77,8 +79,10 @@ class ChoiceBox(Screen):
self.close(self.keymap[str(number)])
def go(self):
- self.close(self["list"].l.getCurrentSelection()[0])
- #self.close(self["input"].getText())
+ if len(self["list"].list) > 0:
+ self.close(self["list"].l.getCurrentSelection()[0])
+ else:
+ self.close(None)
def keyRed(self):
if self.keymap.has_key("red"):