[evolution-patches] calendar, bug #51567,When deleting an appointment in the calendar, the question dialog can't be closed by ESC key



Hi all,

See #51567: When deleting an appointment in the calendar, the question dialog can't
be closed by ESC key.

The patch is for trunk.

A button with response_id 'GTK_RESPONSE_CANCEL' will make the dialog being
able to be destroyed by ESC key. So the patch encloses changes the response_ids of both the 'Yes' and 'No' buttons on the message_dialog while doesn't affect their funcionality.

This modification is pretty simple. I'd like to get your review.


Regards
Bruce  Tao
? calendar.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2138
diff -u -r1.2138 ChangeLog
--- ChangeLog	5 Feb 2004 07:00:26 -0000	1.2138
+++ ChangeLog	10 Feb 2004 06:17:35 -0000
@@ -1,3 +1,10 @@
+2004-02-06  Bruce Tao  <bruce tao sun com>
+
+	See #51567
+
+	* gui/dialogs/delete-comp.c (delete_component_dialog): 
+	 use "gtk_dialog_add_buttons" to change the response_id of button "YES" and "NO".
+
 2004-02-05  Kidd Wang  <kidd wang sun com>
 
 	* gui/goto-dialog.glade: add a mnemonic for the 'Go to Today' button
Index: gui/dialogs/delete-comp.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/delete-comp.c,v
retrieving revision 1.21
diff -u -r1.21 delete-comp.c
--- gui/dialogs/delete-comp.c	12 Jan 2004 21:19:09 -0000	1.21
+++ gui/dialogs/delete-comp.c	10 Feb 2004 06:17:35 -0000
@@ -150,9 +150,10 @@
 	}
 
 	dialog = gtk_message_dialog_new ((GtkWindow *)gtk_widget_get_toplevel (widget),
-					 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s", str);
+					 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", str);
+	gtk_dialog_add_buttons((GtkDialog *)dialog,GTK_STOCK_NO,GTK_RESPONSE_CANCEL,GTK_STOCK_YES,GTK_RESPONSE_OK,NULL);
 	g_free (str);
-	ret = gtk_dialog_run ((GtkDialog *)dialog) == GTK_RESPONSE_YES;
+	ret = gtk_dialog_run ((GtkDialog *)dialog) == GTK_RESPONSE_OK;
 	gtk_widget_destroy (dialog);
 
 	return ret;


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