aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-03-13 00:04:50 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-03-13 00:04:50 +0800
commit460a3fb010bb5c636b823df67364e39addaf8078 (patch)
tree8a8b7fd30c87fa5f60a973013d26bea677ada981
parentbdad58fc5f68ee7bcf42a2a6537b7d744abd16af (diff)
downloadgsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar.gz
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar.bz2
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar.lz
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar.xz
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.tar.zst
gsoc2013-evolution-460a3fb010bb5c636b823df67364e39addaf8078.zip
corrected button ordering and changed the return type to be a
2003-03-12 Rodrigo Moya <rodrigo@ximian.com> * 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
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/dialogs/comp-editor.c6
-rw-r--r--calendar/gui/dialogs/save-comp.c17
-rw-r--r--calendar/gui/dialogs/save-comp.h4
4 files changed, 25 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 3cc2ecfa80..6f377bc98a 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-12 Rodrigo Moya <rodrigo@ximian.com>
+
+ * 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.
+
2003-03-11 Dan Winship <danw@ximian.com>
* gui/calendar-config.c (on_timezone_set): Update for timezone
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index af97707f9e..27dd2ea8c2 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -402,7 +402,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
switch (save_component_dialog (GTK_WINDOW (editor))) {
- case 0: /* Save */
+ case GTK_RESPONSE_YES: /* Save */
if (cal_component_is_instance (priv->comp))
if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
return FALSE;
@@ -413,9 +413,9 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
else
return FALSE;
- case 1: /* Discard */
+ case GTK_RESPONSE_NO: /* Discard */
return TRUE;
- case 2: /* Cancel */
+ case GTK_RESPONSE_CANCEL: /* Cancel */
default:
return FALSE;
}
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;
}
diff --git a/calendar/gui/dialogs/save-comp.h b/calendar/gui/dialogs/save-comp.h
index 7090464a4e..a9aedd2bce 100644
--- a/calendar/gui/dialogs/save-comp.h
+++ b/calendar/gui/dialogs/save-comp.h
@@ -22,8 +22,8 @@
#ifndef SAVE_COMP_H
#define SAVE_COMP_H
-#include <gtk/gtkwindow.h>
+#include <gtk/gtkdialog.h>
-gint save_component_dialog (GtkWindow *parent);
+GtkResponseType save_component_dialog (GtkWindow *parent);
#endif