X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/687353c5fefbeea8486cbb28dedf52a53dc65e9b..b17019f43527d615589ce2083fb3d2a9058f2c3c:/lib/python/Screens/Screen.py diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py index 5f1cf6d6..989f90a9 100644 --- a/lib/python/Screens/Screen.py +++ b/lib/python/Screens/Screen.py @@ -1,10 +1,12 @@ from Components.HTMLSkin import * from Components.GUISkin import * +from Components.Sources.Source import Source import sys class Screen(dict, HTMLSkin, GUISkin): - """ bla """ + + ALLOW_SUSPEND = False def __init__(self, session): self.skinName = self.__class__.__name__ @@ -12,6 +14,7 @@ class Screen(dict, HTMLSkin, GUISkin): GUISkin.__init__(self) self.onClose = [ ] + self.onFirstExecBegin = [ ] self.onExecBegin = [ ] self.onShown = [ ] @@ -21,13 +24,18 @@ class Screen(dict, HTMLSkin, GUISkin): self.execing = False self.shown = False + self.renderer = [ ] + # in order to support screens *without* a help, # we need the list in every screen. how ironic. self.helpList = [ ] def execBegin(self): self.active_components = [ ] - for x in self.onExecBegin: + + single = self.onFirstExecBegin + self.onFirstExecBegin = [] + for x in self.onExecBegin + single: x() if self.session.current_dialog != self: return @@ -99,7 +107,7 @@ class Screen(dict, HTMLSkin, GUISkin): for x in self.onShow: x() for val in self.values() + self.renderer: - if isinstance(val, GUIComponent): + if isinstance(val, GUIComponent) or isinstance(val, Source): val.onShow() def hide(self): @@ -110,5 +118,8 @@ class Screen(dict, HTMLSkin, GUISkin): for x in self.onHide: x() for val in self.values() + self.renderer: - if isinstance(val, GUIComponent): + if isinstance(val, GUIComponent) or isinstance(val, Source): val.onHide() + + def __repr__(self): + return str(type(self))