diff options
-rw-r--r-- | composer/ChangeLog | 8 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 43 | ||||
-rw-r--r-- | composer/e-msg-composer.h | 2 | ||||
-rw-r--r-- | plugins/print-message/ChangeLog | 7 | ||||
-rw-r--r-- | plugins/print-message/print-message.c | 2 |
5 files changed, 61 insertions, 1 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 53a316aed4..b57d72aa94 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,11 @@ +2007-08-24 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #355766 + + * e-msg-composer.[ch] (e_msg_composer_get_message_print): + New function overrides composer flags for printing. + Patch by Mayank Jain. + 2007-08-23 Sankar P <psankar@novell.com> * Committed on behalf of Raghavendran <raghavguru7@gmail.com> diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index a1770cdd69..8c0e57515f 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -5357,6 +5357,49 @@ e_msg_composer_get_message (EMsgComposer *composer, gboolean save_html_object_da } CamelMimeMessage * +e_msg_composer_get_message_print (EMsgComposer *composer, gboolean save_html_object_data) +{ + EMsgComposer *temp_composer; + CamelMimeMessage *msg; + GString *flags; + + msg = build_message (composer, save_html_object_data); + temp_composer = e_msg_composer_new_with_message (msg); + camel_object_unref (msg); + + /* build flags string */ + flags = g_string_sized_new (128); + if (temp_composer->priv->send_html) + g_string_append (flags, "text/html"); + else + g_string_append (flags, "text/plain"); + if (temp_composer->priv->pgp_sign) + g_string_append (flags, ", pgp-sign"); + if (temp_composer->priv->pgp_encrypt) + g_string_append (flags, ", pgp-encrypt"); + if (temp_composer->priv->smime_sign) + g_string_append (flags, ", smime-sign"); + if (temp_composer->priv->smime_encrypt) + g_string_append (flags, ", smime-encrypt"); + + /* override composer flags */ + temp_composer->priv->send_html = TRUE; + temp_composer->priv->pgp_sign = FALSE; + temp_composer->priv->pgp_encrypt = FALSE; + temp_composer->priv->smime_sign = FALSE; + temp_composer->priv->smime_encrypt = FALSE; + + msg = build_message (temp_composer, save_html_object_data); + camel_medium_set_header (CAMEL_MEDIUM (msg), + "X-Evolution-Format", flags->str); + + e_msg_composer_delete (temp_composer); + g_string_free (flags, TRUE); + + return msg; +} + +CamelMimeMessage * e_msg_composer_get_message_draft (EMsgComposer *composer) { CamelMimeMessage *msg; diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index 089442b9e2..bf0a5abe11 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -101,6 +101,8 @@ void e_msg_composer_add_inline_image_from_mime_part (EMsgCo CamelMimePart *part); CamelMimeMessage *e_msg_composer_get_message (EMsgComposer *composer, gboolean save_html_object_data); +CamelMimeMessage *e_msg_composer_get_message_print (EMsgComposer *composer, + gboolean save_html_object_data); CamelMimeMessage *e_msg_composer_get_message_draft (EMsgComposer *composer); void e_msg_composer_show_sig_file (EMsgComposer *composer); gboolean e_msg_composer_get_send_html (EMsgComposer *composer); diff --git a/plugins/print-message/ChangeLog b/plugins/print-message/ChangeLog index 62ddd88b88..017a5d71ef 100644 --- a/plugins/print-message/ChangeLog +++ b/plugins/print-message/ChangeLog @@ -1,3 +1,10 @@ +2007-08-24 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #355766 + + * print-message.c (org_gnome_print_preview): + Call e_msg_composer_get_message_print(). + 2007-05-11 Gilles Dartiguelongue <dartigug@esiee.fr> * print-message.c: fix prototypes, diff --git a/plugins/print-message/print-message.c b/plugins/print-message/print-message.c index 5e5ec389fd..60d73bb799 100644 --- a/plugins/print-message/print-message.c +++ b/plugins/print-message/print-message.c @@ -65,7 +65,7 @@ org_gnome_print_preview (EPlugin *ep, EMMenuTargetWidget *t) EMFormatHTMLPrint *efhp; action = GTK_PRINT_OPERATION_ACTION_PREVIEW; - message = e_msg_composer_get_message (composer, 1); + 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); |