seahorse r2960 - in trunk: . libseahorse



Author: sadam
Date: Tue Mar 24 21:42:47 2009
New Revision: 2960
URL: http://svn.gnome.org/viewvc/seahorse?rev=2960&view=rev

Log:
2009-03-24  Adam Schreiber  <sadam clemson edu>

    * libseahorse/seahorse-prefs.c: Gracefully handle preferences window 
already
    being open.  Fixes bug #576519


Modified:
   trunk/ChangeLog
   trunk/libseahorse/seahorse-prefs.c

Modified: trunk/libseahorse/seahorse-prefs.c
==============================================================================
--- trunk/libseahorse/seahorse-prefs.c	(original)
+++ trunk/libseahorse/seahorse-prefs.c	Tue Mar 24 21:42:47 2009
@@ -480,26 +480,32 @@
     SeahorseWidget *swidget;
     GtkWidget *widget = NULL;
 
-    
     swidget = seahorse_widget_new ("prefs", parent);
     
+    if (swidget != NULL) {
+    
 #ifdef WITH_KEYSERVER
-    setup_keyservers (swidget);
+        setup_keyservers (swidget);
 #else
-    widget = glade_xml_get_widget (swidget->xml, "keyserver-tab");
-    g_return_val_if_fail (GTK_IS_WIDGET (widget), swidget);
-    seahorse_prefs_remove_tab (swidget, widget);
+        widget = glade_xml_get_widget (swidget->xml, "keyserver-tab");
+        g_return_val_if_fail (GTK_IS_WIDGET (widget), swidget);
+        seahorse_prefs_remove_tab (swidget, widget);
 #endif
 
 #ifdef WITH_SHARING
-    setup_sharing (swidget);
+        setup_sharing (swidget);
 #else
-    widget = glade_xml_get_widget (swidget->xml, "sharing-tab");
-    g_return_val_if_fail (GTK_IS_WIDGET (widget), swidget);
-    seahorse_prefs_remove_tab (swidget, widget);
+        widget = glade_xml_get_widget (swidget->xml, "sharing-tab");
+        g_return_val_if_fail (GTK_IS_WIDGET (widget), swidget);
+        seahorse_prefs_remove_tab (swidget, widget);
 #endif    
 
-    seahorse_widget_show (swidget);
+        seahorse_widget_show (swidget);
+    } else {
+        swidget = seahorse_widget_find ("prefs");
+        gtk_window_present (GTK_WINDOW (glade_xml_get_widget (swidget->xml, swidget->name)));
+    }
+    
     return swidget;
 }
 



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