hamster-applet r603 - branches/gnome-2-24/hamster



Author: tbaugis
Date: Fri Oct 24 15:54:51 2008
New Revision: 603
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=603&view=rev

Log:
bugfix from trunk - allow just one instance of about and preferences windows

Modified:
   branches/gnome-2-24/hamster/about.py
   branches/gnome-2-24/hamster/applet.py
   branches/gnome-2-24/hamster/preferences.py

Modified: branches/gnome-2-24/hamster/about.py
==============================================================================
--- branches/gnome-2-24/hamster/about.py	(original)
+++ branches/gnome-2-24/hamster/about.py	Fri Oct 24 15:54:51 2008
@@ -60,8 +60,13 @@
         
     zupa = gtk.gdk.pixbuf_new_from_file(hamster_logo)
     about.set_logo(zupa)
+    
+    def on_destroy():
+        parent.about = None
 
     about.connect("response", lambda self, *args: self.destroy())
+    about.connect("destroy", lambda self, *args: on_destroy())
     about.set_screen(parent.get_screen())
     about.show_all()
+    parent.about = about
 

Modified: branches/gnome-2-24/hamster/applet.py
==============================================================================
--- branches/gnome-2-24/hamster/applet.py	(original)
+++ branches/gnome-2-24/hamster/applet.py	Fri Oct 24 15:54:51 2008
@@ -59,6 +59,9 @@
         self.applet = applet
         self.applet.set_applet_flags (gnomeapplet.EXPAND_MINOR);
 
+        self.preferences_editor = None
+        self.applet.about = None
+
         self.button = PanelButton()
         
         # load window of activity switcher and todays view
@@ -367,15 +370,22 @@
         custom_fact.show()
 
     def on_about (self, component, verb):
-        from hamster.about import show_about
-        show_about(self.applet)
+        if self.applet.about:
+            self.applet.about.present()
+        else:
+            from hamster.about import show_about
+            show_about(self.applet)
 
     def show_preferences(self, menu_item, verb):
         from hamster.preferences import PreferencesEditor
 
         dispatcher.dispatch('panel_visible', False)
-        activities_editor = PreferencesEditor()
-        activities_editor.show()
+        
+        if self.preferences_editor and self.preferences_editor.window:
+            self.preferences_editor.window.present()
+        else:
+            self.preferences_editor = PreferencesEditor()
+            self.preferences_editor.show()
     
     """signals"""
     def after_activity_update(self, widget, renames):

Modified: branches/gnome-2-24/hamster/preferences.py
==============================================================================
--- branches/gnome-2-24/hamster/preferences.py	(original)
+++ branches/gnome-2-24/hamster/preferences.py	Fri Oct 24 15:54:51 2008
@@ -522,3 +522,7 @@
     
     def on_keybinding_changed(self, textbox):
         self.config.set_keybinding(textbox.get_text())
+
+    def on_preferences_window_destroy(self, window):
+        self.window = None
+        



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]