From 2983bfc285a877d4f0327b28eb061fe4e952826b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 31 Mar 2004 17:38:21 +0000 Subject: Only do citation colouring if the user has specified to do so and use the 2004-03-31 Jeffrey Stedfast * em-format-html.c (efh_text_plain): Only do citation colouring if the user has specified to do so and use the user's specified colour when appropriate. Fixes bug #56290. svn path=/trunk/; revision=25269 --- mail/ChangeLog | 4 ++++ mail/em-format-html.c | 30 +++++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 81a63cccc9..28424ef1b7 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,9 @@ 2004-03-31 Jeffrey Stedfast + * em-format-html.c (efh_text_plain): Only do citation colouring if + the user has specified to do so and use the user's specified + colour when appropriate. Fixes bug #56290. + * em-subscribe-editor.c (em_subscribe_editor_new): Save/restore the subscribe dialog's window size. Fixes bug #56230. diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 9dbf044262..b6806e07fe 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -31,6 +31,8 @@ #include #include +#include + #include #include /* for e_utf8_strftime, what about e_time_format_time? */ #include "e-util/e-time-utils.h" @@ -627,9 +629,10 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo CamelDataWrapper *dw; CamelContentType *type; const char *format; - guint32 rgb = 0x737373, flags; + guint32 rgb, flags; int i, count, len; - + GConfClient *gconf; + camel_stream_printf (stream, "
\n" "
\n" @@ -684,7 +687,28 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo camel_object_unref(inline_filter); camel_content_type_unref(ct); } - + + gconf = gconf_client_get_default (); + if (gconf_client_get_bool (gconf, "/apps/evolution/mail/display/mark_citations", NULL)) { + GError *err = NULL; + GdkColor colour; + char *str; + + str = gconf_client_get_string (gconf, "/apps/evolution/mail/display/citation_colour", &err); + if (err == NULL) { + gdk_color_parse (str, &colour); + rgb = ((colour.red & 0xff00) << 8) | (colour.green & 0xff00) | ((colour.blue & 0xff00) >> 8); + } else { + /* default colour */ + g_error_free (err); + rgb = 0x737373; + } + g_free (str); + } else { + rgb = 0; + } + g_object_unref (gconf); + filtered_stream = camel_stream_filter_new_with_stream(stream); html_filter = camel_mime_filter_tohtml_new(flags, rgb); camel_stream_filter_add(filtered_stream, html_filter); -- cgit