diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-10-28 16:45:06 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-10-28 16:45:06 +0800 |
commit | f43bc7ed11621ab41bbae861c81d4ddb8b5bb0ab (patch) | |
tree | d9df6864d5ca1d7ec1d900129980b79d51c5b676 /mail | |
parent | 0d2d45cf9ed4f66b2bda719985c9cf9c3ad2c3d1 (diff) | |
download | gsoc2013-evolution-f43bc7ed11621ab41bbae861c81d4ddb8b5bb0ab.tar.gz gsoc2013-evolution-f43bc7ed11621ab41bbae861c81d4ddb8b5bb0ab.tar.zst gsoc2013-evolution-f43bc7ed11621ab41bbae861c81d4ddb8b5bb0ab.zip |
Add a menu to the Forward toolbar button.
Allows users to choose different mail forwarding methods without
navigating the main menu. Suggested by Ng Oon-Ee on evolution-list.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-reader.c | 62 |
1 files changed, 55 insertions, 7 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index c60054b266..a81352ce12 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -36,6 +36,7 @@ #include "e-util/gconf-bridge.h" #include "shell/e-shell.h" #include "widgets/misc/e-popup-action.h" +#include "widgets/misc/e-menu-tool-action.h" #include "mail/e-mail-browser.h" #include "mail/e-mail-display.h" @@ -1175,13 +1176,6 @@ static GtkActionEntry mail_reader_entries[] = { N_("Flag the selected messages for follow-up"), G_CALLBACK (action_mail_flag_for_followup_cb) }, - { "mail-forward", - "mail-forward", - N_("_Forward"), - "<Control>f", - N_("Forward the selected message to someone"), - G_CALLBACK (action_mail_forward_cb) }, - { "mail-forward-attached", NULL, N_("_Attached"), @@ -1189,6 +1183,13 @@ static GtkActionEntry mail_reader_entries[] = { N_("Forward the selected message to someone as an attachment"), G_CALLBACK (action_mail_forward_attached_cb) }, + { "mail-forward-attached-full", + NULL, + N_("Forward As _Attached"), + NULL, + N_("Forward the selected message to someone as an attachment"), + G_CALLBACK (action_mail_forward_attached_cb) }, + { "mail-forward-inline", NULL, N_("_Inline"), @@ -1196,6 +1197,13 @@ static GtkActionEntry mail_reader_entries[] = { N_("Forward the selected message in the body of a new message"), G_CALLBACK (action_mail_forward_inline_cb) }, + { "mail-forward-inline-full", + NULL, + N_("Forward As _Inline"), + NULL, + N_("Forward the selected message in the body of a new message"), + G_CALLBACK (action_mail_forward_inline_cb) }, + { "mail-forward-quoted", NULL, N_("_Quoted"), @@ -1203,6 +1211,13 @@ static GtkActionEntry mail_reader_entries[] = { N_("Forward the selected message quoted like a reply"), G_CALLBACK (action_mail_forward_quoted_cb) }, + { "mail-forward-quoted-full", + NULL, + N_("Forward As _Quoted"), + NULL, + N_("Forward the selected message quoted like a reply"), + G_CALLBACK (action_mail_forward_quoted_cb) }, + { "mail-load-images", "image-x-generic", N_("_Load Images"), @@ -2049,16 +2064,31 @@ mail_reader_update_actions (EMailReader *reader) action = e_mail_reader_get_action (reader, action_name); gtk_action_set_sensitive (action, sensitive); + action_name = "mail-forward-attached-full"; + sensitive = have_an_account && any_messages_selected; + action = e_mail_reader_get_action (reader, action_name); + gtk_action_set_sensitive (action, sensitive); + action_name = "mail-forward-inline"; sensitive = have_an_account && single_message_selected; action = e_mail_reader_get_action (reader, action_name); gtk_action_set_sensitive (action, sensitive); + action_name = "mail-forward-inline-full"; + sensitive = have_an_account && single_message_selected; + action = e_mail_reader_get_action (reader, action_name); + gtk_action_set_sensitive (action, sensitive); + action_name = "mail-forward-quoted"; sensitive = have_an_account && single_message_selected; action = e_mail_reader_get_action (reader, action_name); gtk_action_set_sensitive (action, sensitive); + action_name = "mail-forward-quoted-full"; + sensitive = have_an_account && single_message_selected; + action = e_mail_reader_get_action (reader, action_name); + gtk_action_set_sensitive (action, sensitive); + action_name = "mail-load-images"; sensitive = single_message_selected; action = e_mail_reader_get_action (reader, action_name); @@ -2312,6 +2342,7 @@ e_mail_reader_init (EMailReader *reader) EShellBackend *shell_backend; EShellSettings *shell_settings; EMFormatHTMLDisplay *html_display; + EMenuToolAction *menu_tool_action; EWebView *web_view; GtkActionGroup *action_group; MessageList *message_list; @@ -2344,6 +2375,23 @@ e_mail_reader_init (EMailReader *reader) mail_reader_init_charset_actions (reader); + /* The "mail-forward" action is special: it uses a GtkMenuToolButton + * for its toolbar item type. So we have to create it separately. */ + + menu_tool_action = e_menu_tool_action_new ( + "mail-forward", _("_Forward"), + _("Forward the selected message to someone"), NULL); + + gtk_action_set_icon_name ( + GTK_ACTION (menu_tool_action), "mail-forward"); + + g_signal_connect ( + menu_tool_action, "activate", + G_CALLBACK (action_mail_forward_cb), reader); + + gtk_action_group_add_action_with_accel ( + action_group, GTK_ACTION (menu_tool_action), "<Control>f"); + /* Bind GObject properties to GConf keys. */ bridge = gconf_bridge_get (); |