pidgin: c5920a65: Close the colour selection dialog when t...

qulogic at pidgin.im qulogic at pidgin.im
Sun Aug 9 01:20:29 EDT 2009


-----------------------------------------------------------------
Revision: c5920a65f85a2bb34b1cd6ff8c031c07601beee4
Ancestor: f1f696174da801e709c7ee17dd9a6423b54dba3f
Author: qulogic at pidgin.im
Date: 2009-08-09T05:17:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c5920a65f85a2bb34b1cd6ff8c031c07601beee4

Modified files:
        pidgin/gtkwhiteboard.c

ChangeLog: 

Close the colour selection dialog when the whiteboard window is closed.

Fixes #9867.

-------------- next part --------------
============================================================
--- pidgin/gtkwhiteboard.c	f5f877b1898b292703bb45f6ee1a8dfaec8b648a
+++ pidgin/gtkwhiteboard.c	8122e71b0b51b512e6b35af47165448ae1b7afba
@@ -273,6 +273,7 @@ static void pidgin_whiteboard_destroy(Pu
 static void pidgin_whiteboard_destroy(PurpleWhiteboard *wb)
 {
 	PidginWhiteboard *gtkwb;
+	GtkWidget *colour_dialog;
 
 	g_return_if_fail(wb != NULL);
 	gtkwb = wb->ui_data;
@@ -287,6 +288,12 @@ static void pidgin_whiteboard_destroy(Pu
 		gtkwb->pixmap = NULL;
 	}
 
+	colour_dialog = g_object_get_data(G_OBJECT(gtkwb->window), "colour-dialog");
+	if (colour_dialog) {
+		gtk_widget_destroy(colour_dialog);
+		g_object_set_data(G_OBJECT(gtkwb->window), "colour-dialog", NULL);
+	}
+
 	if(gtkwb->window)
 	{
 		gtk_widget_destroy(gtkwb->window);
@@ -804,7 +811,7 @@ static void pidgin_whiteboard_button_sav
 	{
 		gtk_widget_destroy(dialog);
 
-		purple_debug_info("gtkwhiteboard", "File not Saved... Canceled\n");
+		purple_debug_info("gtkwhiteboard", "File not Saved... Cancelled\n");
 	}
 }
 
@@ -848,9 +855,11 @@ change_color_cb(GtkColorSelection *selec
 	purple_whiteboard_send_brush(wb, old_size, new_color);
 }
 
-static void color_selection_dialog_destroy(GtkWidget *w, GtkWidget *destroy)
+static void color_selection_dialog_destroy(GtkWidget *w, PidginWhiteboard *gtkwb)
 {
-	gtk_widget_destroy(destroy);
+	GtkWidget *dialog = g_object_get_data(G_OBJECT(gtkwb->window), "colour-dialog");
+	gtk_widget_destroy(dialog);
+	g_object_set_data(G_OBJECT(gtkwb->window), "colour-dialog", NULL);
 }
 
 static void color_select_dialog(GtkWidget *widget, PidginWhiteboard *gtkwb)
@@ -859,6 +868,7 @@ static void color_select_dialog(GtkWidge
 	GtkColorSelectionDialog *dialog;
 
 	dialog = (GtkColorSelectionDialog *)gtk_color_selection_dialog_new(_("Select color"));
+	g_object_set_data(G_OBJECT(gtkwb->window), "colour-dialog", dialog);
 
 	g_signal_connect(G_OBJECT(dialog->colorsel), "color-changed",
 					G_CALLBACK(change_color_cb), gtkwb);
@@ -867,7 +877,7 @@ static void color_select_dialog(GtkWidge
 	gtk_widget_destroy(dialog->help_button);
 
 	g_signal_connect(G_OBJECT(dialog->ok_button), "clicked",
-					G_CALLBACK(color_selection_dialog_destroy), dialog);
+					G_CALLBACK(color_selection_dialog_destroy), gtkwb);
 
 	gtk_color_selection_set_has_palette(GTK_COLOR_SELECTION(dialog->colorsel), TRUE);
 


More information about the Commits mailing list