aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-08-25 01:10:58 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-08-25 01:10:58 +0800
commit67c9a151f7cd8a2986f97335d025b7f8bb95b6ef (patch)
tree416dceb1169b3ca69ddab662ece5534e310ffc38 /composer/e-msg-composer.c
parent9a1a431da99ee4efcf446aae9a7a02ddeae47341 (diff)
downloadgsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.gz
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.zst
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.zip
** Fixes bug #355766
2007-08-24 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #355766 * plugins/print-message/print-message.c (org_gnome_print_preview): Call e_msg_composer_get_message_print(). * composer/e-msg-composer.[ch] (e_msg_composer_get_message_print): New function overrides composer flags for printing. Patch by Mayank Jain. svn path=/trunk/; revision=34099
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c43
1 files changed, 43 insertions, 0 deletions
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;