diff options
author | Not Zed <NotZed@Ximian.com> | 2004-06-18 15:41:36 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-06-18 15:41:36 +0800 |
commit | 1a68102c00f473ff8892f901fa71f9cd2c5a6534 (patch) | |
tree | 7ee07ae8c9979fb2008e9abf91f7e43084634577 /mail/em-format-html-print.c | |
parent | 01a1d4009633d920a823ed7085893082ac6b0187 (diff) | |
download | gsoc2013-evolution-1a68102c00f473ff8892f901fa71f9cd2c5a6534.tar.gz gsoc2013-evolution-1a68102c00f473ff8892f901fa71f9cd2c5a6534.tar.zst gsoc2013-evolution-1a68102c00f473ff8892f901fa71f9cd2c5a6534.zip |
** See #60214.
2004-06-18 Not Zed <NotZed@Ximian.com>
** See #60214.
* em-folder-view.c (em_folder_view_print): re-arrange code to make
the dialogue async. We also now load the message every time
before printing.
(emfv_print_response): handle response to print.
* em-format-html-print.c (em_format_html_print_message): new api
to print a specific uid on a specific folder.
svn path=/trunk/; revision=26413
Diffstat (limited to 'mail/em-format-html-print.c')
-rw-r--r-- | mail/em-format-html-print.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c index 69fc9f19a2..6b252064a0 100644 --- a/mail/em-format-html-print.c +++ b/mail/em-format-html-print.c @@ -34,6 +34,8 @@ #include <gtk/gtkwindow.h> #include <camel/camel-i18n.h> +#include "mail-ops.h" +#include "mail-mt.h" #include "em-format-html-print.h" static void efhp_builtin_init(EMFormatHTMLPrintClass *efhc); @@ -65,6 +67,8 @@ efhp_finalise(GObject *o) gtk_widget_destroy(efhp->window); if (efhp->config) g_object_unref(efhp->config); + if (efhp->source) + g_object_unref(efhp->source); ((GObjectClass *)efhp_parent)->finalize(o); } @@ -198,6 +202,37 @@ int em_format_html_print_print(EMFormatHTMLPrint *efhp, EMFormatHTML *source, st return 0; /* damn async ... */ } +static void +emfhp_got_message(struct _CamelFolder *folder, const char *uid, struct _CamelMimeMessage *msg, void *data) +{ + EMFormatHTMLPrint *efhp = data; + + if (msg) { + if (efhp->source) + ((EMFormatHTML *)efhp)->load_http = efhp->source->load_http_now; + g_signal_connect(efhp, "complete", G_CALLBACK(emfhp_complete), efhp); + em_format_format_clone((EMFormat *)efhp, folder, uid, msg, (EMFormat *)efhp->source); + } else { + g_object_unref(efhp); + } +} + +int em_format_html_print_message(EMFormatHTMLPrint *efhp, EMFormatHTML *source, struct _GnomePrintConfig *print_config, struct _CamelFolder *folder, const char *uid, int preview) +{ + efhp->config = print_config; + if (print_config) + g_object_ref(print_config); + efhp->preview = preview; + efhp->source = source; + if (source) + g_object_ref(source); + g_object_ref(efhp); + + mail_get_message(folder, uid, emfhp_got_message, efhp, mail_thread_new); + + return 0; /* damn async ... */ +} + /* ********************************************************************** */ /* if only ... but i doubt this is possible with gnome print/gtkhtml */ |