aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/component/addressbook.c6
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c33
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h12
4 files changed, 51 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 237bd9281a..47592a7a98 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2000-12-06 Christopher James Lahey <clahey@helixcode.com>
+
+ * gui/component/addressbook.c: Moved the gal view menu stuff from
+ here to EAddressbookView.
+
+ * gui/widgets/e-addressbook-view.c,
+ gui/widgets/e-addressbook-view.h: New function to set up the menus
+ for the EAddressbookView.
+
2000-12-06 JP Rosevear <jpr@helixcode.com>
* conduit/Makefile.am: Another conduit build fix
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index c57a721249..0392caf3b6 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -19,7 +19,6 @@
#include <ebook/e-book.h>
#include <gal/util/e-util.h>
#include <gal/widgets/e-unicode.h>
-#include "widgets/menus/gal-view-menus.h"
#include "addressbook/gui/search/e-addressbook-search-dialog.h"
#include "addressbook/gui/widgets/e-addressbook-view.h"
@@ -321,7 +320,6 @@ control_activate (BonoboControl *control,
AddressbookView *view)
{
Bonobo_UIContainer remote_ui_container;
- GalViewMenus *views;
remote_ui_container = bonobo_control_get_remote_ui_container (control);
bonobo_ui_component_set_container (uic, remote_ui_container);
@@ -341,9 +339,7 @@ control_activate (BonoboControl *control,
"evolution-addressbook");
#endif
- views = gal_view_menus_new();
- gal_view_menus_apply(views, uic, NULL);
- gtk_object_unref(GTK_OBJECT(views));
+ e_addressbook_view_setup_menus (view->view, uic);
update_view_type (view);
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index d0d6984faf..2eab704e37 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -29,6 +29,8 @@
#include <gal/e-table/e-table-model.h>
#include <gal/widgets/e-scroll-frame.h>
#include <gal/widgets/e-popup-menu.h>
+#include "widgets/menus/gal-view-menus.h"
+#include <gal/menus/gal-view-factory-etable.h>
#include "e-addressbook-model.h"
@@ -673,6 +675,37 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data)
}
void
+e_addressbook_view_setup_menus (EAddressbookView *view,
+ BonoboUIComponent *uic)
+{
+ GalViewCollection *collection;
+ GalViewMenus *views;
+ GalViewFactory *factory;
+ ETableSpecification *spec;
+
+ collection = gal_view_collection_new();
+
+ spec = e_table_specification_new();
+ e_table_specification_load_from_string(spec, SPEC);
+
+ factory = gal_view_factory_etable_new(spec);
+ gal_view_collection_add_factory(collection, factory);
+ gtk_object_sink(GTK_OBJECT(factory));
+
+#if 0
+ factory = e_minicard_view_factory_new();
+ gal_view_collection_add_factory(collection, factory);
+ gtk_object_sink(GTK_OBJECT(factory));
+#endif
+
+ views = gal_view_menus_new(collection);
+ gal_view_menus_apply(views, uic, NULL);
+ gtk_object_sink(GTK_OBJECT(views));
+
+ gtk_object_sink(GTK_OBJECT(collection));
+}
+
+void
e_addressbook_view_print(EAddressbookView *view)
{
if (view->view_type == E_ADDRESSBOOK_VIEW_MINICARD) {
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
index 60da283a75..28c70798fc 100644
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ b/addressbook/gui/widgets/e-addressbook-view.h
@@ -22,6 +22,7 @@
#define __E_ADDRESSBOOK_VIEW_H__
#include <gnome.h>
+#include <bonobo.h>
#include "addressbook/backend/ebook/e-book.h"
#ifdef __cplusplus
@@ -77,10 +78,13 @@ struct _EAddressbookViewClass
GtkWidget *e_addressbook_view_new (void);
GtkType e_addressbook_view_get_type (void);
-void e_addressbook_view_print (EAddressbookView *view);
-void e_addressbook_view_delete_selection (EAddressbookView *view);
-void e_addressbook_view_show_all (EAddressbookView *view);
-void e_addressbook_view_stop (EAddressbookView *view);
+void e_addressbook_view_setup_menus (EAddressbookView *view,
+ BonoboUIComponent *uic);
+
+void e_addressbook_view_print (EAddressbookView *view);
+void e_addressbook_view_delete_selection (EAddressbookView *view);
+void e_addressbook_view_show_all (EAddressbookView *view);
+void e_addressbook_view_stop (EAddressbookView *view);
#ifdef __cplusplus
}