diff options
author | Grahame Bowland <grahame@angrygoats.net> | 2003-12-11 12:56:12 +0800 |
---|---|---|
committer | Grahame Michael Bowland <gbowland@src.gnome.org> | 2003-12-11 12:56:12 +0800 |
commit | b44064edaa3ea4e0019faf90a05dbfb531505ac9 (patch) | |
tree | 3c0d2e05d14f4fac64be23f588465a5354d64fad /mail/em-folder-view.c | |
parent | 80237219dd2404cae88c8ec5653d40a63f6be130 (diff) | |
download | gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar.gz gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar.bz2 gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar.lz gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar.xz gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.tar.zst gsoc2013-evolution-b44064edaa3ea4e0019faf90a05dbfb531505ac9.zip |
display x-evolution-mailer pseudo header irrespective of xmailer_mask.
2003-12-11 Grahame Bowland <grahame@angrygoats.net>
* em-format-html.c (efh_format_header): display
x-evolution-mailer pseudo header irrespective of
xmailer_mask. This is now handled by a header
configuration dialog.
* mail-config.glade: add tab to mail configuration
dialog to allow custom headers to be specified for
display.
* em-mailer-prefs.h: modify struct _EMMailerPrefs to
add widgets for custom header tab. Add defines for custom
header flags. Add struct EMMailerCustomHeader to describe
custom headers, and add function
em_mailer_custom_headers_from_xml to allow XML from gconf
key to be parsed into this structure.
* em-folder-view.c (emfv_setting_notify): catch changes to
custom header gconf key and update mail view to correspond
* em-mailer-prefs.c (em_mailer_prefs_apply): save custom
headers to gconf
(header_list_enabled_toggled): toggle clicked toggle column
(add_header): add header to custom header list if valid
(remove_header): remove selected custom header
(is_valid_header): return true if passed header is valid,
otherwise false
(entry_header_changed): call add_header_update_sensitivity
(em_mailer_prefs_construct): initialise header selection tab.
Load gconf data for header selection dialog.
(em_mailer_custom_header_to_xml): load a header structure
from XML document structure
(em_mailer_custom_header_from_xml): load a header
structure from a string containing valid XML. if any failure,
the header.name is set to NULL.
(header_list_row_selected): call
remove_header_update_sensitivity
(remove_header_update_sensitivity): set the sensitivity of
the remove button to FALSE if the list is empty or nothing
is selected. Otherwise, set it to TRUE.
(add_header_update_sensitivity): set the sensitivity of the
the add button to FALSE if the entry box is empty, contains
a duplicate header, or contains an invalid header. Otherwise,
set it to TRUE.
* evolution-mail.schemas.in.in: add mail/display/headers
svn path=/trunk/; revision=23924
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 5f7a1742e6..bb74f5b55e 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -62,6 +62,7 @@ #include "em-format-html-print.h" #include "em-folder-selection.h" #include "em-folder-view.h" +#include "em-mailer-prefs.h" #include "em-message-browser.h" #include "message-list.h" #include "em-utils.h" @@ -1901,6 +1902,7 @@ enum { EMFV_MARK_SEEN_TIMEOUT, EMFV_LOAD_HTTP, EMFV_XMAILER_MASK, + EMFV_HEADERS, EMFV_SETTINGS /* last, for loop count */ }; @@ -1916,6 +1918,7 @@ static const char * const emfv_display_keys[] = { "mark_seen_timeout", "load_http_images", "xmailer_mask", + "headers", }; static GHashTable *emfv_setting_key; @@ -1979,6 +1982,34 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold case EMFV_XMAILER_MASK: em_format_html_set_xmailer_mask((EMFormatHTML *)emfv->preview, gconf_value_get_int(gconf_entry_get_value(entry))); break; + case EMFV_HEADERS: { + GSList *header_config_list, *p; + EMFormat *emf = (EMFormat *)emfv->preview; + int added_headers = 0; + + header_config_list = gconf_client_get_list(gconf, "/apps/evolution/mail/display/headers", GCONF_VALUE_STRING, NULL); + em_format_clear_headers((EMFormat *)emfv->preview); + p = header_config_list; + while (p) { + EMMailerPrefsHeader *h; + char *xml = (char *)p->data; + + h = em_mailer_prefs_header_from_xml(xml); + if (h && h->enabled) { + em_format_add_header(emf, h->name, EM_FORMAT_HEADER_BOLD); + added_headers++; + } + em_mailer_prefs_header_free(h); + p = g_slist_next(p); + } + g_slist_foreach(header_config_list, (GFunc) g_free, NULL); + g_slist_free(header_config_list); + if (added_headers == 0) + em_format_default_headers(emf); + /* force a redraw */ + if (emf->message) + em_format_format_clone(emf, emf->message, emf); + break; } } } |