dont show the infobar when close the last open screen
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 22 Mar 2007 02:03:51 +0000 (02:03 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 22 Mar 2007 02:03:51 +0000 (02:03 +0000)
lib/python/Screens/InfoBarGenerics.py
mytest.py

index c7fce34..2ccd52d 100644 (file)
@@ -71,8 +71,6 @@ class InfoBarShowHide:
                self.__state = self.STATE_SHOWN
                self.__locked = 0
                
                self.__state = self.STATE_SHOWN
                self.__locked = 0
                
-               self.onExecBegin.append(self.show)
-               
                self.hideTimer = eTimer()
                self.hideTimer.timeout.get().append(self.doTimerHide)
                self.hideTimer.start(5000, True)
                self.hideTimer = eTimer()
                self.hideTimer.timeout.get().append(self.doTimerHide)
                self.hideTimer.start(5000, True)
index e674a29..098675b 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -155,11 +155,11 @@ class Session:
                if callback is not None:
                        callback(*retval)
 
                if callback is not None:
                        callback(*retval)
 
-       def execBegin(self, first=True):
+       def execBegin(self, first=True, do_show = True):
                assert not self.in_exec 
                self.in_exec = True
                c = self.current_dialog
                assert not self.in_exec 
                self.in_exec = True
                c = self.current_dialog
-               
+
                # when this is an execbegin after a execend of a "higher" dialog,
                # popSummary already did the right thing.
                if first:
                # when this is an execbegin after a execend of a "higher" dialog,
                # popSummary already did the right thing.
                if first:
@@ -172,7 +172,7 @@ class Session:
                c.execBegin()
 
                # when execBegin opened a new dialog, don't bother showing the old one.
                c.execBegin()
 
                # when execBegin opened a new dialog, don't bother showing the old one.
-               if c == self.current_dialog:
+               if c == self.current_dialog and do_show:
                        c.show()
                
        def execEnd(self, last=True):
                        c.show()
                
        def execEnd(self, last=True):
@@ -246,13 +246,13 @@ class Session:
         
        def pushCurrent(self):
                if self.current_dialog is not None:
         
        def pushCurrent(self):
                if self.current_dialog is not None:
-                       self.dialog_stack.append(self.current_dialog)
+                       self.dialog_stack.append((self.current_dialog, self.current_dialog.shown))
                        self.execEnd(last=False)
                        self.execEnd(last=False)
-       
+
        def popCurrent(self):
                if len(self.dialog_stack):
        def popCurrent(self):
                if len(self.dialog_stack):
-                       self.current_dialog = self.dialog_stack.pop()
-                       self.execBegin(first=False)
+                       (self.current_dialog, do_show) = self.dialog_stack.pop()
+                       self.execBegin(first=False, do_show=do_show)
                else:
                        self.current_dialog = None
 
                else:
                        self.current_dialog = None