From c7e8d6e6a473a3846e5b737d47c529e44c3ae7fd Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 25 Jan 2001 16:17:33 +0000 Subject: Setup the view collection properly and handle the "display_view" signal. 2001-01-25 Christopher James Lahey * gui/widgets/e-addressbook-view.c (e_addressbook_view_setup_menus): Setup the view collection properly and handle the "display_view" signal. svn path=/trunk/; revision=7810 --- addressbook/gui/widgets/e-addressbook-view.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index f52d2e43c2..cde705427a 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -782,6 +782,14 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) } } +static void +display_view(GalViewCollection *collection, + GalView *view, + gpointer data) +{ + g_print ("title: %s\n", gal_view_get_title(view)); +} + void e_addressbook_view_setup_menus (EAddressbookView *view, BonoboUIComponent *uic) @@ -792,6 +800,10 @@ e_addressbook_view_setup_menus (EAddressbookView *view, ETableSpecification *spec; collection = gal_view_collection_new(); + /* FIXME: Memory leak. */ + gal_view_collection_set_storage_directories(collection, + gnome_util_prepend_user_home("/evolution/system/"), + gnome_util_prepend_user_home("/evolution/galview/")); spec = e_table_specification_new(); e_table_specification_load_from_string(spec, SPEC); @@ -800,6 +812,8 @@ e_addressbook_view_setup_menus (EAddressbookView *view, gal_view_collection_add_factory(collection, factory); gtk_object_sink(GTK_OBJECT(factory)); + gal_view_collection_load(collection); + #if 0 factory = e_minicard_view_factory_new(); gal_view_collection_add_factory(collection, factory); @@ -807,8 +821,10 @@ e_addressbook_view_setup_menus (EAddressbookView *view, #endif views = gal_view_menus_new(collection); - gal_view_menus_apply(views, uic, NULL); - gtk_object_sink(GTK_OBJECT(views)); + gal_view_menus_apply(views, uic, NULL); /* This function probably needs to sink the views object. */ + gtk_signal_connect(GTK_OBJECT(collection), "display_view", + display_view, NULL); + /* gtk_object_sink(GTK_OBJECT(views)); */ gtk_object_sink(GTK_OBJECT(collection)); } -- cgit v1.2.3