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
This commit is contained in:
Jeffrey Stedfast
2001-08-13 19:55:40 +00:00
committed by Jeffrey Stedfast
parent d1b8ed3f75
commit 5be8aeed4c
2 changed files with 35 additions and 1 deletions

View File

@ -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

View File

@ -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;