diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-01-14 05:58:25 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-01-14 05:58:25 +0800 |
commit | 724b28b7ad3ab1c966400b008a793e50327ff1c0 (patch) | |
tree | df5a955e487a1eed2162202de95d483c126e5026 /mail/folder-browser.c | |
parent | 3c89e1aa0252c6f558cf1573b39ab3a366cd4516 (diff) | |
download | gsoc2013-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.c')
-rw-r--r-- | mail/folder-browser.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 074bdd5f6e..4c4c29bc3d 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -213,6 +213,11 @@ folder_browser_destroy (GtkObject *object) folder_browser->hide_deleted_notify_id = 0; } + if (folder_browser->message_style_notify_id != 0) { + gconf_client_notify_remove (gconf, folder_browser->message_style_notify_id); + folder_browser->message_style_notify_id = 0; + } + /* wait for all outstanding async events against us */ mail_async_event_destroy (folder_browser->async_event); @@ -1344,8 +1349,6 @@ folder_browser_set_message_display_style (BonoboUIComponent *component GConfClient *gconf; int i; - /* FIXME: we should listen for changes to this, so when it changes for one folder all folders get updated */ - if (type != Bonobo_UIComponent_STATE_CHANGED || atoi (state) == 0 || fb->message_list == NULL) @@ -1353,6 +1356,8 @@ folder_browser_set_message_display_style (BonoboUIComponent *component gconf = gconf_client_get_default (); + printf ("message display style: %s\n", path); + for (i = 0; i < MAIL_CONFIG_DISPLAY_MAX; i++) { if (strstr (message_display_styles[i], path)) { fb->mail_display->display_style = i; @@ -2384,6 +2389,22 @@ hide_deleted_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpo } static void +message_style_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +{ + extern char *message_display_styles[]; + FolderBrowser *fb = user_data; + const char *uipath; + int style; + + if (fb->uicomp) { + style = gconf_client_get_int (client, "/apps/evolution/mail/display/message_style", NULL); + style = style >= 0 && style < MAIL_CONFIG_DISPLAY_MAX ? style : 0; + uipath = message_display_styles[style]; + bonobo_ui_component_set_prop (fb->uicomp, uipath, "state", "1", NULL); + } +} + +static void folder_browser_gui_init (FolderBrowser *fb) { extern RuleContext *search_context; @@ -2453,6 +2474,13 @@ folder_browser_gui_init (FolderBrowser *fb) fb->show_preview_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_preview", show_preview_changed, fb, NULL, NULL); + /* message display style */ + gconf_client_add_dir (gconf, "/apps/evolution/mail/display/message_style", + GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + + fb->message_style_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display/message_style", + message_style_changed, fb, NULL, NULL); + /* paned size */ gconf_client_add_dir (gconf, "/apps/evolution/mail/display/paned_size", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); |