hamster-applet r599 - in trunk: data hamster



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

Log:
making sure that one can open only one preferences and one 
about dialog at a time. fixes bug 55760

Modified:
   trunk/data/preferences.glade
   trunk/hamster/about.py
   trunk/hamster/applet.py
   trunk/hamster/preferences.py

Modified: trunk/data/preferences.glade
==============================================================================
--- trunk/data/preferences.glade	(original)
+++ trunk/data/preferences.glade	Fri Oct 24 15:13:23 2008
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Wed Oct 22 17:13:15 2008 -->
+<!--Generated with glade3 3.4.5 on Fri Oct 24 15:40:58 2008 -->
 <glade-interface>
   <widget class="GtkWindow" id="preferences_window">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -12,7 +12,7 @@
     <property name="destroy_with_parent">True</property>
     <property name="icon_name">hamster-applet</property>
     <signal name="key_press_event" handler="on_preferences_window_key_press"/>
-    <signal name="destroy" handler="destroy_cb"/>
+    <signal name="destroy" handler="on_preferences_window_destroy"/>
     <child>
       <widget class="GtkVBox" id="vbox1">
         <property name="visible">True</property>

Modified: trunk/hamster/about.py
==============================================================================
--- trunk/hamster/about.py	(original)
+++ trunk/hamster/about.py	Fri Oct 24 15:13:23 2008
@@ -39,18 +39,18 @@
     infos = {
         "name" : _("Time Tracker"),
         "version" : VERSION,
-        "comments" : _("Time tracking for masses."),
-        "copyright" : _("Copyright  2007-2008 Toms Baugis and others"),
-	"website" : "http://live.gnome.org/ProjectHamster";,
+        "comments" : _("Project Hamster - track your time"),
+        "copyright" : _(u"Copyright  2007-2008 Toms Baugis and others"),
+        "website" : "http://live.gnome.org/ProjectHamster";,
         "website-label" : _("Hamster Website"),
     }
-
+    
     about.set_authors(["Toms Baugis <toms baugis gmail com>",
                        "Patryk Zawadzki <patrys pld-linux org>",
                        "Peteris Caune <cuu508 gmail com>",
-		       "Juanje Ojeda <jojeda emergya es>"])
+                       "Juanje Ojeda <jojeda emergya es>"])
     about.set_artists(["Kalle Persson <kalle kallepersson se>"])
-
+    
     about.set_translator_credits(_("translator-credits"))
 
     for prop, val in infos.items():
@@ -60,8 +60,14 @@
         
     zupa = gtk.gdk.pixbuf_new_from_file(hamster_logo)
     about.set_logo(zupa)
+    
+    def on_destroy():
+        print "byee"
+        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: trunk/hamster/applet.py
==============================================================================
--- trunk/hamster/applet.py	(original)
+++ trunk/hamster/applet.py	Fri Oct 24 15:13:23 2008
@@ -88,6 +88,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
@@ -445,15 +448,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: trunk/hamster/preferences.py
==============================================================================
--- trunk/hamster/preferences.py	(original)
+++ trunk/hamster/preferences.py	Fri Oct 24 15:13:23 2008
@@ -545,3 +545,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]