On Tue, 2010-07-13 at 11:44 -0430, Patrick O'Callaghan wrote:
> 
> I would prefer David's counter-proposal (see parallel thread or the BZ
> page) in which Reply To List has the effect of Reply To All when list
> headers are not detected (currently it does nothing so there's nothing
> to lose).

Actually, the action behind the scenes _does_ already fall back to
'Reply to All'. It's just that the Ctrl-L keystroke isn't _enabled_
unless it's a list message. We could "fix" that, or perhaps we could
just give you a hidden gconf option to make 'reply to all' actually
reply to the list where appropriate.

But that's a separate issue to your complaint that people reply
privately when they shouldn't.

Here's some code which will hopefully discourage that behaviour. Can
anyone tell me why the option in the composer prefs doesn't actually
work? It doesn't toggle the gconf key. But if I set it manually with
gconf-editor, it all works fine (and using the 'Don't ask me again'
checkbox also turns it off).

I'm unsure about changing the button text to 'Private Reply'. It's nice
and obvious... but it changes the size of the button.

diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 795dfcd..26048c5 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -31,6 +31,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"
@@ -836,7 +837,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
@@ -2411,6 +2446,13 @@ mail_reader_update_actions (EMailReader *reader)
        sensitive = have_an_account && single_message_selected;
        action = e_mail_reader_get_action (reader, action_name);
        gtk_action_set_sensitive (action, sensitive);
+       if (selection_is_mailing_list) {
+               gtk_action_set_label(action, _("Private Reply"));
+               gtk_action_set_short_label(action, _("Private Reply"));
+       } else {
+               gtk_action_set_label(action, _("Reply"));
+               gtk_action_set_short_label(action, _("Reply"));
+       }
 
        action_name = "mail-save-as";
        sensitive = any_messages_selected;
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index 5ab3e37..50a6917 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -1051,6 +1051,22 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/evolution/mail/prompts/private_list_reply</key>
+      <applyto>/apps/evolution/mail/prompts/private_list_reply</applyto>
+      <owner>evolution-mail</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>Prompt when replying privately to list messages</short>
+         <long>
+         It disables/enables the repeated prompts to warn that you are
+        sending a private reply to a message which arrived via a
+        mailing list.
+         </long>
+      </locale>
+    </schema>
+
        <!-- Trash settings -->
 
     <schema>
diff --git a/mail/mail-config.ui b/mail/mail-config.ui
index ce2a198..3817d06 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -4801,6 +4801,21 @@ For example: "Work" or "Personal"</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
+                        <child>
+                          <object class="GtkCheckButton" 
id="chkPromptPrivateListReply">
+                            <property name="label" translatable="yes">Prompt 
when sending private replies to mailing _list messages</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="use_underline">True</property>
+                            <property name="draw_indicator">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/mail/mail.error.xml b/mail/mail.error.xml
index 129b4e6..113751d 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
     <button _label="_Send" response="GTK_RESPONSE_YES"/>
   </error>
 
+  <error id="ask-list-private-reply" type="question" default="GTK_RESPONSE_OK">
+    <_primary>Send private reply?</_primary>
+    <_secondary>You are replying to a message which arrived via a mailing 
list, but you are replying directly to the sender; not to the list. Are you 
sure you want to proceed?</_secondary>
+    <button response="GTK_RESPONSE_NO" _label="Reply _Privately..."/>
+    <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+    <button response="GTK_RESPONSE_YES" _label="Reply to _All"></button>
+    <button response="GTK_RESPONSE_OK" _label="Reply to _List"></button>
+  </error>
+
   <error id="send-no-recipients" type="warning">
     <_primary>This message cannot be sent because you have not specified any 
recipients</_primary>
     <_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.</_secondary>
diff --git a/modules/mail/e-mail-shell-settings.c 
b/modules/mail/e-mail-shell-settings.c
index 8839341..d46972f 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -220,6 +220,10 @@ e_mail_shell_settings_init (EShell *shell)
                "/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 7c0f39e..f2def6b 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",


-- 
David Woodhouse                            Open Source Technology Centre
david.woodho...@intel.com                              Intel Corporation

_______________________________________________
evolution-list mailing list
evolution-list@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-list

Reply via email to