aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook/e-book-shell-sidebar.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-07-01 21:53:06 +0800
committerMilan Crha <mcrha@redhat.com>2013-07-01 21:53:06 +0800
commitbe217ae4c574b82a8ecbc7dbb506aca36f6e56fa (patch)
tree96d4039d8990188fc25417898de3400669d8a4f1 /modules/addressbook/e-book-shell-sidebar.c
parent870bd532b542e49fa80f799c919d80b1728b6967 (diff)
downloadgsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar.gz
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar.bz2
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar.lz
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar.xz
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.tar.zst
gsoc2013-evolution-be217ae4c574b82a8ecbc7dbb506aca36f6e56fa.zip
Contacts view: Add 'Refresh' into books context menu
Done as part of bug #700894
Diffstat (limited to 'modules/addressbook/e-book-shell-sidebar.c')
-rw-r--r--modules/addressbook/e-book-shell-sidebar.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c
index 9c655e7504..b29bd9a08f 100644
--- a/modules/addressbook/e-book-shell-sidebar.c
+++ b/modules/addressbook/e-book-shell-sidebar.c
@@ -194,6 +194,7 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
gboolean is_remote_deletable = FALSE;
gboolean in_collection = FALSE;
gboolean has_primary_source = FALSE;
+ gboolean refresh_supported = FALSE;
guint32 state = 0;
book_shell_sidebar = E_BOOK_SHELL_SIDEBAR (shell_sidebar);
@@ -202,6 +203,7 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
registry = e_source_selector_get_registry (selector);
if (source != NULL) {
+ EClient *client;
ESource *collection;
has_primary_source = TRUE;
@@ -217,6 +219,15 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
g_object_unref (collection);
}
+ client = e_client_selector_ref_cached_client (
+ E_CLIENT_SELECTOR (selector), source);
+
+ if (client != NULL) {
+ refresh_supported =
+ e_client_check_refresh_supported (client);
+ g_object_unref (client);
+ }
+
g_object_unref (source);
}
@@ -232,6 +243,8 @@ book_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
state |= E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_REMOTE_DELETABLE;
if (in_collection)
state |= E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IN_COLLECTION;
+ if (refresh_supported)
+ state |= E_BOOK_SHELL_SIDEBAR_SOURCE_SUPPORTS_REFRESH;
return state;
}