diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-10-25 07:02:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-10-25 07:02:33 +0800 |
commit | e7a31c5035a0afeed6c1675e30487c1e2bdc139f (patch) | |
tree | eb1e733a6fe69773498725efa64304a9234270bc /addressbook/gui/component/e-book-shell-sidebar.c | |
parent | 95cae9b166587d19db3aadde6a21cc12c30da6e6 (diff) | |
download | gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.gz gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.bz2 gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.lz gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.xz gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.zst gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.zip |
Commit recent work so I can merge from trunk.
svn path=/branches/kill-bonobo/; revision=36684
Diffstat (limited to 'addressbook/gui/component/e-book-shell-sidebar.c')
-rw-r--r-- | addressbook/gui/component/e-book-shell-sidebar.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/addressbook/gui/component/e-book-shell-sidebar.c b/addressbook/gui/component/e-book-shell-sidebar.c index 4f8d4454d1..266550f1e5 100644 --- a/addressbook/gui/component/e-book-shell-sidebar.c +++ b/addressbook/gui/component/e-book-shell-sidebar.c @@ -115,10 +115,41 @@ book_shell_sidebar_constructed (GObject *object) gtk_widget_show (widget); } +static guint32 +book_shell_sidebar_check_state (EShellSidebar *shell_sidebar) +{ + EBookShellSidebar *book_shell_sidebar; + ESourceSelector *selector; + ESource *source; + gboolean is_system = FALSE; + guint32 state = 0; + + priv = E_BOOK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); + + book_shell_sidebar = E_BOOK_SHELL_SIDEBAR (shell_sidebar); + selector = e_book_shell_sidebar_get_selector (book_shell_sidebar); + source = e_source_selector_peek_primary_selection (selector); + + if (source != NULL) { + const gchar *uri; + + uri = e_source_peek_relative_uri (source); + is_system = (uri == NULL || strcmp (uri, "system") == 0); + } + + if (source != NULL) + state |= E_BOOK_SHELL_SIDEBAR_HAS_PRIMARY_SOURCE; + if (is_system) + state |= E_BOOK_SHELL_SIDEBAR_PRIMARY_SOURCE_IS_SYSTEM; + + return state; +} + static void book_shell_sidebar_class_init (EBookShellSidebarClass *class) { GObjectClass *object_class; + EShellSidebarClass *shell_sidebar_class; parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EBookShellSidebarPrivate)); @@ -128,6 +159,9 @@ book_shell_sidebar_class_init (EBookShellSidebarClass *class) object_class->dispose = book_shell_sidebar_dispose; object_class->constructed = book_shell_sidebar_constructed; + shell_sidebar_class = E_SHELL_SIDEBAR_CLASS (class); + shell_sidebar_class->check_state = book_shell_sidebar_check_state; + g_object_class_install_property ( object_class, PROP_SELECTOR, |