add InfoBarTimeshiftState, fix timeshift after zap, fix seekactions
[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                 if selection[1].parent.enabled:
23                         selection[1].handleKey(key)
24                         self.invalidateCurrent()
25
26         def getCurrent(self):
27                 return self.l.getCurrentSelection()
28         
29         def invalidateCurrent(self):
30                 self.l.invalidateEntry(self.l.getCurrentSelectionIndex())
31                 
32         def invalidate(self, entry):
33                 i = 0
34                 for x in self.list:
35                         if (entry.getConfigPath() == x[1].parent.getConfigPath()):
36                                 self.l.invalidateEntry(i)
37                         i += 1
38                 
39         def GUIcreate(self, parent):
40                 self.instance = eListbox(parent)
41                 self.instance.setContent(self.l)
42         
43         def GUIdelete(self):
44                 self.instance.setContent(None)
45                 self.instance = None
46