aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-print.c
diff options
context:
space:
mode:
authorpepp <pelloux@gmail.com>2011-12-15 14:53:52 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2011-12-15 15:18:26 +0800
commitd300de403de5b9b2d3c2c2f9d371f59859eeaf8c (patch)
tree508e5bc436b5d14369aaf4d9a741ff201eaeb165 /mail/em-format-html-print.c
parentbe607ffe63925ccaa70c33c8f7766c6bf65ad80a (diff)
downloadgsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.gz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.bz2
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.lz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.xz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.zst
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.zip
Bug 566793 - Support Drop And Drag Into Nautilus As PDF File
Diffstat (limited to 'mail/em-format-html-print.c')
-rw-r--r--mail/em-format-html-print.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c
index fd47275e30..d1e7dfb752 100644
--- a/mail/em-format-html-print.c
+++ b/mail/em-format-html-print.c
@@ -45,6 +45,8 @@ efhp_finalize (GObject *object)
{
EMFormatHTMLPrint *efhp = (EMFormatHTMLPrint *) object;
+ g_free (efhp->export_filename);
+ efhp->export_filename = NULL;
gtk_widget_destroy (efhp->window);
if (efhp->source != NULL)
g_object_unref (efhp->source);
@@ -90,6 +92,9 @@ em_format_html_print_init (EMFormatHTMLPrint *efhp)
gtk_widget_realize (GTK_WIDGET (web_view));
efhp->parent.show_icon = FALSE;
((EMFormat *) efhp)->print = TRUE;
+
+ efhp->export_filename = NULL;
+ efhp->async = TRUE;
}
EMFormatHTMLPrint *
@@ -184,6 +189,9 @@ emfhp_complete (EMFormatHTMLPrint *efhp)
operation = e_print_operation_new ();
+ if (efhp->action == GTK_PRINT_OPERATION_ACTION_EXPORT)
+ gtk_print_operation_set_export_filename (operation, efhp->export_filename);
+
gtk_html_print_operation_run (
GTK_HTML (web_view),
operation, efhp->action, NULL,
@@ -213,12 +221,18 @@ em_format_html_print_message (EMFormatHTMLPrint *efhp,
em_format_html_load_images (EM_FORMAT_HTML (efhp));
- g_signal_connect (
- efhp, "complete", G_CALLBACK (emfhp_complete), efhp);
- /* FIXME Not passing a GCancellable here. */
- em_format_format_clone (
- EM_FORMAT (efhp),
- folder, message_uid, message,
- EM_FORMAT (efhp->source), NULL);
+ if (efhp->async) {
+ g_signal_connect (
+ efhp, "complete", G_CALLBACK (emfhp_complete), efhp);
+
+ /* FIXME Not passing a GCancellable here. */
+ em_format_format_clone (
+ (EMFormat *) efhp,
+ folder, message_uid, message,
+ (EMFormat *) efhp->source, NULL);
+ } else {
+ em_format_html_clone_sync (folder, message_uid, message, (EMFormatHTML *)efhp, (EMFormat *)efhp->source);
+ emfhp_complete (efhp);
+ }
}