aboutsummaryrefslogtreecommitdiffstats
path: root/composer
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
parent9a1a431da99ee4efcf446aae9a7a02ddeae47341 (diff)
downloadgsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.gz
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.bz2
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.lz
gsoc2013-evolution-67c9a151f7cd8a2986f97335d025b7f8bb95b6ef.tar.xz
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')
-rw-r--r--composer/ChangeLog8
-rw-r--r--composer/e-msg-composer.c43
-rw-r--r--composer/e-msg-composer.h2
3 files changed, 53 insertions, 0 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);