aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-08-17 07:43:34 +0800
committerHans Petter <hansp@src.gnome.org>2004-08-17 07:43:34 +0800
commitc3aa4b6fa33f3d401717c1b2d00035da789ad3a7 (patch)
tree90f42500c5fe1af4fde98f1116296362e0d08f3b
parente1c0f0182092f57e25919b87141ba175d1b0c095 (diff)
downloadgsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar.gz
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar.bz2
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar.lz
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar.xz
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.tar.zst
gsoc2013-evolution-c3aa4b6fa33f3d401717c1b2d00035da789ad3a7.zip
Remove the custom prompt-to-save dialogs from here - use
2004-08-11 Hans Petter Jansson <hpj@ximian.com> * gui/contact-editor/e-contact-editor.c (app_delete_event_cb): Remove the custom prompt-to-save dialogs from here - use eab_prompt_save_dialog (), and then only if the contact actually changed. svn path=/trunk/; revision=26950
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c68
2 files changed, 22 insertions, 53 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index e98a0e99a2..e6e3edd6a1 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2004-08-11 Hans Petter Jansson <hpj@ximian.com>
+
+ * gui/contact-editor/e-contact-editor.c (app_delete_event_cb):
+ Remove the custom prompt-to-save dialogs from here - use
+ eab_prompt_save_dialog (), and then only if the contact actually
+ changed.
+
2004-08-16 Chris Toshok <toshok@ximian.com>
* gui/widgets/eab-gui-util.c (eab_show_multiple_contacts):
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index a1bd7c0196..f08434ab3d 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -2788,62 +2788,24 @@ app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
if (ce->in_async_call)
return TRUE;
- if (!ce->target_editable) {
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (widget),
- (GtkDialogFlags) 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("The contact cannot be saved to the "
- "selected address book. Do you want to "
- "discard changes?"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard"), GTK_RESPONSE_YES,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response != GTK_RESPONSE_YES)
- return TRUE;
- }
- else if (!e_book_is_writable (ce->source_book)) {
- GtkWidget *dialog;
- gint response;
-
- dialog = gtk_message_dialog_new (GTK_WINDOW (widget),
- (GtkDialogFlags) 0,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- _("You are moving the contact from one "
- "address book to another, but it cannot "
- "be removed from the source. Do you want "
- "to save a copy instead?"));
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("_Discard"), GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_YES,
- NULL);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES) {
- if (e_contact_editor_is_valid (EAB_EDITOR (ce)))
- real_save_contact (ce, FALSE);
- else
+ if (ce->changed) {
+ switch (eab_prompt_save_dialog (GTK_WINDOW (ce->app))) {
+ case GTK_RESPONSE_YES:
+ if (!eab_editor_is_valid (EAB_EDITOR (ce)))
+ return TRUE;
+
+ eab_editor_save_contact (EAB_EDITOR (ce), TRUE);
return TRUE;
+
+ case GTK_RESPONSE_NO:
+ break;
+
+ case GTK_RESPONSE_CANCEL:
+ default:
+ return TRUE;
+
}
- else if (response == GTK_RESPONSE_CANCEL)
- return TRUE;
}
- else if (!eab_editor_prompt_to_save_changes (EAB_EDITOR (ce), GTK_WINDOW (ce->app)))
- return TRUE;
eab_editor_close (EAB_EDITOR (ce));
return TRUE;