diff options
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-util.c | 18 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-util.h | 1 |
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); |