From 460a3fb010bb5c636b823df67364e39addaf8078 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 12 Mar 2003 16:04:50 +0000 Subject: corrected button ordering and changed the return type to be a 2003-03-12 Rodrigo Moya * gui/dialogs/save-comp.[ch] (save_component_dialog): corrected button ordering and changed the return type to be a GtkResponseType. * gui/dialogs/comp-editor.c (prompt_to_save_changes): adapted to changes in save_component_dialog. svn path=/trunk/; revision=20261 --- calendar/gui/dialogs/save-comp.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'calendar/gui/dialogs/save-comp.c') diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 29701f92d7..899ff34ec2 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -39,23 +39,30 @@ * Pops up a dialog box asking the user whether he wants to save changes for * a calendar component. * - * Return value: TRUE if changes shold be saved, FALSE otherwise. + * Return value: the response_id of the button selected. **/ -gint +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, - GNOME_STOCK_BUTTON_YES, - GNOME_STOCK_BUTTON_NO, GNOME_STOCK_BUTTON_CANCEL, + GNOME_STOCK_BUTTON_NO, + GNOME_STOCK_BUTTON_YES, NULL); gnome_dialog_set_default (GNOME_DIALOG (dialog), 0); gnome_dialog_grab_focus (GNOME_DIALOG (dialog), 0); gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent); - return gnome_dialog_run_and_close (GNOME_DIALOG (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 GTK_RESPONSE_CANCEL; } -- cgit v1.2.3