[Inteproxy-commits] r75 - in trunk: . inteproxy

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 2 15:06:01 CEST 2007


Author: bh
Date: 2007-05-02 15:06:01 +0200 (Wed, 02 May 2007)
New Revision: 75

Modified:
   trunk/ChangeLog
   trunk/inteproxy/gtkapp.py
Log:
* inteproxy/gtkapp.py (InteProxyApplication.__init__): If no
status icon is shown hide the File/Close menu item because it
would hide the window, leaving the user without a way to quit
InteProxy.
(StatusIcon.is_embedded): New.  Delegates to
gtk.StatusIcon.is_embedded


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-02 11:11:20 UTC (rev 74)
+++ trunk/ChangeLog	2007-05-02 13:06:01 UTC (rev 75)
@@ -1,5 +1,14 @@
 2007-05-02  Bernhard Herzog  <bh at intevation.de>
 
+	* inteproxy/gtkapp.py (InteProxyApplication.__init__): If no
+	status icon is shown hide the File/Close menu item because it
+	would hide the window, leaving the user without a way to quit
+	InteProxy.
+	(StatusIcon.is_embedded): New.  Delegates to
+	gtk.StatusIcon.is_embedded
+
+2007-05-02  Bernhard Herzog  <bh at intevation.de>
+
 	* inteproxy/app.py: Remove unused imports
 
 2007-05-02  Bernhard Herzog  <bh at intevation.de>

Modified: trunk/inteproxy/gtkapp.py
===================================================================
--- trunk/inteproxy/gtkapp.py	2007-05-02 11:11:20 UTC (rev 74)
+++ trunk/inteproxy/gtkapp.py	2007-05-02 13:06:01 UTC (rev 75)
@@ -177,6 +177,9 @@
         self.status_icon.connect("activate", self.show_window)
         self.status_icon.connect("popup-menu", self.popup_menu)
 
+    def is_embedded(self):
+        return self.status_icon.is_embedded()
+
     def popup_menu(self, status_icon, button, activate_time):
         """Pops up the StatusIconMenu.
 
@@ -294,7 +297,12 @@
             self.status_icon = None
         self.main_window = InteProxyMainWindow(self)
 
-        if not self.status_icon:
+        if not self.status_icon or not self.status_icon.is_embedded():
+            # No status icon is shown, so:
+            #  - hide the File/Close menu item because it would hide the
+            #    window, leaving the user without a way to quit InteProxy.
+            #  - Show the main window immediately.
+            self.ui.get_action("/Menubar/FileMenu/Close").set_visible(False)
             self.main_window.show()
 
     def create_ui(self):



More information about the Inteproxy-commits mailing list