aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-07-02 19:31:27 +0800
committerMilan Crha <mcrha@redhat.com>2013-07-02 19:31:27 +0800
commitf86d8fefc692e7309fb86647ef795f8a0934a507 (patch)
tree63684d47c081543cc36fec7f995ac3def733e897 /mail/em-composer-utils.c
parentd65f595c21f7aadf5d38e840c5d4675949322294 (diff)
downloadgsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar.gz
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar.bz2
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar.lz
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar.xz
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.tar.zst
gsoc2013-evolution-f86d8fefc692e7309fb86647ef795f8a0934a507.zip
Bug #689640 - Print Preview of composer text is empty
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 280c94a83e..92776bc393 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1001,6 +1001,31 @@ em_utils_composer_print_cb (EMsgComposer *composer,
EActivity *activity,
EMailSession *session)
{
+ /* as long as EMsgComposer uses GtkHTML, use its routine for printing;
+ this conditional compile is here rather to not forget to fix this
+ once the WebKit-based composer will land */
+#if defined(GTK_TYPE_HTML)
+ EWebViewGtkHTML *gtkhtml_web_view;
+ GtkPrintOperation *operation;
+ GError *error = NULL;
+
+ gtkhtml_web_view = e_msg_composer_get_web_view (composer);
+ g_return_if_fail (E_IS_WEB_VIEW_GTKHTML (gtkhtml_web_view));
+
+ operation = gtk_print_operation_new ();
+
+ gtk_html_print_operation_run (
+ GTK_HTML (gtkhtml_web_view), operation, action,
+ GTK_WINDOW (composer), NULL, NULL, NULL, NULL, NULL, &error);
+
+ g_object_unref (operation);
+
+ if (error) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_warning ("%s: Failed to run print operation: %s", G_STRFUNC, error->message);
+ g_clear_error (&error);
+ }
+#else
EMailParser *parser;
EMailPartList *parts;
EMailPrinter *printer;
@@ -1018,6 +1043,7 @@ em_utils_composer_print_cb (EMsgComposer *composer,
g_object_unref (printer);
g_object_unref (parts);
+#endif
}
/* Composing messages... */