aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser-ui.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-01-14 05:58:25 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-01-14 05:58:25 +0800
commit724b28b7ad3ab1c966400b008a793e50327ff1c0 (patch)
treedf5a955e487a1eed2162202de95d483c126e5026 /mail/folder-browser-ui.c
parent3c89e1aa0252c6f558cf1573b39ab3a366cd4516 (diff)
downloadgsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar.gz
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar.bz2
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar.lz
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar.xz
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.tar.zst
gsoc2013-evolution-724b28b7ad3ab1c966400b008a793e50327ff1c0.zip
Check the state of message_style in gconf and set the menus accordingly.
2003-01-13 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'mail/folder-browser-ui.c')
-rw-r--r--mail/folder-browser-ui.c21
1 files changed, 12 insertions, 9 deletions
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