From cd5ff486fb02451645f8b4b39608edca2da5e4a2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 31 Jan 2009 18:02:22 +0000 Subject: Let the mailer handle composer printing. Start roughing in the mailer search bar. svn path=/branches/kill-bonobo/; revision=37199 --- mail/em-composer-utils.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mail/em-composer-utils.c') diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 205a894d37..065cd325df 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -46,6 +46,7 @@ #include "composer/e-msg-composer.h" #include "composer/e-composer-autosave.h" #include "em-format-html.h" +#include "em-format-html-print.h" #include "em-format-quote.h" #include "em-event.h" @@ -642,6 +643,20 @@ em_utils_composer_save_draft_cb (EMsgComposer *composer) camel_object_unref (msg); } +static void +em_utils_composer_print_cb (EMsgComposer *composer, + GtkPrintOperationAction action) +{ + CamelMimeMessage *message; + EMFormatHTMLPrint *efhp; + + message = e_msg_composer_get_message_print (composer, 1); + + efhp = em_format_html_print_new (NULL, action); + em_format_html_print_raw_message (efhp, message); + g_object_unref (efhp); +} + /* Composing messages... */ static EMsgComposer * @@ -2542,6 +2557,10 @@ em_configure_new_composer (EMsgComposer *composer) composer, "save-draft", G_CALLBACK (em_utils_composer_save_draft_cb), NULL); + g_signal_connect ( + composer, "print", + G_CALLBACK (em_utils_composer_print_cb), NULL); + /* Supply the composer with a folder tree model. */ table = e_msg_composer_get_header_table (composer); model = e_mail_shell_module_get_folder_tree_model (mail_shell_module); -- cgit