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 /modules | |
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 'modules')
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.c | 67 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.h | 6 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view.c | 12 |
3 files changed, 57 insertions, 28 deletions
diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 495aed6f1d..41b88efbc6 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -130,6 +130,38 @@ action_address_book_new_cb (GtkAction *action, } static void +action_address_book_print_cb (GtkAction *action, + EBookShellView *book_shell_view) +{ + EBookShellContent *book_shell_content; + EAddressbookView *view; + GtkPrintOperationAction print_action; + + book_shell_content = book_shell_view->priv->book_shell_content; + view = e_book_shell_content_get_current_view (book_shell_content); + g_return_if_fail (view != NULL); + + print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; + e_addressbook_view_print (view, FALSE, print_action); +} + +static void +action_address_book_print_preview_cb (GtkAction *action, + EBookShellView *book_shell_view) +{ + EBookShellContent *book_shell_content; + EAddressbookView *view; + GtkPrintOperationAction print_action; + + book_shell_content = book_shell_view->priv->book_shell_content; + view = e_book_shell_content_get_current_view (book_shell_content); + g_return_if_fail (view != NULL); + + print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; + e_addressbook_view_print (view, FALSE, print_action); +} + +static void action_address_book_properties_cb (GtkAction *action, EBookShellView *book_shell_view) { @@ -494,23 +526,7 @@ action_contact_print_cb (GtkAction *action, g_return_if_fail (view != NULL); print_action = GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG; - e_addressbook_view_print (view, print_action); -} - -static void -action_contact_print_preview_cb (GtkAction *action, - EBookShellView *book_shell_view) -{ - EBookShellContent *book_shell_content; - EAddressbookView *view; - GtkPrintOperationAction print_action; - - book_shell_content = book_shell_view->priv->book_shell_content; - view = e_book_shell_content_get_current_view (book_shell_content); - g_return_if_fail (view != NULL); - - print_action = GTK_PRINT_OPERATION_ACTION_PREVIEW; - e_addressbook_view_print (view, print_action); + e_addressbook_view_print (view, TRUE, print_action); } static void @@ -1002,19 +1018,26 @@ static GtkRadioActionEntry contact_search_entries[] = { static GtkActionEntry lockdown_printing_entries[] = { - { "contact-print", + { "address-book-print", GTK_STOCK_PRINT, NULL, "<Control>p", - N_("Print selected contacts"), - G_CALLBACK (action_contact_print_cb) }, + N_("Print all shown contacts"), + G_CALLBACK (action_address_book_print_cb) }, - { "contact-print-preview", + { "address-book-print-preview", GTK_STOCK_PRINT_PREVIEW, NULL, NULL, N_("Preview the contacts to be printed"), - G_CALLBACK (action_contact_print_preview_cb) } + G_CALLBACK (action_address_book_print_preview_cb) }, + + { "contact-print", + GTK_STOCK_PRINT, + NULL, + NULL, + N_("Print selected contacts"), + G_CALLBACK (action_contact_print_cb) } }; static EPopupActionEntry lockdown_printing_popup_entries[] = { diff --git a/modules/addressbook/e-book-shell-view-actions.h b/modules/addressbook/e-book-shell-view-actions.h index 4c3a18bddf..e5eea1fb5a 100644 --- a/modules/addressbook/e-book-shell-view-actions.h +++ b/modules/addressbook/e-book-shell-view-actions.h @@ -31,6 +31,10 @@ E_SHELL_WINDOW_ACTION ((window), "address-book-delete") #define E_SHELL_WINDOW_ACTION_ADDRESS_BOOK_MOVE(window) \ E_SHELL_WINDOW_ACTION ((window), "address-book-move") +#define E_SHELL_WINDOW_ACTION_ADDRESS_BOOK_PRINT(window) \ + E_SHELL_WINDOW_ACTION ((window), "address-book-print") +#define E_SHELL_WINDOW_ACTION_ADDRESS_BOOK_PRINT_PREVIEW(window) \ + E_SHELL_WINDOW_ACTION ((window), "address-book-print-preview") #define E_SHELL_WINDOW_ACTION_ADDRESS_BOOK_PROPERTIES(window) \ E_SHELL_WINDOW_ACTION ((window), "address-book-properties") #define E_SHELL_WINDOW_ACTION_ADDRESS_BOOK_RENAME(window) \ @@ -65,8 +69,6 @@ E_SHELL_WINDOW_ACTION ((window), "contact-preview") #define E_SHELL_WINDOW_ACTION_CONTACT_PRINT(window) \ E_SHELL_WINDOW_ACTION ((window), "contact-print") -#define E_SHELL_WINDOW_ACTION_CONTACT_PRINT_PREVIEW(window) \ - E_SHELL_WINDOW_ACTION ((window), "contact-print-preview") #define E_SHELL_WINDOW_ACTION_CONTACT_SAVE_AS(window) \ E_SHELL_WINDOW_ACTION ((window), "contact-save-as") #define E_SHELL_WINDOW_ACTION_CONTACT_SELECT_ALL(window) \ diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c index 88a503b024..d5f160d407 100644 --- a/modules/addressbook/e-book-shell-view.c +++ b/modules/addressbook/e-book-shell-view.c @@ -287,6 +287,14 @@ book_shell_view_update_actions (EShellView *shell_view) sensitive = has_primary_source && !primary_source_is_system; gtk_action_set_sensitive (action, sensitive); + action = ACTION (ADDRESS_BOOK_PRINT); + sensitive = has_primary_source; + gtk_action_set_sensitive (action, sensitive); + + action = ACTION (ADDRESS_BOOK_PRINT_PREVIEW); + sensitive = has_primary_source; + gtk_action_set_sensitive (action, sensitive); + action = ACTION (ADDRESS_BOOK_RENAME); sensitive = has_primary_source; gtk_action_set_sensitive (action, sensitive); @@ -336,10 +344,6 @@ book_shell_view_update_actions (EShellView *shell_view) sensitive = any_contacts_selected; gtk_action_set_sensitive (action, sensitive); - action = ACTION (CONTACT_PRINT_PREVIEW); - sensitive = any_contacts_selected; - gtk_action_set_sensitive (action, sensitive); - action = ACTION (CONTACT_SAVE_AS); sensitive = any_contacts_selected; gtk_action_set_sensitive (action, sensitive); |