diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-14 03:55:40 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-14 03:55:40 +0800 |
commit | 5be8aeed4ccca2a2088508d64205ea3f6b6554bc (patch) | |
tree | 1750d9f435f66e103a02e57ab5172b393182c4d7 /mail | |
parent | d1b8ed3f75ddbf73aabd2184c7f24c4d16977af5 (diff) | |
download | gsoc2013-evolution-5be8aeed4ccca2a2088508d64205ea3f6b6554bc.tar.gz gsoc2013-evolution-5be8aeed4ccca2a2088508d64205ea3f6b6554bc.tar.zst gsoc2013-evolution-5be8aeed4ccca2a2088508d64205ea3f6b6554bc.zip |
Confirm that the user really wants to expunge. (save_msg_ok): Set the
2001-08-13 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (expunge_folder): Confirm that the user really
wants to expunge.
(save_msg_ok): Set the parent window here.
svn path=/trunk/; revision=11949
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 30 |
2 files changed, 35 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 09d6813499..4ef4c7b3c1 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-08-13 Jeffrey Stedfast <fejj@ximian.com> + + * mail-callbacks.c (expunge_folder): Confirm that the user really + wants to expunge. + (save_msg_ok): Set the parent window here. + 2001-08-13 Peter Williams <peterw@ximian.com> * mail-config.c (remove_account_shortcuts): Remove the shortcuts diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 6ad6008ccf..5fed62e747 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -1487,6 +1487,7 @@ save_msg_ok (GtkWidget *widget, gpointer user_data) GNOME_STOCK_BUTTON_NO, NULL); + gtk_widget_set_parent (dialog, GTK_WIDGET (user_data)); text = gtk_label_new (_("A file by that name already exists.\nOverwrite it?")); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), text, TRUE, TRUE, 4); gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, FALSE); @@ -1669,12 +1670,39 @@ expunged_folder (CamelFolder *f, void *data) g_free (data); } +static gboolean +confirm_expunge (void) +{ + GtkWidget *dialog, *label; + int button; + + dialog = gnome_dialog_new (_("Are you sure?"), + GNOME_STOCK_BUTTON_YES, + GNOME_STOCK_BUTTON_NO, + NULL); + + label = gtk_label_new (_("You are about to expunge a folder. This will\n" + "permantly remove all messages with a \"deleted\"\n" + "flag from both this folder and the Trash folder.\n\n" + "Are you sure you want to continue?")); + + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4); + + button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + + if (button == 0) + return TRUE; + else + return FALSE; +} + void expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path) { FolderBrowser *fb = FOLDER_BROWSER (user_data); - if (fb->folder && (fb->expunging == NULL || fb->folder != fb->expunging)) { + if (fb->folder && (fb->expunging == NULL || fb->folder != fb->expunging) && confirm_expunge ()) { struct _expunged_folder_data *data; CamelMessageInfo *info; |