diff options
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r-- | addressbook/gui/component/Makefile.am | 5 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook.c | 20 |
2 files changed, 22 insertions, 3 deletions
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 <addressbook/printing/e-contact-print.h> + #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/<sep>"); 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/<sep>", -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, |