allow 'stand-alone' screens: they will receive execBegin/execEnd calls even when...
authorFelix Domke <tmbinc@elitedvb.net>
Tue, 9 Jan 2007 01:10:56 +0000 (01:10 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Tue, 9 Jan 2007 01:10:56 +0000 (01:10 +0000)
lib/python/Screens/Screen.py

index 5349291..797acbc 100644 (file)
@@ -31,6 +31,10 @@ class Screen(dict, HTMLSkin, GUISkin):
                self.helpList = [ ]
                
                self.close_on_next_exec = None
                self.helpList = [ ]
                
                self.close_on_next_exec = None
+               
+               # stand alone screens (for example web screens)
+               # don't care about having or not having focus.
+               self.stand_alone = False
 
        def execBegin(self):
                self.active_components = [ ]
 
        def execBegin(self):
                self.active_components = [ ]
@@ -44,7 +48,7 @@ class Screen(dict, HTMLSkin, GUISkin):
                        self.onFirstExecBegin = []
                        for x in self.onExecBegin + single:
                                x()
                        self.onFirstExecBegin = []
                        for x in self.onExecBegin + single:
                                x()
-                               if self.session.current_dialog != self:
+                               if not self.stand_alone and self.session.current_dialog != self:
                                        return
 
 #                      assert self.session == None, "a screen can only exec once per time"
                                        return
 
 #                      assert self.session == None, "a screen can only exec once per time"
@@ -52,7 +56,7 @@ class Screen(dict, HTMLSkin, GUISkin):
 
                        for val in self.values() + self.renderer:
                                val.execBegin()
 
                        for val in self.values() + self.renderer:
                                val.execBegin()
-                               if self.session.current_dialog != self:
+                               if not self.stand_alone and self.session.current_dialog != self:
                                        return
                                self.active_components.append(val)
 
                                        return
                                self.active_components.append(val)