service: add sort of servicelist including all required layers
[enigma2.git] / lib / python / Components / ConfigList.py
1 from HTMLComponent import *
2 from GUIComponent import *
3 from config import *
4
5 from enigma import eListbox, eListboxPythonConfigContent
6
7 class ConfigList(HTMLComponent, GUIComponent):
8         def __init__(self, list):
9                 GUIComponent.__init__(self)
10                 self.l = eListboxPythonConfigContent()
11                 self.l.setList(list)
12                 self.l.setSeperation(100)
13                 self.list = list
14         
15         def toggle(self):
16                 selection = self.getCurrent()
17                 selection[1].toggle()
18                 self.invalidateCurrent()
19
20         def handleKey(self, key):
21                 selection = self.getCurrent()
22                 selection[1].handleKey(key)
23                 self.invalidateCurrent()
24
25         def getCurrent(self):
26                 return self.l.getCurrentSelection()
27         
28         def invalidateCurrent(self):
29                 self.l.invalidateEntry(self.l.getCurrentSelectionIndex())
30
31         def GUIcreate(self, parent):
32                 self.instance = eListbox(parent)
33                 self.instance.setContent(self.l)
34         
35         def GUIdelete(self):
36                 self.instance.setContent(None)
37                 self.instance = None
38