diff options
author | Jose Millan Soto <jmillan@igalia.com> | 2010-02-20 01:35:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2010-04-07 16:40:43 +0800 |
commit | 21250dde74250883831a107821bb23fc0232e160 (patch) | |
tree | b0cb8e704334fde3395825e3f80d12900a30b492 /embed/ephy-web-view.c | |
parent | 29a826d202b0557c652b237b0b91a59ad4b2e371 (diff) | |
download | gsoc2013-epiphany-21250dde74250883831a107821bb23fc0232e160.tar.gz gsoc2013-epiphany-21250dde74250883831a107821bb23fc0232e160.tar.zst gsoc2013-epiphany-21250dde74250883831a107821bb23fc0232e160.zip |
Improve page print implementation
Use the already existing functions we have for print preview also for
printing; fixes a bunch of usability issues.
Bug #609756
Signed-off-by: Xan Lopez <xan@gnome.org>
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | embed/ephy-web-view.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index cbb70c930..e7f47b448 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -3026,17 +3026,8 @@ ephy_web_view_show_page_certificate (EphyWebView *view) { } -/** - * ephy_web_view_show_print_preview - * @view: an #EphyWebView - * - * Generates a print preview of the specified view. - * An external viewer is used to display the preview. - * - * Since: 2.30 - **/ -void -ephy_web_view_show_print_preview (EphyWebView *view) +static void +ephy_web_view_run_print_action (EphyWebView *view, GtkPrintOperationAction action) { WebKitWebFrame *main_frame; GtkPrintOperation *operation; @@ -3050,7 +3041,7 @@ ephy_web_view_show_print_preview (EphyWebView *view) operation = gtk_print_operation_new (); gtk_print_operation_set_default_page_setup (operation, ephy_embed_shell_get_page_setup (shell)); - webkit_web_frame_print_full (main_frame, operation, GTK_PRINT_OPERATION_ACTION_PREVIEW, &error); + webkit_web_frame_print_full (main_frame, operation, action, &error); g_object_unref (operation); if (error) { @@ -3072,8 +3063,35 @@ ephy_web_view_show_print_preview (EphyWebView *view) ephy_embed_add_top_widget (embed, info_bar, FALSE); gtk_widget_show_all (info_bar); } +} - return; +/** + * ephy_web_view_show_print_preview + * @view: an #EphyWebView + * + * Generates a print preview of the specified view. + * An external viewer is used to display the preview. + * + * Since: 2.30 + **/ +void +ephy_web_view_show_print_preview (EphyWebView *view) +{ + ephy_web_view_run_print_action (view, GTK_PRINT_OPERATION_ACTION_PREVIEW); +} + +/** + * ephy_web_view_print + * @view: an #EphyWebView + * + * Opens a dialog to print the specified view. + * + * Since: 2.30 + **/ +void +ephy_web_view_print (EphyWebView *view) +{ + ephy_web_view_run_print_action (view, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); } /** |