aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-view.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 8d5a568b8f..0484a56bbe 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -834,13 +834,17 @@ mail_shell_view_update_actions (EShellView *shell_view)
EMailShellView *mail_shell_view;
EMailShellContent *mail_shell_content;
EMailShellSidebar *mail_shell_sidebar;
+ EShellBackend *shell_backend;
EShellSidebar *shell_sidebar;
EShellWindow *shell_window;
EMFolderTree *folder_tree;
EMailReader *reader;
+ EMailBackend *backend;
+ EMailSession *session;
EMailView *mail_view;
EAccount *account = NULL;
GtkAction *action;
+ GList *list;
const gchar *label;
gchar *uri;
gboolean sensitive;
@@ -856,7 +860,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
gboolean folder_has_unread_rec = FALSE;
gboolean folder_tree_and_message_list_agree = TRUE;
gboolean store_supports_subscriptions;
- gboolean have_enabled_account;
+ gboolean any_account_supports_subscriptions;
/* Chain up to parent's update_actions() method. */
E_SHELL_VIEW_CLASS (parent_class)->update_actions (shell_view);
@@ -864,17 +868,18 @@ mail_shell_view_update_actions (EShellView *shell_view)
mail_shell_view = E_MAIL_SHELL_VIEW (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
mail_shell_content = mail_shell_view->priv->mail_shell_content;
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
+ backend = E_MAIL_BACKEND (shell_backend);
+ session = e_mail_backend_get_session (backend);
+
reader = E_MAIL_READER (mail_view);
state = e_mail_reader_check_state (reader);
e_mail_reader_update_actions (reader, state);
- have_enabled_account =
- (state & E_MAIL_READER_HAVE_ENABLED_ACCOUNT);
-
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
@@ -937,6 +942,10 @@ mail_shell_view_update_actions (EShellView *shell_view)
g_free (uri);
}
+ list = e_get_subscribable_accounts (CAMEL_SESSION (session));
+ any_account_supports_subscriptions = (g_list_length (list) > 0);
+ g_list_free (list);
+
action = ACTION (MAIL_ACCOUNT_DISABLE);
sensitive = (account != NULL) && folder_is_store;
if (account_is_groupwise)
@@ -1007,7 +1016,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
gtk_action_set_sensitive (action, sensitive);
action = ACTION (MAIL_TOOLS_SUBSCRIPTIONS);
- sensitive = have_enabled_account;
+ sensitive = any_account_supports_subscriptions;
gtk_action_set_sensitive (action, sensitive);
e_mail_shell_view_update_popup_labels (mail_shell_view);