aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/e-book-shell-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-12 09:54:07 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-12 09:54:07 +0800
commitdf6a8262a141e0bec824149e7f65568d2187c5c2 (patch)
tree463604008060e542f3dcdbfdd5fce4e056af8c1c /addressbook/gui/component/e-book-shell-view.c
parentcbe90f148abbfd273f301358c7fa73a58ff5dd41 (diff)
downloadgsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar.gz
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar.bz2
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar.lz
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar.xz
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.tar.zst
gsoc2013-evolution-df6a8262a141e0bec824149e7f65568d2187c5c2.zip
Arrange for an ESourceList to be shared amongst all instances of a type of
shell view. For example, all EBookShellView instances will now share the same ESourceList instance for address books. svn path=/branches/kill-bonobo/; revision=36311
Diffstat (limited to 'addressbook/gui/component/e-book-shell-view.c')
-rw-r--r--addressbook/gui/component/e-book-shell-view.c46
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;
+}