aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-15 16:09:09 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-15 16:09:09 +0000
commit44de1893c8ce2c850863eab81af66205e02a069b (patch)
treeb4a123811b29377776e0b5455a115a7ae9b406e0 /lib/python/Components
parent7e6f5cba9756abef94d02d2f24601b1793f24f4e (diff)
downloadenigma2-44de1893c8ce2c850863eab81af66205e02a069b.tar.gz
enigma2-44de1893c8ce2c850863eab81af66205e02a069b.zip
whitespace cleanup,
simplify, fix and cleanup SelectionList
Diffstat (limited to 'lib/python/Components')
-rw-r--r--lib/python/Components/SelectionList.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/python/Components/SelectionList.py b/lib/python/Components/SelectionList.py
index 10b1d531..2bc3e0f6 100644
--- a/lib/python/Components/SelectionList.py
+++ b/lib/python/Components/SelectionList.py
@@ -1,4 +1,3 @@
-from GUIComponent import GUIComponent
from MenuList import MenuList
from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
from enigma import eListboxPythonMultiContent, eListbox, gFont, RT_HALIGN_LEFT
@@ -13,29 +12,21 @@ def SelectionEntryComponent(description, value, index, selected):
res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 0, 30, 30, selectionpng))
return res
-class SelectionList(MenuList, GUIComponent):
- def __init__(self, list = None):
- GUIComponent.__init__(self)
- self.l = eListboxPythonMultiContent()
- self.list = list or []
- self.setList(self.list)
+class SelectionList(MenuList):
+ def __init__(self, list = None, enableWrapAround = False):
+ MenuList.__init__(self, list or [], enableWrapAround, content = eListboxPythonMultiContent())
self.l.setFont(0, gFont("Regular", 20))
self.l.setItemHeight(30)
- GUI_WIDGET = eListbox
-
- def postWidgetCreate(self, instance):
- instance.setContent(self.l)
-
def addSelection(self, description, value, index, selected = True):
self.list.append(SelectionEntryComponent(description, value, index, selected))
self.setList(self.list)
-
+
def toggleSelection(self):
item = self.list[self.getSelectedIndex()][0]
self.list[self.getSelectedIndex()] = SelectionEntryComponent(item[0], item[1], item[2], not item[3])
self.setList(self.list)
-
+
def getSelectionsList(self):
list = []
for item in self.list: