aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Sources/List.py
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-01-24 21:47:38 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2008-01-24 21:47:38 +0000
commitd3f23bc82dcf800c265938a6bc7d07f5c61e924a (patch)
tree8997725a46fe157100289b5f9cea5b0de2358c80 /lib/python/Components/Sources/List.py
parentdcc4a84bbe28965292b92a0242d9c68e6e0dbba8 (diff)
downloadenigma2-d3f23bc82dcf800c265938a6bc7d07f5c61e924a.tar.gz
enigma2-d3f23bc82dcf800c265938a6bc7d07f5c61e924a.zip
- add selectNext/selectPrevious to sources.List
- fix wizard up/down for configList
Diffstat (limited to 'lib/python/Components/Sources/List.py')
-rw-r--r--lib/python/Components/Sources/List.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/python/Components/Sources/List.py b/lib/python/Components/Sources/List.py
index 71be0807..0480dd65 100644
--- a/lib/python/Components/Sources/List.py
+++ b/lib/python/Components/Sources/List.py
@@ -16,6 +16,7 @@ to generate HTML."""
self.item_height = item_height
self.fonts = fonts
self.disable_callbacks = False
+ self.enableWrapAround = enableWrapAround
def setList(self, list):
self.__list = list
@@ -57,6 +58,20 @@ to generate HTML."""
setCurrentIndex = setIndex
index = property(getIndex, setIndex)
+
+ def selectNext(self):
+ if self.getIndex() + 1 >= self.count():
+ if self.enableWrapAround:
+ self.index = 0
+ else:
+ self.index += 1
+
+ def selectPrevious(self):
+ if self.getIndex() - 1 < 0:
+ if self.enableWrapAround:
+ self.index = self.count() - 1
+ else:
+ self.index -= 1
def updateList(self, list):
"""Changes the list without changing the selection or emitting changed Events"""