add onFirstExecBegin for actions, performed only once when a Screen is executed for...
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 9 Oct 2006 23:04:49 +0000 (23:04 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 9 Oct 2006 23:04:49 +0000 (23:04 +0000)
time

lib/python/Screens/Screen.py

index 78a88ad..989f90a 100644 (file)
@@ -14,6 +14,7 @@ class Screen(dict, HTMLSkin, GUISkin):
                GUISkin.__init__(self)
                
                self.onClose = [ ]
+               self.onFirstExecBegin = [ ]
                self.onExecBegin = [ ]
                self.onShown = [ ]
                
@@ -31,7 +32,10 @@ class Screen(dict, HTMLSkin, GUISkin):
                
        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