diff options
Diffstat (limited to 'addressbook/gui/component/e-book-shell-view.c')
-rw-r--r-- | addressbook/gui/component/e-book-shell-view.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c index 4c06cc5fba..ce0c8f2b55 100644 --- a/addressbook/gui/component/e-book-shell-view.c +++ b/addressbook/gui/component/e-book-shell-view.c @@ -20,6 +20,11 @@ #include "e-book-shell-view-private.h" +enum { + PROP_0, + PROP_SOURCE_LIST +}; + GType e_book_shell_view_type = 0; static gpointer parent_class; @@ -151,6 +156,23 @@ book_shell_view_source_list_changed_cb (EBookShellView *book_shell_view, } static void +book_shell_view_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_SOURCE_LIST: + g_value_set_object ( + value, e_book_shell_view_get_source_list ( + E_BOOK_SHELL_VIEW (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void book_shell_view_dispose (GObject *object) { e_book_shell_view_private_dispose (E_BOOK_SHELL_VIEW (object)); @@ -217,6 +239,7 @@ book_shell_view_class_init (EBookShellViewClass *class, g_type_class_add_private (class, sizeof (EBookShellViewPrivate)); object_class = G_OBJECT_CLASS (class); + object_class->get_property = book_shell_view_get_property; object_class->dispose = book_shell_view_dispose; object_class->finalize = book_shell_view_finalize; object_class->constructed = book_shell_view_constructed; @@ -226,15 +249,26 @@ book_shell_view_class_init (EBookShellViewClass *class, shell_view_class->icon_name = "x-office-address-book"; shell_view_class->type_module = type_module; shell_view_class->changed = book_shell_view_changed; + + g_object_class_install_property ( + object_class, + PROP_SOURCE_LIST, + g_param_spec_object ( + "source-list", + _("Source List"), + _("The registry of address books"), + E_TYPE_SOURCE_LIST, + G_PARAM_READABLE)); } static void -book_shell_view_init (EBookShellView *book_shell_view) +book_shell_view_init (EBookShellView *book_shell_view, + EShellViewClass *shell_view_class) { book_shell_view->priv = E_BOOK_SHELL_VIEW_GET_PRIVATE (book_shell_view); - e_book_shell_view_private_init (book_shell_view); + e_book_shell_view_private_init (book_shell_view, shell_view_class); g_signal_connect_swapped ( book_shell_view->priv->source_list, "changed", @@ -267,3 +301,11 @@ e_book_shell_view_get_type (GTypeModule *type_module) return e_book_shell_view_type; } + +ESourceList * +e_book_shell_view_get_source_list (EBookShellView *book_shell_view) +{ + g_return_val_if_fail (E_IS_BOOK_SHELL_VIEW (book_shell_view), NULL); + + return book_shell_view->priv->source_list; +} |