From 77a05d6576078fbd7495668bfa95b0a66d0c2fa5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 13 Nov 2009 18:18:26 -0500 Subject: BugĀ 601769 - Print issues in address book MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addressbook/gui/widgets/e-addressbook-view.c | 20 ++++++++++++++------ addressbook/gui/widgets/e-addressbook-view.h | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index cfff4313bb..2cb8094ff1 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -944,6 +944,7 @@ e_contact_print_button (EPrintable *printable, GtkPrintOperationAction action) void e_addressbook_view_print (EAddressbookView *view, + gboolean selection_only, GtkPrintOperationAction action) { GalView *gal_view; @@ -954,12 +955,21 @@ e_addressbook_view_print (EAddressbookView *view, view_instance = e_addressbook_view_get_view_instance (view); gal_view = gal_view_instance_get_current_view (view_instance); - if (GAL_IS_VIEW_MINICARD (gal_view)) { + /* Print the selected contacts. */ + if (GAL_IS_VIEW_MINICARD (gal_view) && selection_only) { + GList *contact_list; + + contact_list = e_addressbook_view_get_selected (view); + e_contact_print (NULL, NULL, contact_list, action); + g_list_foreach (contact_list, (GFunc) g_object_unref, NULL); + g_list_free (contact_list); + + /* Print the latest query results. */ + } else if (GAL_IS_VIEW_MINICARD (gal_view)) { EAddressbookModel *model; EBook *book; EBookQuery *query; gchar *query_string; - GList *contact_list; model = e_addressbook_view_get_model (view); book = e_addressbook_model_get_book (model); @@ -971,14 +981,12 @@ e_addressbook_view_print (EAddressbookView *view, query = NULL; g_free (query_string); - contact_list = e_addressbook_view_get_selected (view); - e_contact_print (book, query, contact_list, action); - g_list_foreach (contact_list, (GFunc) g_object_unref, NULL); - g_list_free (contact_list); + e_contact_print (book, query, NULL, action); if (query != NULL) e_book_query_unref (query); + /* XXX Does this print the entire table or just selected? */ } else if (GAL_IS_VIEW_ETABLE (gal_view)) { EPrintable *printable; ETable *table; diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h index ca709ff347..28307ada64 100644 --- a/addressbook/gui/widgets/e-addressbook-view.h +++ b/addressbook/gui/widgets/e-addressbook-view.h @@ -99,6 +99,7 @@ EShellView * e_addressbook_view_get_shell_view ESource * e_addressbook_view_get_source (EAddressbookView *view); void e_addressbook_view_view (EAddressbookView *view); void e_addressbook_view_print (EAddressbookView *view, + gboolean selection_only, GtkPrintOperationAction action); void e_addressbook_view_delete_selection (EAddressbookView *view, -- cgit