From 0f7b73d6396ccc08c479c86759c0a3016a1aaf3e Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 13 Jul 2010 18:00:19 +0100 Subject: Bug 624204 - Warn when replying privately to a mailing list message --- mail/e-mail-reader.c | 37 +++++++++++++++++++++++++++++++++++- mail/evolution-mail.schemas.in | 16 ++++++++++++++++ mail/mail-config.ui | 15 +++++++++++++++ mail/mail.error.xml | 9 +++++++++ modules/mail/e-mail-shell-settings.c | 4 ++++ modules/mail/em-composer-prefs.c | 5 +++++ 6 files changed, 85 insertions(+), 1 deletion(-) diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index d1e6a12ae0..17242d7725 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -32,6 +32,7 @@ #include "e-util/e-binding.h" #include "e-util/e-charset.h" #include "e-util/e-util.h" +#include "e-util/e-alert-dialog.h" #include "e-util/gconf-bridge.h" #include "shell/e-shell-utils.h" #include "widgets/misc/e-popup-action.h" @@ -838,7 +839,41 @@ static void action_mail_reply_sender_cb (GtkAction *action, EMailReader *reader) { - e_mail_reader_reply_to_message (reader, REPLY_MODE_SENDER); + gint mode = REPLY_MODE_SENDER; + GConfClient *gconf; + + gconf = mail_config_get_gconf_client (); + if (gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/private_list_reply", NULL) && + e_mail_reader_check_state(reader) & E_MAIL_READER_SELECTION_IS_MAILING_LIST) { + GtkDialog *dialog; + GtkWidget *content_area, *check; + gint response; + + dialog = (GtkDialog*) e_alert_dialog_new_for_args (e_mail_reader_get_window (reader), + "mail:ask-list-private-reply", NULL); + + /*Check buttons*/ + check = gtk_check_button_new_with_mnemonic (_("_Do not ask me again.")); + gtk_container_set_border_width((GtkContainer *)check, 12); + content_area = gtk_dialog_get_content_area (dialog); + gtk_box_pack_start (GTK_BOX (content_area), check, TRUE, TRUE, 0); + gtk_widget_show (check); + + response = gtk_dialog_run ((GtkDialog *) dialog); + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) + gconf_client_set_bool(gconf, "/apps/evolution/mail/prompts/private_list_reply", FALSE, NULL); + + gtk_widget_destroy((GtkWidget *)dialog); + + if (response == GTK_RESPONSE_YES) + mode = REPLY_MODE_ALL; + else if (response == GTK_RESPONSE_OK) + mode = REPLY_MODE_LIST; + else if (response == GTK_RESPONSE_CANCEL) + return; + } + e_mail_reader_reply_to_message (reader, mode); } static void diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in index 5ab3e37735..8956974393 100644 --- a/mail/evolution-mail.schemas.in +++ b/mail/evolution-mail.schemas.in @@ -1051,6 +1051,22 @@ + + /schemas/apps/evolution/mail/prompts/private_list_reply + /apps/evolution/mail/prompts/private_list_reply + evolution-mail + bool + true + + Prompt when replying privately to list messages + + It disables/enables the repeated prompts to warn that you are + sending a private reply to a message which arrived via a + mailing list. + + + + diff --git a/mail/mail-config.ui b/mail/mail-config.ui index ce2a19845d..3817d06792 100644 --- a/mail/mail-config.ui +++ b/mail/mail-config.ui @@ -4801,6 +4801,21 @@ For example: "Work" or "Personal" 1 + + + Prompt when sending private replies to mailing _list messages + True + True + False + True + True + + + False + False + 2 + + diff --git a/mail/mail.error.xml b/mail/mail.error.xml index 129b4e6250..a9be483a99 100644 --- a/mail/mail.error.xml +++ b/mail/mail.error.xml @@ -58,6 +58,15 @@ Many email systems add an Apparently-To header to messages that only have BCC re + + + <_primary>This message cannot be sent because you have not specified any recipients <_secondary xml:space="preserve">Please enter a valid email address in the To: field. You can search for email addresses by clicking on the To: button next to the entry box. diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c index 8839341451..d46972ffd8 100644 --- a/modules/mail/e-mail-shell-settings.c +++ b/modules/mail/e-mail-shell-settings.c @@ -219,6 +219,10 @@ e_mail_shell_settings_init (EShell *shell) "composer-prompt-only-bcc", "/apps/evolution/mail/prompts/only_bcc"); + e_shell_settings_install_property_for_key ( + "composer-prompt-private-list-reply", + "/apps/evolution/mail/prompts/private_list_reply"); + e_shell_settings_install_property_for_key ( "composer-prompt-empty-subject", "/apps/evolution/mail/prompts/empty_subject"); diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 7c0f39ea31..f2def6b123 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -417,6 +417,11 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, shell_settings, "composer-prompt-only-bcc", widget, "active"); + widget = e_builder_get_widget (prefs->builder, "chkPromptPrivateListReply"); + e_mutual_binding_new ( + shell_settings, "composer-prompt-private-list-reply", + widget, "active"); + widget = e_builder_get_widget (prefs->builder, "chkAutoSmileys"); e_mutual_binding_new ( shell_settings, "composer-magic-smileys", -- cgit v1.2.3