diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-17 11:01:37 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-17 11:01:37 +0800 |
commit | 6b1869912eb6d5b70bd36e2b52c0f746da5a1825 (patch) | |
tree | c30d42094a53b3663c41d94c23c08023639f664c /mail/mail-callbacks.c | |
parent | 3f8453bad74edb5d48660a5a9173c3fbeb1ec006 (diff) | |
download | gsoc2013-evolution-6b1869912eb6d5b70bd36e2b52c0f746da5a1825.tar.gz gsoc2013-evolution-6b1869912eb6d5b70bd36e2b52c0f746da5a1825.tar.zst gsoc2013-evolution-6b1869912eb6d5b70bd36e2b52c0f746da5a1825.zip |
Respect the user's desire to be prompted to confirm that he wants to
2001-08-16 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (confirm_expunge): Respect the user's desire to
be prompted to confirm that he wants to expunge the blasted
folder. Also, don't set the usize - that's just an evil hack and
you may find it will cut off text once the label has been
translated.
(create_msg_composer): In order for the security options to be
checked when composing a new message, we must set the from account
explicitly even though the composer hdrs sets the default from
account and emits the signal because at that stage the composer
hasn't yet connected to the signals and thus the bonobo menu items
don't get set.
* mail-config.c (mail_config_set_confirm_expunge): New.
(mail_config_get_confirm_expunge): New.
svn path=/trunk/; revision=12141
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index f84f28332d..81fd4e43be 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -288,7 +288,7 @@ struct _send_data { }; static void -composer_sent_cb(char *uri, CamelMimeMessage *message, gboolean sent, void *data) +composer_sent_cb (char *uri, CamelMimeMessage *message, gboolean sent, void *data) { struct _send_data *send = data; @@ -354,7 +354,7 @@ composer_get_message (EMsgComposer *composer) return NULL; } } - + /* Check for no subject */ subject = camel_mime_message_get_subject (message); if (subject == NULL || subject[0] == '\0') { @@ -396,11 +396,11 @@ composer_send_cb (EMsgComposer *composer, gpointer data) message = composer_get_message (composer); if (!message) return; - + transport = mail_config_get_default_transport (); if (!transport) return; - + send = g_malloc (sizeof (*send)); send->psd = psd; send->composer = composer; @@ -451,6 +451,7 @@ create_msg_composer (const char *url) composer = url ? e_msg_composer_new_from_url (url) : e_msg_composer_new (); if (composer) { + e_msg_composer_hdrs_set_from_account (composer->hdrs, account->name); e_msg_composer_set_send_html (composer, send_html); e_msg_composer_show_sig_file (composer); } @@ -1673,25 +1674,36 @@ expunged_folder (CamelFolder *f, void *data) static gboolean confirm_expunge (void) { - GtkWidget *dialog, *label; + GtkWidget *dialog, *label, *checkbox; int button; + if (!mail_config_get_confirm_expunge ()) + return TRUE; + dialog = gnome_dialog_new (_("Warning"), GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, NULL); - gtk_widget_set_usize (GTK_WIDGET (dialog), 323, 180); - - label = gtk_label_new (_("This operation will permanently erase all messages marked as deleted. If you continue, you will not be able to recover these messages. \n \n Really erase these messages? ")); + label = gtk_label_new (_("This operation will permanently erase all messages marked as deleted. If you continue, you will not be able to recover these messages.\n\nReally erase these messages?")); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 4); + checkbox = gtk_check_button_new_with_label (_("Do not ask me again.")); + gtk_object_ref (GTK_OBJECT (checkbox)); + gtk_widget_show (checkbox); + gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 4); + button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + if (button == 0 && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))) + mail_config_set_confirm_expunge (FALSE); + + gtk_object_unref (GTK_OBJECT (checkbox)); + if (button == 0) return TRUE; else |