aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-10-30 11:45:46 +0800
committerChris Toshok <toshok@src.gnome.org>2001-10-30 11:45:46 +0800
commitac8cf2c210f655675c49f04fb7c3c679db4f1fae (patch)
treea4b490d7bd87b8a819c04c6a375381436fb138bc /addressbook/gui/widgets
parent2d8615531ca8bfabee8797331b00eb8d869a8e84 (diff)
downloadgsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar.gz
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar.bz2
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar.lz
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar.xz
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.tar.zst
gsoc2013-evolution-ac8cf2c210f655675c49f04fb7c3c679db4f1fae.zip
new function, a "Do you want to save changes?" dialog.
2001-10-29 Chris Toshok <toshok@ximian.com> * gui/widgets/e-addressbook-util.c (e_addressbook_prompt_save_dialog): new function, a "Do you want to save changes?" dialog. * gui/widgets/e-addressbook-util.h: add prototype for e_addressbook_prompt_save_dialog. * gui/contact-editor/e-contact-editor.c (prompt_to_save_changes): call e_addressbook_prompt_save_dialog and save the card if they select save. return TRUE if the dialog should be closed, FALSE otherwise. (file_close_cb): check prompt_to_save_changes before closing the dialog. (app_delete_event_cb): same. * gui/contact-list-editor/e-contact-list-editor.c (prompt_to_save_changes): call e_addressbook_prompt_save_dialog and save the card if they select save. return TRUE if the dialog should be closed, FALSE otherwise. (file_close_cb): check prompt_to_save_changes before closing the dialog. (app_delete_event_cb): same. svn path=/trunk/; revision=14414
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-util.c18
-rw-r--r--addressbook/gui/widgets/e-addressbook-util.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-util.c b/addressbook/gui/widgets/e-addressbook-util.c
index 601a1e1183..fa29b61bba 100644
--- a/addressbook/gui/widgets/e-addressbook-util.c
+++ b/addressbook/gui/widgets/e-addressbook-util.c
@@ -49,6 +49,24 @@ e_addressbook_error_dialog (const gchar *msg, EBookStatus status)
g_free (error_msg);
}
+gint
+e_addressbook_prompt_save_dialog (GtkWindow *parent)
+{
+ GtkWidget *dialog;
+
+ 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,
+ 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));
+}
static void
added_cb (EBook* book, EBookStatus status, const char *id,
diff --git a/addressbook/gui/widgets/e-addressbook-util.h b/addressbook/gui/widgets/e-addressbook-util.h
index f6afa31046..3eff236654 100644
--- a/addressbook/gui/widgets/e-addressbook-util.h
+++ b/addressbook/gui/widgets/e-addressbook-util.h
@@ -31,6 +31,7 @@ extern "C" {
void e_addressbook_error_dialog (const gchar *msg,
EBookStatus status);
+gint e_addressbook_prompt_save_dialog (GtkWindow *parent);
EContactEditor* e_addressbook_show_contact_editor (EBook *book, ECard *card,
gboolean is_new_card,
gboolean editable);