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 | |
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')
-rw-r--r-- | mail/ChangeLog | 17 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 28 | ||||
-rw-r--r-- | mail/mail-config.c | 25 | ||||
-rw-r--r-- | mail/mail-config.h | 3 |
4 files changed, 63 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 1ba972f910..0772093ae5 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,20 @@ +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. + 2001-08-16 Peter Williams <peterw@ximian.com> * subscribe-dialog.c (fe_got_children): Sort the nodes here... 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 diff --git a/mail/mail-config.c b/mail/mail-config.c index f40d999b0a..2050da0e05 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -66,6 +66,7 @@ typedef struct { guint32 citation_color; gboolean prompt_empty_subject; gboolean prompt_only_bcc; + gboolean confirm_expunge; gboolean do_seen_timeout; gint seen_timeout; gboolean empty_trash_on_exit; @@ -517,6 +518,10 @@ config_read (void) config->prompt_only_bcc = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Prompts/only_bcc", TRUE, NULL); + /* Expunge */ + config->confirm_expunge = bonobo_config_get_boolean_with_default ( + config->db, "/Mail/Prompts/confirm_expunge", TRUE, NULL); + /* PGP/GPG */ config->pgp_path = bonobo_config_get_string (config->db, "/Mail/PGP/path", NULL); @@ -786,11 +791,15 @@ mail_config_write_on_exit (void) /* Empty Subject */ bonobo_config_set_boolean (config->db, "/Mail/Prompts/empty_subject", - config->prompt_empty_subject, NULL); + config->prompt_empty_subject, NULL); /* Only Bcc */ bonobo_config_set_boolean (config->db, "/Mail/Prompts/only_bcc", - config->prompt_only_bcc, NULL); + config->prompt_only_bcc, NULL); + + /* Expunge */ + bonobo_config_set_boolean (config->db, "/Mail/Prompts/confirm_expunge", + config->confirm_expunge, NULL); /* PGP/GPG */ bonobo_config_set_string_wrapper (config->db, "/Mail/PGP/path", @@ -1144,6 +1153,18 @@ mail_config_set_prompt_only_bcc (gboolean value) config->prompt_only_bcc = value; } +gboolean +mail_config_get_confirm_expunge (void) +{ + return config->confirm_expunge; +} + +void +mail_config_set_confirm_expunge (gboolean value) +{ + config->confirm_expunge = value; +} + struct { char *bin; diff --git a/mail/mail-config.h b/mail/mail-config.h index db057f0656..76aa3b60cd 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -148,6 +148,9 @@ void mail_config_set_prompt_empty_subject (gboolean value); gboolean mail_config_get_prompt_only_bcc (void); void mail_config_set_prompt_only_bcc (gboolean value); +gboolean mail_config_get_confirm_expunge (void); +void mail_config_set_confirm_expunge (gboolean value); + CamelPgpType mail_config_get_pgp_type (void); void mail_config_set_pgp_type (CamelPgpType pgp_type); |