Fix network test.
[vuplus_dvbapp] / lib / python / Components / ConfigList.py
index 418a1b6..fd638d7 100755 (executable)
@@ -4,12 +4,14 @@ from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KE
 from Components.ActionMap import NumberActionMap, ActionMap
 from enigma import eListbox, eListboxPythonConfigContent, eRCInput, eTimer
 from Screens.MessageBox import MessageBox
 from Components.ActionMap import NumberActionMap, ActionMap
 from enigma import eListbox, eListboxPythonConfigContent, eRCInput, eTimer
 from Screens.MessageBox import MessageBox
+import skin
 
 class ConfigList(HTMLComponent, GUIComponent, object):
        def __init__(self, list, session = None):
                GUIComponent.__init__(self)
                self.l = eListboxPythonConfigContent()
 
 class ConfigList(HTMLComponent, GUIComponent, object):
        def __init__(self, list, session = None):
                GUIComponent.__init__(self)
                self.l = eListboxPythonConfigContent()
-               self.l.setSeperation(200)
+               seperation, = skin.parameters.get("ConfigListSeperator", (200, ))
+               self.l.setSeperation(seperation)
                self.timer = eTimer()
                self.list = list
                self.onSelectionChanged = [ ]
                self.timer = eTimer()
                self.list = list
                self.onSelectionChanged = [ ]
@@ -61,12 +63,13 @@ class ConfigList(HTMLComponent, GUIComponent, object):
        GUI_WIDGET = eListbox
        
        def selectionChanged(self):
        GUI_WIDGET = eListbox
        
        def selectionChanged(self):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                self.current = self.getCurrent()
                        self.current[1].onDeselect(self.session)
                self.current = self.getCurrent()
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onSelect(self.session)
                        self.current[1].onSelect(self.session)
-
+               else:
+                       return
                for x in self.onSelectionChanged:
                        x()
 
                for x in self.onSelectionChanged:
                        x()
 
@@ -75,11 +78,11 @@ class ConfigList(HTMLComponent, GUIComponent, object):
                instance.setContent(self.l)
        
        def preWidgetRemove(self, instance):
                instance.setContent(self.l)
        
        def preWidgetRemove(self, instance):
-               if self.current:
+               if isinstance(self.current,tuple) and len(self.current) == 2:
                        self.current[1].onDeselect(self.session)
                instance.selectionChanged.get().remove(self.selectionChanged)
                instance.setContent(None)
                        self.current[1].onDeselect(self.session)
                instance.selectionChanged.get().remove(self.selectionChanged)
                instance.setContent(None)
-       
+
        def setList(self, l):
                self.timer.stop()
                self.__list = l
        def setList(self, l):
                self.timer.stop()
                self.__list = l
@@ -87,7 +90,7 @@ class ConfigList(HTMLComponent, GUIComponent, object):
 
                if l is not None:
                        for x in l:
 
                if l is not None:
                        for x in l:
-                               assert isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
+                               assert len(x) < 2 or isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement"
 
        def getList(self):
                return self.__list
 
        def getList(self):
                return self.__list