diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-07-15 17:20:14 +0800 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-07-15 23:48:45 +0800 |
commit | 21b0925061702c0c2a6ee30819c739409bba39d2 (patch) | |
tree | 3c06d3ead698c7484c6505f8958d94fc3222f017 /mail/e-mail-reader.c | |
parent | ff8615ec0ad504b3fb81784747b82fca42ed1457 (diff) | |
download | gsoc2013-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/e-mail-reader.c')
-rw-r--r-- | mail/e-mail-reader.c | 54 |
1 files changed, 53 insertions, 1 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); |