diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 07:54:45 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-11-10 06:33:19 +0800 |
commit | 4b88140cb6e3d7a82d2da878d3d3345c460be60a (patch) | |
tree | 96d4fe71a827d8dc084c15a84bcbfc12651c771c /modules/mail | |
parent | c1d818a53f552468e704cd51a066e8df12fd4ff1 (diff) | |
download | gsoc2013-evolution-4b88140cb6e3d7a82d2da878d3d3345c460be60a.tar.gz gsoc2013-evolution-4b88140cb6e3d7a82d2da878d3d3345c460be60a.tar.zst gsoc2013-evolution-4b88140cb6e3d7a82d2da878d3d3345c460be60a.zip |
Bug 633172 - Folder->Subscriptions is always enabled
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-shell-view.c | 19 |
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); |