1 from HTMLComponent import *
2 from GUIComponent import *
5 from enigma import eListbox, eListboxPythonConfigContent
7 class ConfigList(HTMLComponent, GUIComponent, object):
8 def __init__(self, list):
9 GUIComponent.__init__(self)
10 self.l = eListboxPythonConfigContent()
11 self.l.setSeperation(100)
13 self.onSelectionChanged = [ ]
16 selection = self.getCurrent()
18 self.invalidateCurrent()
20 def handleKey(self, key):
21 selection = self.getCurrent()
22 if selection[1].parent.enabled:
23 selection[1].handleKey(key)
24 self.invalidateCurrent()
27 return self.l.getCurrentSelection()
29 def invalidateCurrent(self):
30 self.l.invalidateEntry(self.l.getCurrentSelectionIndex())
32 def invalidate(self, entry):
35 if (entry.getConfigPath() == x[1].parent.getConfigPath()):
36 self.l.invalidateEntry(i)
41 def selectionChanged(self):
42 for x in self.onSelectionChanged:
45 def postWidgetCreate(self, instance):
46 instance.setContent(self.l)
47 instance.selectionChanged.get().append(self.selectionChanged)
49 def setList(self, list):
51 self.l.setList(self.__list)
56 list = property(getList, setList)