aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-21 06:33:11 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:42:17 +0800
commitb1e34279d9a7f2e453fa3bbfd93856866aa4f5e4 (patch)
tree52ff8c870dd0025218d5b8803c6c4ef0560900d3 /mail/e-mail-reader.c
parent6fb8b27d3d847ab42aa5247a0a924912e1d4a2dd (diff)
downloadgsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar.gz
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar.bz2
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar.lz
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar.xz
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.tar.zst
gsoc2013-evolution-b1e34279d9a7f2e453fa3bbfd93856866aa4f5e4.zip
Bug 650587 - Hide Search Folder actions when Search Folders are disabled
Add an action group for Search Folders to EMailReader. The action group's visibility is bound to the "mail-enable-search-folders" setting, so that menu items related to Search Folders are hidden when Search Folders are disabled in GConf. Affected menu items are: Edit -> Search Folders Message -> Create Rule -> Search Folder from Subject... Message -> Create Rule -> Search Folder from Sender... Message -> Create Rule -> Search Folder from Recipients... Message -> Create Rule -> Search Folder from Mailing List... Search -> Create Search Folder From Search...
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c84
1 files changed, 47 insertions, 37 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 1697db9ab3..bbbcfabae1 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2108,34 +2108,6 @@ static GtkActionEntry mail_reader_entries[] = {
N_("Save selected messages as an mbox file"),
G_CALLBACK (action_mail_save_as_cb) },
- { "mail-search-folder-from-mailing-list",
- NULL,
- N_("Search Folder from Mailing _List..."),
- NULL,
- N_("Create a search folder for this mailing list"),
- G_CALLBACK (action_mail_search_folder_from_mailing_list_cb) },
-
- { "mail-search-folder-from-recipients",
- NULL,
- N_("Search Folder from Recipien_ts..."),
- NULL,
- N_("Create a search folder for these recipients"),
- G_CALLBACK (action_mail_search_folder_from_recipients_cb) },
-
- { "mail-search-folder-from-sender",
- NULL,
- N_("Search Folder from Sen_der..."),
- NULL,
- N_("Create a search folder for this sender"),
- G_CALLBACK (action_mail_search_folder_from_sender_cb) },
-
- { "mail-search-folder-from-subject",
- NULL,
- N_("Search Folder from S_ubject..."),
- NULL,
- N_("Create a search folder for this subject"),
- G_CALLBACK (action_mail_search_folder_from_subject_cb) },
-
{ "mail-show-source",
NULL,
N_("_Message Source"),
@@ -2237,6 +2209,37 @@ static GtkActionEntry mail_reader_entries[] = {
NULL }
};
+static GtkActionEntry mail_reader_search_folder_entries[] = {
+
+ { "mail-search-folder-from-mailing-list",
+ NULL,
+ N_("Search Folder from Mailing _List..."),
+ NULL,
+ N_("Create a search folder for this mailing list"),
+ G_CALLBACK (action_mail_search_folder_from_mailing_list_cb) },
+
+ { "mail-search-folder-from-recipients",
+ NULL,
+ N_("Search Folder from Recipien_ts..."),
+ NULL,
+ N_("Create a search folder for these recipients"),
+ G_CALLBACK (action_mail_search_folder_from_recipients_cb) },
+
+ { "mail-search-folder-from-sender",
+ NULL,
+ N_("Search Folder from Sen_der..."),
+ NULL,
+ N_("Create a search folder for this sender"),
+ G_CALLBACK (action_mail_search_folder_from_sender_cb) },
+
+ { "mail-search-folder-from-subject",
+ NULL,
+ N_("Search Folder from S_ubject..."),
+ NULL,
+ N_("Create a search folder for this subject"),
+ G_CALLBACK (action_mail_search_folder_from_subject_cb) },
+};
+
static EPopupActionEntry mail_reader_popup_entries[] = {
{ "mail-popup-copy",
@@ -3200,15 +3203,12 @@ mail_reader_update_actions (EMailReader *reader,
}
static void
-mail_reader_init_charset_actions (EMailReader *reader)
+mail_reader_init_charset_actions (EMailReader *reader,
+ GtkActionGroup *action_group)
{
- GtkActionGroup *action_group;
GtkRadioAction *default_action;
GSList *radio_group;
- action_group = e_mail_reader_get_action_group (
- reader, E_MAIL_READER_ACTION_GROUP_STANDARD);
-
radio_group = e_charset_add_radio_actions (
action_group, "mail-charset-", NULL,
G_CALLBACK (action_mail_charset_cb), reader);
@@ -3383,6 +3383,8 @@ e_mail_reader_init (EMailReader *reader,
if (!init_actions)
goto connect_signals;
+ /* Add the "standard" EMailReader actions. */
+
action_group = e_mail_reader_get_action_group (
reader, E_MAIL_READER_ACTION_GROUP_STANDARD);
@@ -3403,7 +3405,7 @@ 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 */
+ /* Likewise the "mail-reply-group" action. */
/* For Translators: "Group Reply" will reply either to a mailing list
(if possible and if that configuration option is enabled), or else
@@ -3424,8 +3426,6 @@ e_mail_reader_init (EMailReader *reader,
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);
gtk_action_group_add_actions (
action_group, mail_reader_entries,
G_N_ELEMENTS (mail_reader_entries), reader);
@@ -3436,7 +3436,17 @@ e_mail_reader_init (EMailReader *reader,
action_group, mail_reader_toggle_entries,
G_N_ELEMENTS (mail_reader_toggle_entries), reader);
- mail_reader_init_charset_actions (reader);
+ mail_reader_init_charset_actions (reader, action_group);
+
+ /* Add EMailReader actions for Search Folders. The action group
+ * should be made invisible if Search Folders are disabled. */
+
+ action_group = e_mail_reader_get_action_group (
+ reader, E_MAIL_READER_ACTION_GROUP_SEARCH_FOLDERS);
+
+ gtk_action_group_add_actions (
+ action_group, mail_reader_search_folder_entries,
+ G_N_ELEMENTS (mail_reader_search_folder_entries), reader);
/* Bind GObject properties to GConf keys. */