From 724b28b7ad3ab1c966400b008a793e50327ff1c0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 13 Jan 2003 21:58:25 +0000 Subject: Check the state of message_style in gconf and set the menus accordingly. 2003-01-13 Jeffrey Stedfast * folder-browser-ui.c (folder_browser_ui_add_message): Check the state of message_style in gconf and set the menus accordingly. * folder-browser.c (folder_browser_destroy): Remove listener for message_style change notification. (folder_browser_gui_init): Connect a listener for changes to message_style. svn path=/trunk/; revision=19432 --- mail/folder-browser-ui.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'mail/folder-browser-ui.c') diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index cf5a689304..b5d76a5fb6 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -511,9 +511,10 @@ char *message_display_styles[] = { void folder_browser_ui_add_message (FolderBrowser *fb) { - int state; BonoboUIComponent *uic = fb->uicomp; FolderBrowserSelectionState prev_state; + GConfClient *gconf; + int style; if (fb->sensitise_state) { g_hash_table_destroy(fb->sensitise_state); @@ -522,16 +523,19 @@ folder_browser_ui_add_message (FolderBrowser *fb) ui_add (fb, "message", message_verbs, message_pixcache); + gconf = gconf_client_get_default (); + /* Display Style */ - state = fb->mail_display->display_style; - bonobo_ui_component_set_prop (uic, message_display_styles[state], - "state", "1", NULL); + style = gconf_client_get_int (gconf, "/apps/evolution/mail/display/message_style", NULL); + style = style >= 0 && style < MAIL_CONFIG_DISPLAY_MAX ? style : 0; + bonobo_ui_component_set_prop (uic, message_display_styles[style], "state", "1", NULL); bonobo_ui_component_add_listener (uic, "ViewNormal", folder_browser_set_message_display_style, fb); bonobo_ui_component_add_listener (uic, "ViewFullHeaders", folder_browser_set_message_display_style, fb); bonobo_ui_component_add_listener (uic, "ViewSource", folder_browser_set_message_display_style, 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); + if (fb->mail_display->display_style != style) { + fb->mail_display->display_style = style; + mail_display_redisplay (fb->mail_display, TRUE); + } /* Resend Message */ if (fb->folder && !folder_browser_is_sent (fb)) @@ -544,8 +548,7 @@ folder_browser_ui_add_message (FolderBrowser *fb) /* Charset picker */ e_charset_picker_bonobo_ui_populate (uic, "/menu/View", FB_DEFAULT_CHARSET, - folder_browser_charset_changed, - fb); + folder_browser_charset_changed, fb); } void -- cgit v1.2.3