X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4c9d04cb33fb06dfa075b431e36e7ea938a5f963..4bc08995411e21f3564f09e136809be68ddf96a8:/components.py diff --git a/components.py b/components.py index 4c26c0a0..8015621f 100644 --- a/components.py +++ b/components.py @@ -60,7 +60,7 @@ class GUISkin: # way of having refcounted objects. So it must be in python.) # # It could be possible that you're calling deleteGUIscreen trough a call of - # a PSignal. For example, you could try to call session.close() in response + # a PSignal. For example, you could try to call screen.doClose() in response # to a Button::click. This will fail. (It wouldn't work anyway, as you would # remove a dialog while running it. It never worked - enigma1 just set a # per-mainloop variable on eWidget::close() to leave the exec()...) @@ -97,8 +97,10 @@ class GUIComponent: i = self.GUIcreateInstance(self, parent, skindata) priv["instance"] = i self.notifier.append(i) - if self.notifierAdded: + try: self.notifierAdded(i) + except: + pass # GUIdelete must delete *all* references to the current component! def GUIdelete(self, priv): @@ -221,3 +223,37 @@ class VolumeBar(HTMLComponent, GUIComponent, VariableValue): g = eSlider(parent) g.setRange(0, 100) return g + + +class MenuList(HTMLComponent, GUIComponent): + def __init__(self, list): + GUIComponent.__init__(self) + self.l = eListboxPythonStringContent() + self.l.setList(list) + + def getCurrent(self): + return self.l.getCurrentSelection() + + def GUIcreateInstance(self, priv, parent, skindata): + g = eListbox(parent) + g.setContent(self.l) + return g + + def GUIdeleteInstance(self, g): + g.setContent(None) + +class ServiceList(HTMLComponent, GUIComponent): + def __init__(self): + GUIComponent.__init__(self) + self.l = eListboxServiceContent() + + def GUIcreateInstance(self, priv, parent, skindata): + g = eListbox(parent) + g.setContent(self.l) + return g + + def GUIdeleteInstance(self, g): + g.setContent(None) + + def setRoot(self, root): + self.l.setRoot(root)