[PATCH] control-center about box broken



Like in a lot of apps you can bring up as many about boxes as you want
in the control-center. A patch is attached.

Regards,
Richard


Index: callbacks.c
===================================================================
RCS file: /cvs/gnome/control-center/control-center/callbacks.c,v
retrieving revision 1.8
diff -u -r1.8 callbacks.c
--- callbacks.c	1998/12/24 23:06:35	1.8
+++ callbacks.c	1999/02/20 15:12:19
@@ -14,6 +14,8 @@
 extern GtkWidget *create_exit_dialog();
 extern GList *capplet_list;
 
+static GtkWidget *about = NULL;
+
 /* this is meant to be called with a foreach to make a list of all modified nodes. */
 void
 create_templist (node_data *data, GList **list)
@@ -52,20 +54,36 @@
         exit_dialog = NULL;
 }
 
+static void
+about_destroy_callback (void)
+{
+  about = NULL;
+}
+
 void
 about_callback(GtkWidget *widget, gpointer data)
 {
-	GtkWidget *about = NULL;
 	gchar *authors[] = {
                 "Jonathan Blandford <jrb@redhat.com>",
 		NULL
 	};
 
+        if (about) {
+		gdk_window_raise (about->window);
+		return;
+	}
+
 	about = gnome_about_new(_("Desktop Manager"), "0.1",
 				"Copyright (C) 1998 the Free Software Foundation",
 				(const gchar **) authors,
 				_("Desktop Properties manager."),
 				NULL);
+
+	gtk_signal_connect (GTK_OBJECT (about),
+			    "destroy",
+			    (GtkSignalFunc) about_destroy_callback,
+			    NULL);
+	
         gtk_widget_show(about);
 }
 void


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