From cd28010b326d9f212759a4f4de6cd9b67ac4f0db Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 9 Oct 2001 22:01:49 +0000 Subject: Create a chaqrset picker submenu in the View menu. 2001-10-09 Jeffrey Stedfast * folder-browser-ui.c (folder_browser_ui_add_message): Create a chaqrset picker submenu in the View menu. * mail-format.c (mail_format_raw_message): Pass the mail-display to get_data_wrapper_text. (get_data_wrapper_text): Use the user's override charset if one is provided, otherwise user the user's default charset. (handle_text_plain): Pass along the mail-display to get_data_wrapper_text. (handle_application_pgp): Same. (handle_text_enriched): Here too. (mail_get_message_body): Pass NULL as the mail-display to get_data_wrapper_text since we don't have access to a mail-display. * mail-display.c (mail_display_set_charset): New function to set a charset on the maildisplay. Once set, the message is redisplayed using the new charset. (mail_display_destroy): Free the charset. * folder-browser.c (folder_browser_charset_changed): New callback for when a user overrides the message charset. svn path=/trunk/; revision=13530 --- mail/mail-display.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mail/mail-display.c') diff --git a/mail/mail-display.c b/mail/mail-display.c index a950bace5d..005159f981 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1352,6 +1352,23 @@ mail_display_set_message (MailDisplay *md, CamelMedium *medium) } } +/** + * mail_display_set_message: + * @mail_display: the mail display object + * @medium: the input camel medium, or %NULL + * + * Makes the mail_display object show the contents of the medium + * param. + **/ +void +mail_display_set_charset (MailDisplay *mail_display, const char *charset) +{ + g_free (mail_display->charset); + mail_display->charset = g_strdup (charset); + + mail_display_queue_redisplay (mail_display); +} + /** * mail_display_load_images: * @md: the mail display object @@ -1395,6 +1412,7 @@ mail_display_destroy (GtkObject *object) { MailDisplay *mail_display = MAIL_DISPLAY (object); + g_free (mail_display->charset); g_free (mail_display->selection); g_datalist_clear (mail_display->data); -- cgit