pidgin: c4646ea7: Display a confirmation prompt when attem...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Tue Feb 9 01:31:22 EST 2010


-----------------------------------------------------------------
Revision: c4646ea74bb81a58efebe448c11ab09322427ca4
Ancestor: 8e89c477b196af061a85afe2711dc8b3bccc78c4
Author: kartikmohta at gmail.com
Date: 2010-02-09T06:21:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c4646ea74bb81a58efebe448c11ab09322427ca4

Modified files:
        pidgin/gtkwhiteboard.c

ChangeLog: 

Display a confirmation prompt when attempting to clear the whiteboard.
Fixes #7746.

-------------- next part --------------
============================================================
--- pidgin/gtkwhiteboard.c	f9e44e075e85b4795313a935bed5ccf6ab736c12
+++ pidgin/gtkwhiteboard.c	1292c049ccb38caad95fa6c53b5eaefd081b48f4
@@ -738,12 +738,24 @@ static void pidgin_whiteboard_button_cle
 {
 	PidginWhiteboard *gtkwb = (PidginWhiteboard*)(data);
 
-	pidgin_whiteboard_clear(gtkwb->wb);
+	/* Confirm whether the user really wants to clear */
+	GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(gtkwb->window),
+											   GTK_DIALOG_DESTROY_WITH_PARENT,
+											   GTK_MESSAGE_QUESTION,
+											   GTK_BUTTONS_YES_NO,
+											   _("Do you really want to clear?"));
+	gint response = gtk_dialog_run(GTK_DIALOG(dialog));
+	gtk_widget_destroy(dialog);
 
-	pidgin_whiteboard_set_canvas_as_icon(gtkwb);
+	if (response == GTK_RESPONSE_YES)
+	{
+		pidgin_whiteboard_clear(gtkwb->wb);
 
-	/* Do protocol specific clearing procedures */
-	purple_whiteboard_send_clear(gtkwb->wb);
+		pidgin_whiteboard_set_canvas_as_icon(gtkwb);
+
+		/* Do protocol specific clearing procedures */
+		purple_whiteboard_send_clear(gtkwb->wb);
+	}
 }
 
 static void pidgin_whiteboard_button_save_press(GtkWidget *widget, gpointer data)


More information about the Commits mailing list