From 9c42c5b193c83a19586508803a81ba590e7b1887 Mon Sep 17 00:00:00 2001 From: Anna Marie Dirks Date: Tue, 20 May 2003 16:19:15 +0000 Subject: Change this dialog from using a gnome_message_box (which has been 2003-05-20 Anna Marie Dirks * gui/dialogs/save-comp.c (save_component_dialog): Change this dialog from using a gnome_message_box (which has been deprecated), to using a gtk_message_dialog. This HIG-ifies this dialog, and fixes bug #42046. svn path=/trunk/; revision=21285 --- calendar/gui/dialogs/save-comp.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 499a278dc3..548c210b46 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -25,9 +25,9 @@ #include #include -#include -#include #include +#include +#include #include "save-comp.h" @@ -41,28 +41,31 @@ * * Return value: the response_id of the button selected. **/ + GtkResponseType save_component_dialog (GtkWindow *parent) { GtkWidget *dialog; gint r; - dialog = gnome_message_box_new (_("Do you want to save changes?"), - GNOME_MESSAGE_BOX_QUESTION, - GTK_STOCK_CANCEL, - GTK_STOCK_NO, - GTK_STOCK_YES, - NULL); + dialog = gtk_message_dialog_new (GTK_WINDOW (parent), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, + _("This event has been changed, but has not been saved.\n\n" + "Do you wish to save your changes?")); + + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + _("_Discard Changes"),GTK_RESPONSE_NO, + GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_YES, + NULL); + + gtk_window_set_title (GTK_WINDOW (dialog), _("Save Event")); + gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES); - gnome_dialog_set_default (GNOME_DIALOG (dialog), 0); - gnome_dialog_grab_focus (GNOME_DIALOG (dialog), 0); - gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent); + r = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); - r = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - if (r == 1) - return GTK_RESPONSE_NO; - else if (r == 2) - return GTK_RESPONSE_YES; + return r; - return GTK_RESPONSE_CANCEL; } -- cgit