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/folder-browser-ui.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'mail/folder-browser-ui.c') diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index 48cfc2169a..6e691c51f9 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -18,6 +18,7 @@ #include #include +#include "widgets/misc/e-charset-picker.h" #include "widgets/menus/gal-view-menus.h" /* GalView stuff */ #include #include @@ -169,16 +170,16 @@ static void ui_add (FolderBrowser *fb, EPixmap pixcache[]) { BonoboUIComponent *uic = fb->uicomp; - gchar *file; - + char *file; + bonobo_ui_component_add_verb_list_with_data (uic, verb, fb); - + bonobo_ui_component_freeze (uic, NULL); - + file = g_strconcat ("evolution-mail-", name, ".xml", NULL); bonobo_ui_util_set_ui (uic, EVOLUTION_DATADIR, file, "evolution-mail"); g_free (file); - + e_pixmaps_update (uic, pixcache); bonobo_ui_component_thaw (uic, NULL); @@ -299,11 +300,10 @@ folder_browser_ui_add_message (FolderBrowser *fb) int state; BonoboUIComponent *uic = fb->uicomp; FolderBrowserSelectionState prev_state; - + ui_add (fb, "message", message_verbs, message_pixcache); - + /* Display Style */ - state = fb->mail_display->display_style; bonobo_ui_component_set_prop (uic, message_display_styles[state], "state", "1", NULL); @@ -313,17 +313,20 @@ folder_browser_ui_add_message (FolderBrowser *fb) /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */ folder_browser_set_message_display_style (uic, strrchr (message_display_styles[state], '/') + 1, Bonobo_UIComponent_STATE_CHANGED, "1", fb); - + /* Resend Message */ - if (fb->folder && !folder_browser_is_sent (fb)) bonobo_ui_component_set_prop (uic, "/commands/MessageResend", "sensitive", "0", NULL); - + /* sensitivity of message-specific commands */ - prev_state = fb->selection_state; fb->selection_state = FB_SELSTATE_UNDEFINED; folder_browser_ui_set_selection_state (fb, prev_state); + + /* Charset picker */ + e_charset_picker_bonobo_ui_populate (uic, "/menu/View", FB_DEFAULT_CHARSET, + folder_browser_charset_changed, + fb); } /* -- cgit v1.2.3