X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/cf81c9acef45dc09976065bb4e7ad9b4818c5aa6..e9b37cc9582c76462771c5970a57c036c5533142:/lib/python/Screens/Screen.py diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py index a95c7655..13e31d67 100644 --- a/lib/python/Screens/Screen.py +++ b/lib/python/Screens/Screen.py @@ -11,11 +11,24 @@ class Screen(dict, HTMLSkin, GUISkin): self.session = session GUISkin.__init__(self) + self.onClose = [ ] + self.onExecBegin = [ ] + self.onShown = [ ] + + # in order to support screens *without* a help, + # we need the list in every screen. how ironic. + self.helpList = [ ] + def execBegin(self): + for x in self.onExecBegin: + x() # assert self.session == None, "a screen can only exec one per time" # self.session = session for (name, val) in self.items(): val.execBegin() + + for x in self.onShown: + x() def execEnd(self): for (name, val) in self.items(): @@ -25,6 +38,11 @@ class Screen(dict, HTMLSkin, GUISkin): # never call this directly - it will be called from the session! def doClose(self): + for x in self.onClose: + x() + + # fixup circular references + del self.helpList GUISkin.close(self) del self.session