Commit 83a7860c authored by Milan Crha's avatar Milan Crha

Inline Forward headers bold in Plain Text mode

Using Inline Forward with the composer being preset in Plain Text mode
still showed the header names in bold.
parent 08ea44f5
...@@ -41,7 +41,8 @@ typedef enum { /*< flags >*/ ...@@ -41,7 +41,8 @@ typedef enum { /*< flags >*/
E_MAIL_FORMATTER_HEADER_FLAG_NODEC = 1 << 5, E_MAIL_FORMATTER_HEADER_FLAG_NODEC = 1 << 5,
E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN = 1 << 6, E_MAIL_FORMATTER_HEADER_FLAG_HIDDEN = 1 << 6,
E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS = 1 << 7, E_MAIL_FORMATTER_HEADER_FLAG_NOLINKS = 1 << 7,
E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE = 1 << 8 E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE = 1 << 8,
E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING = 1 << 9
} EMailFormatterHeaderFlags; } EMailFormatterHeaderFlags;
typedef enum { typedef enum {
...@@ -56,7 +57,8 @@ typedef enum { ...@@ -56,7 +57,8 @@ typedef enum {
typedef enum { /*< flags >*/ typedef enum { /*< flags >*/
E_MAIL_FORMATTER_QUOTE_FLAG_CITE = 1 << 0, E_MAIL_FORMATTER_QUOTE_FLAG_CITE = 1 << 0,
E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS = 1 << 1, E_MAIL_FORMATTER_QUOTE_FLAG_HEADERS = 1 << 1,
E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG = 1 << 2 /* do not strip signature */ E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG = 1 << 2, /* do not strip signature */
E_MAIL_FORMATTER_QUOTE_FLAG_NO_FORMATTING = 1 << 3
} EMailFormatterQuoteFlags; } EMailFormatterQuoteFlags;
/** /**
......
...@@ -226,6 +226,7 @@ format_full_headers (EMailFormatter *formatter, ...@@ -226,6 +226,7 @@ format_full_headers (EMailFormatter *formatter,
gchar *evolution_imagesdir; gchar *evolution_imagesdir;
const gchar *direction; const gchar *direction;
guint ii, len; guint ii, len;
guint32 formatting_flag = 0;
g_return_if_fail (E_IS_MAIL_PART_HEADERS (part)); g_return_if_fail (E_IS_MAIL_PART_HEADERS (part));
...@@ -246,6 +247,9 @@ format_full_headers (EMailFormatter *formatter, ...@@ -246,6 +247,9 @@ format_full_headers (EMailFormatter *formatter,
break; break;
} }
if ((context->flags & E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING) != 0)
formatting_flag |= E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING;
ct = camel_mime_part_get_content_type (mime_part); ct = camel_mime_part_get_content_type (mime_part);
charset = camel_content_type_param (ct, "charset"); charset = camel_content_type_param (ct, "charset");
charset = camel_iconv_charset_name (charset); charset = camel_iconv_charset_name (charset);
...@@ -360,7 +364,7 @@ format_full_headers (EMailFormatter *formatter, ...@@ -360,7 +364,7 @@ format_full_headers (EMailFormatter *formatter,
if (camel_name_value_array_get (headers, ii, &header_name, &header_value) && header_name) { if (camel_name_value_array_get (headers, ii, &header_name, &header_value) && header_name) {
e_mail_formatter_format_header (formatter, buffer, header_name, header_value, e_mail_formatter_format_header (formatter, buffer, header_name, header_value,
E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS, charset); E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS | formatting_flag, charset);
} }
} }
e_mail_formatter_format_security_header (formatter, context, buffer, part, E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS); e_mail_formatter_format_security_header (formatter, context, buffer, part, E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS);
...@@ -434,7 +438,7 @@ format_full_headers (EMailFormatter *formatter, ...@@ -434,7 +438,7 @@ format_full_headers (EMailFormatter *formatter,
formatter, buffer, formatter, buffer,
header_name, header_name,
header_value, header_value,
0, charset); formatting_flag, charset);
} }
g_strfreev (default_headers); g_strfreev (default_headers);
......
...@@ -72,7 +72,8 @@ emfqe_format_text_header (EMailFormatter *emf, ...@@ -72,7 +72,8 @@ emfqe_format_text_header (EMailFormatter *emf,
g_string_append_printf (buffer, HEADER_PREFIX); g_string_append_printf (buffer, HEADER_PREFIX);
if (flags & E_MAIL_FORMATTER_HEADER_FLAG_BOLD) if ((flags & E_MAIL_FORMATTER_HEADER_FLAG_BOLD) &&
!(flags & E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING))
g_string_append_printf ( g_string_append_printf (
buffer, "<b>%s</b>: %s", label, html); buffer, "<b>%s</b>: %s", label, html);
else else
...@@ -114,6 +115,9 @@ emfqe_format_header (EMailFormatter *formatter, ...@@ -114,6 +115,9 @@ emfqe_format_header (EMailFormatter *formatter,
flags = E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE; flags = E_MAIL_FORMATTER_HEADER_FLAG_NOELIPSIZE;
if ((context->flags & E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING) != 0)
flags |= E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING;
canon_name = g_alloca (strlen (header_name) + 1); canon_name = g_alloca (strlen (header_name) + 1);
strcpy (canon_name, header_name); strcpy (canon_name, header_name);
e_mail_formatter_canon_header_name (canon_name); e_mail_formatter_canon_header_name (canon_name);
......
...@@ -66,6 +66,9 @@ mail_formatter_quote_run (EMailFormatter *formatter, ...@@ -66,6 +66,9 @@ mail_formatter_quote_run (EMailFormatter *formatter,
qf_context = (EMailFormatterQuoteContext *) context; qf_context = (EMailFormatterQuoteContext *) context;
qf_context->qf_flags = qf->priv->flags; qf_context->qf_flags = qf->priv->flags;
if ((qf_context->qf_flags & E_MAIL_FORMATTER_QUOTE_FLAG_NO_FORMATTING) != 0)
context->flags |= E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING;
g_seekable_seek ( g_seekable_seek (
G_SEEKABLE (stream), G_SEEKABLE (stream),
0, G_SEEK_SET, NULL, NULL); 0, G_SEEK_SET, NULL, NULL);
......
...@@ -71,7 +71,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter, ...@@ -71,7 +71,8 @@ e_mail_formatter_format_text_header (EMailFormatter *formatter,
direction = gtk_widget_get_default_direction (); direction = gtk_widget_get_default_direction ();
if (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS) { if (flags & E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS) {
if (flags & E_MAIL_FORMATTER_HEADER_FLAG_BOLD) { if ((flags & E_MAIL_FORMATTER_HEADER_FLAG_BOLD) &&
!(flags & E_MAIL_FORMATTER_HEADER_FLAG_NO_FORMATTING)) {
fmt = "<tr style=\"display: %s\">" fmt = "<tr style=\"display: %s\">"
"<td><b>%s:</b> %s</td></tr>"; "<td><b>%s:</b> %s</td></tr>";
} else { } else {
......
...@@ -2639,6 +2639,8 @@ forward_non_attached (EMsgComposer *composer, ...@@ -2639,6 +2639,8 @@ forward_non_attached (EMsgComposer *composer,
E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG; E_MAIL_FORMATTER_QUOTE_FLAG_KEEP_SIG;
if (style == E_MAIL_FORWARD_STYLE_QUOTED) if (style == E_MAIL_FORWARD_STYLE_QUOTED)
flags |= E_MAIL_FORMATTER_QUOTE_FLAG_CITE; flags |= E_MAIL_FORMATTER_QUOTE_FLAG_CITE;
if (!e_content_editor_get_html_mode (e_html_editor_get_content_editor (e_msg_composer_get_editor (composer))))
flags |= E_MAIL_FORMATTER_QUOTE_FLAG_NO_FORMATTING;
/* Setup composer's From account before calling quoting_text(), /* Setup composer's From account before calling quoting_text(),
because quoting_text() relies on that account. */ because quoting_text() relies on that account. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment