diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 07:54:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-10-30 07:54:45 +0800 |
commit | 43814fe77518e97c6b9c9ecb1d499dc3eb323296 (patch) | |
tree | a3353a6405accaa23473ce3893359d180c7a6880 /modules/mail | |
parent | 83627486d54d307e7bf80885757247880eab1d26 (diff) | |
download | gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar.gz gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar.bz2 gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar.lz gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar.xz gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.tar.zst gsoc2013-evolution-43814fe77518e97c6b9c9ecb1d499dc3eb323296.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); |