diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-14 07:18:26 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-14 07:18:26 +0800 |
commit | 77a05d6576078fbd7495668bfa95b0a66d0c2fa5 (patch) | |
tree | 08229379e02502ded230a953e51f1d5dbbe59eea /addressbook | |
parent | d428935b383f96cc8c95fd345b8cc5c68c6fde8d (diff) | |
download | gsoc2013-evolution-77a05d6576078fbd7495668bfa95b0a66d0c2fa5.tar.gz gsoc2013-evolution-77a05d6576078fbd7495668bfa95b0a66d0c2fa5.tar.zst gsoc2013-evolution-77a05d6576078fbd7495668bfa95b0a66d0c2fa5.zip |
BugĀ 601769 - Print issues in address book
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 20 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.h | 1 |
2 files changed, 15 insertions, 6 deletions
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, |