From b6485f13c4dcc1c5dc9b6a7c8c3d8931d06da90e Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 23 May 2000 23:42:40 +0000 Subject: Switched printing and gui. 2000-05-23 Christopher James Lahey * Makefile.am: Switched printing and gui. * backend/ebook/e-book-view-listener.h, backend/ebook/e-book-view.h, backend/ebook/e-book.h, backend/ebook/e-card-cursor.h, backend/ebook/e-card-list.h, backend/ebook/e-card-simple.h, backend/ebook/e-card.h: Fixed the #defines to work elsewhere in evolution. * gui/component/Makefile.am: Added linking to libecontactprint. * gui/component/addressbook.c: Added a menu item to print the current query. * printing/Makefile.am: Add linking to libebook and requirements. Add installation of ecps files. * printing/e-contact-print.c, printing/e-contact-print.h: Changed this to use real data from an EBook. * printing/test-print.c: Made this pass NULL, NULL to e_contact_print_dialog_new so that it will compile. svn path=/trunk/; revision=3188 --- addressbook/gui/component/Makefile.am | 5 ++--- addressbook/gui/component/addressbook.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 9df1ad065d..1a1752ea07 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -41,7 +41,8 @@ evolution_addressbook_LDADD = \ $(top_builddir)/libversit/libversit.la \ $(top_builddir)/widgets/e-text/libetext.a \ $(top_builddir)/widgets/e-table/libetable.a \ - $(top_builddir)/e-util/libeutil.la + $(top_builddir)/e-util/libeutil.la \ + $(top_builddir)/addressbook/printing/libecontactprint.a evolution_addressbook_LDFLAGS = `gnome-config --libs gdk_pixbuf` @@ -71,5 +72,3 @@ evolution-addressbook.pure: evolution-addressbook $(PLINK) $(evolution_addressbook_LDFLAGS) $(evolution_addressbook_OBJECTS) $(evolution_addressbook_LDADD) $(LIBS) endif - - diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index f54738fcb9..af57378d5b 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -28,6 +28,8 @@ #include "e-contact-editor.h" #include "e-ldap-server-dialog.h" +#include + #ifdef USING_OAF #define CONTROL_FACTORY_ID "OAFIID:control-factory:addressbook:3e10597b-0591-4d45-b082-d781b7aa6e17" #else @@ -67,6 +69,7 @@ static void control_deactivate (BonoboControl *control, BonoboUIHandler *uih) { /* how to remove a menu item */ + bonobo_ui_handler_menu_remove (uih, "/File/Print"); bonobo_ui_handler_menu_remove (uih, "/View/"); bonobo_ui_handler_menu_remove (uih, "/View/Toggle View"); bonobo_ui_handler_menu_remove (uih, "/Actions/New Contact"); @@ -283,6 +286,16 @@ delete_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path) e_minicard_view_remove_selection (E_MINICARD_VIEW(view->view), card_deleted_cb, NULL); } +static void +print_cb (BonoboUIHandler *uih, void *user_data, const char *path) +{ + AddressbookView *view = (AddressbookView *) user_data; + char *query = get_query(view); + GtkWidget *print = e_contact_print_dialog_new(view->book, query); + g_free(query); + gtk_widget_show_all(print); +} + static GnomeUIInfo gnome_toolbar [] = { GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW), @@ -355,6 +368,13 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih, bonobo_ui_handler_menu_new_separator (uih, "/View/", -1); + bonobo_ui_handler_menu_new_item (uih, "/File/Print", + N_("Print"), + NULL, -1, + BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, + 0, 0, print_cb, + (gpointer) view); + bonobo_ui_handler_menu_new_item (uih, "/View/Toggle View", N_("As _Table"), NULL, -1, -- cgit v1.2.3