Re: [Evolution] Reply for list messages should go back to the list



On Wed, 2010-07-14 at 17:15 -0400, Paul Smith wrote:
What I'm suggesting is that we retarget "Reply to All" (Shift-Ctrl-R)
and the button to be, instead "Reply Publicly" (or you can keep it named
"Reply to All" for all I care).  This button would DTRT based on the
message, to send a public reply.  So, in this mode replies to mailing
lists with List-Post headers would go there only.  Otherwise it behaves
as today.

I don't think there's any particular need to retarget Ctrl-Shift-R. If
you're using the keyboard, you already have Ctrl-L (although see below).

Likewise, there's no point in changing the menu items -- you have
Reply / Reply to All / Reply to List there too, and can just use the one
you want.

The request that really seems justified is the one for the *toolbar*. So
here's a patch which gives you the option to change the 'Reply to All'
button into a 'Reply in Public' button.

I haven't exposed the option in the UI; you can set it in gconf
manually. Hopefully that way it isn't considered to be violating the HIG
by changing the toolbar at runtime.

There was a request to have a keystroke that's enabled at all times (not
just for list messages) and which has the same 'reply to list or all'
behaviour. I don't see how to do that easily, so I haven't done it. Just
reassigning the Ctrl-L keystroke to the 'reply in public' GtkAction when
that gconf option is enabled would mean that the accelerator disappears
from the 'Reply to List' item in the menu. Someone who cares more for
this "reply-to-list" nonsense might spend more time trying to work it
out... :)

diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 74f0e7c..880d582 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -913,6 +913,21 @@ action_mail_reply_all_cb (GtkAction *action,
 }
 
 static void
+action_mail_reply_public_cb (GtkAction *action,
+                            EMailReader *reader)
+{
+       GConfClient *gconf = mail_config_get_gconf_client ();
+       gboolean reply_public = gconf_client_get_bool (gconf,
+                                       "/apps/evolution/mail/composer/reply_public", NULL);
+       guint32 state = e_mail_reader_check_state (reader);
+
+       if (reply_public && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST))
+               e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_LIST);
+       else
+               action_mail_reply_all_cb(action, reader);
+}
+
+static void
 action_mail_reply_list_cb (GtkAction *action,
                            EMailReader *reader)
 {
@@ -1537,6 +1552,7 @@ static GtkActionEntry mail_reader_entries[] = {
          N_("Redirect (bounce) the selected message to someone"),
          G_CALLBACK (action_mail_redirect_cb) },
 
+       /* For the menu item and key shortcut */
        { "mail-reply-all",
          "mail-reply-all",
          N_("Reply to _All"),
@@ -1544,6 +1560,14 @@ static GtkActionEntry mail_reader_entries[] = {
          N_("Compose a reply to all the recipients of the selected message"),
          G_CALLBACK (action_mail_reply_all_cb) },
 
+       /* For the toolbar item (which can become 'Reply in Public') */
+       { "mail-reply-public",
+         "mail-reply-all",
+         N_("Reply to _All"),
+         NULL,
+         N_("Compose a reply to all the recipients of the selected message"),
+         G_CALLBACK (action_mail_reply_public_cb) },
+
        { "mail-reply-list",
          NULL,
          N_("Reply to _List"),
@@ -2236,6 +2260,7 @@ static void
 mail_reader_update_actions (EMailReader *reader,
                             guint32 state)
 {
+       GConfClient *gconf;
        EShell *shell;
        EShellBackend *shell_backend;
        EShellSettings *shell_settings;
@@ -2520,6 +2545,24 @@ mail_reader_update_actions (EMailReader *reader,
        action = e_mail_reader_get_action (reader, action_name);
        gtk_action_set_sensitive (action, sensitive);
 
+       action_name = "mail-reply-public";
+       sensitive = have_enabled_account && single_message_selected;
+       action = e_mail_reader_get_action (reader, action_name);
+       gtk_action_set_sensitive (action, sensitive);
+
+       gconf = mail_config_get_gconf_client ();
+       if (gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/reply_public", NULL)) {
+               g_object_set (action, "tooltip", 
+                             _("Compose a public reply to the message"),
+                             NULL);
+               gtk_action_set_short_label(action, _("Reply in _Public"));
+       } else {
+               g_object_set (action, "tooltip", 
+                             _("Compose a reply to all the recipients of the selected message"),
+                             NULL);
+               gtk_action_set_short_label(action, _("Reply to _All"));
+       }
+
        action_name = "mail-reply-list";
        sensitive = have_enabled_account && single_message_selected &&
                selection_is_mailing_list;
@@ -2781,6 +2824,10 @@ e_mail_reader_init (EMailReader *reader)
        action = e_mail_reader_get_action (reader, action_name);
        g_object_set (action, "is-important", TRUE, NULL);
 
+       action_name = "mail-reply-public";
+       action = e_mail_reader_get_action (reader, action_name);
+       g_object_set (action, "is-important", TRUE, NULL);
+
        action_name = "mail-reply-sender";
        action = e_mail_reader_get_action (reader, action_name);
        g_object_set (
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index 1dfb893..3ad87fe 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -60,6 +60,22 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/mail/composer/reply_public</key>
+      <applyto>/apps/evolution/mail/composer/reply_public</applyto>
+      <owner>evolution-mail</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>Reply in Public toolbar item</short>
+         <long>
+           Instead of the normal "Reply to All" button on the toolbar,
+           show a "Reply in Public" button which will reply to a mailing list
+           if possible, or otherwise will reply to all recipients as usual.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/evolution/mail/composer/reply_start_bottom</key>
       <applyto>/apps/evolution/mail/composer/reply_start_bottom</applyto>
       <owner>evolution-mail</owner>
diff --git a/ui/evolution-mail-reader.ui b/ui/evolution-mail-reader.ui
index ad0b401..9bf2223 100644
--- a/ui/evolution-mail-reader.ui
+++ b/ui/evolution-mail-reader.ui
@@ -111,7 +111,7 @@
   <toolbar name='main-toolbar'>
     <placeholder name='mail-toolbar-common'>
       <toolitem action='mail-reply-sender'/>
-      <toolitem action='mail-reply-all'/>
+      <toolitem action='mail-reply-public'/>
       <toolitem action='mail-forward'>
         <menu action='mail-forward-as-menu'>
           <menuitem action='mail-forward-attached-full'/>


-- 
dwmw2




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]