aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-07-15 17:20:14 +0800
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-07-15 23:48:45 +0800
commit21b0925061702c0c2a6ee30819c739409bba39d2 (patch)
tree3c06d3ead698c7484c6505f8958d94fc3222f017 /mail
parentff8615ec0ad504b3fb81784747b82fca42ed1457 (diff)
downloadgsoc2013-evolution-21b0925061702c0c2a6ee30819c739409bba39d2.tar.gz
gsoc2013-evolution-21b0925061702c0c2a6ee30819c739409bba39d2.tar.zst
gsoc2013-evolution-21b0925061702c0c2a6ee30819c739409bba39d2.zip
Change 'Reply to All' toolbar button into configurable 'Group Reply'
...with a dropdown menu like the Forward button, and configuration for whether it tries to do 'Reply to List' by default.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader.c54
-rw-r--r--mail/evolution-mail.schemas.in17
-rw-r--r--mail/mail-config.ui19
3 files changed, 87 insertions, 3 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 7e3ac3950e..9a6d5cb3ea 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_group_cb (GtkAction *action,
+ EMailReader *reader)
+{
+ GConfClient *gconf = mail_config_get_gconf_client ();
+ gboolean reply_list = gconf_client_get_bool (gconf,
+ "/apps/evolution/mail/composer/group_reply_to_list", NULL);
+ guint32 state = e_mail_reader_check_state (reader);
+
+ if (reply_list && (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)
{
@@ -1586,7 +1601,7 @@ static GtkActionEntry mail_reader_entries[] = {
G_CALLBACK (action_mail_redirect_cb) },
{ "mail-reply-all",
- "mail-reply-all",
+ NULL,
N_("Reply to _All"),
"<Shift><Control>r",
N_("Compose a reply to all the recipients of the selected message"),
@@ -1706,6 +1721,13 @@ static GtkActionEntry mail_reader_entries[] = {
NULL,
NULL },
+ { "mail-reply-group-menu",
+ NULL,
+ N_("_Group Reply"),
+ NULL,
+ NULL,
+ NULL },
+
{ "mail-goto-menu",
GTK_STOCK_JUMP_TO,
N_("_Go To"),
@@ -2568,6 +2590,16 @@ 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-group";
+ sensitive = have_enabled_account && single_message_selected;
+ action = e_mail_reader_get_action (reader, action_name);
+ gtk_action_set_sensitive (action, sensitive);
+
+ action_name = "mail-reply-group-menu";
+ sensitive = have_enabled_account && any_messages_selected;
+ action = e_mail_reader_get_action (reader, action_name);
+ gtk_action_set_sensitive (action, sensitive);
+
action_name = "mail-reply-list";
sensitive = have_enabled_account && single_message_selected &&
selection_is_mailing_list;
@@ -2778,6 +2810,22 @@ e_mail_reader_init (EMailReader *reader)
gtk_action_group_add_action_with_accel (
action_group, GTK_ACTION (menu_tool_action), "<Control>f");
+ /* Likewise the "mail-reply-group" action */
+
+ menu_tool_action = e_menu_tool_action_new (
+ "mail-reply-group", _("Group Reply"),
+ _("Reply to the mailing list, or to all recipients"), NULL);
+
+ gtk_action_set_icon_name (
+ GTK_ACTION (menu_tool_action), "mail-reply-all");
+
+ g_signal_connect (
+ menu_tool_action, "activate",
+ G_CALLBACK (action_mail_reply_group_cb), reader);
+
+ gtk_action_group_add_action_with_accel (
+ action_group, GTK_ACTION (menu_tool_action), "<Control>g");
+
/* Add the other actions the normal way. */
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
@@ -2817,6 +2865,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-group";
+ action = e_mail_reader_get_action (reader, action_name);
+ g_object_set (action, "is-important", TRUE, NULL);
+
action_name = "mail-next";
action = e_mail_reader_get_action (reader, action_name);
g_object_set (action, "short-label", _("Next"), NULL);
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index aa63695f2b..de4f4daa8f 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -60,6 +60,23 @@
</schema>
<schema>
+ <key>/schemas/apps/evolution/mail/composer/group_reply_to_list</key>
+ <applyto>/apps/evolution/mail/composer/group_reply_to_list</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Group Reply replies to list</short>
+ <long>
+ Instead of the normal "Reply to All" behaviour, this option will
+ make the 'Group Reply' toolbar button try to reply only to the
+ mailing list through which you happened to receive the copy of
+ the message to which you're replying.
+ </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/mail/mail-config.ui b/mail/mail-config.ui
index a5110ee9b8..8603940dcd 100644
--- a/mail/mail-config.ui
+++ b/mail/mail-config.ui
@@ -4530,6 +4530,21 @@ For example: "Work" or "Personal"</property>
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="chkGroupReplyToList">
+ <property name="label" translatable="yes">Group Reply goes only to mailing list, if possible</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">6</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkTable" id="tableForwardsReplies">
<property name="visible">True</property>
<property name="n_rows">3</property>
@@ -4657,7 +4672,7 @@ For example: "Work" or "Personal"</property>
</child>
</object>
<packing>
- <property name="position">6</property>
+ <property name="position">7</property>
</packing>
</child>
<child>
@@ -4733,7 +4748,7 @@ For example: "Work" or "Personal"</property>
</child>
</object>
<packing>
- <property name="position">7</property>
+ <property name="position">8</property>
</packing>
</child>
</object>