diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-01-09 04:34:53 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-01-09 04:34:53 +0800 |
commit | 5c49bda7d167c71419950f0dc081a5b8ec56ee68 (patch) | |
tree | 079448c5aa4e91b39e43db079a672c712f9d8e0f /mail/folder-browser-ui.c | |
parent | ac80365c860bc263b183a76a5f035779b60f100f (diff) | |
download | gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar.gz gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar.bz2 gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar.lz gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar.xz gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.tar.zst gsoc2013-evolution-5c49bda7d167c71419950f0dc081a5b8ec56ee68.zip |
Removed. (mail_config_set_show_preview): Removed.
2003-01-08 Jeffrey Stedfast <fejj@ximian.com>
* mail-config.c (mail_config_get_show_preview): Removed.
(mail_config_set_show_preview): Removed.
* folder-browser.c (folder_browser_toggle_preview): Simply set the
gconf show_preview setting and let the code in folder-browser-ui.c
detect it and update the UI.
* folder-browser-ui.c (folder_browser_ui_add_global): Listen for
changed events on the show_preview setting.
svn path=/trunk/; revision=19288
Diffstat (limited to 'mail/folder-browser-ui.c')
-rw-r--r-- | mail/folder-browser-ui.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index e9e56c1c93..0c8ecfd0d8 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -602,12 +602,24 @@ folder_browser_ui_rm_list (FolderBrowser *fb) folder_browser_ui_discard_view_menus (fb); } +static void +show_preview_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +{ + FolderBrowser *fb = user_data; + gboolean show_preview; + + show_preview = gconf_client_get_bool (client, "/apps/evolution/mail/display/show_preview", NULL); + bonobo_ui_component_set_prop (fb->uicomp, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL); + folder_browser_set_message_preview (fb, show_preview); +} + void folder_browser_ui_add_global (FolderBrowser *fb) { - int state; BonoboUIComponent *uic = fb->uicomp; - + gboolean show_preview; + GConfClient *gconf; + if (fb->sensitise_state) { g_hash_table_destroy (fb->sensitise_state); fb->sensitise_state = NULL; @@ -615,13 +627,25 @@ folder_browser_ui_add_global (FolderBrowser *fb) ui_add (fb, "global", global_verbs, global_pixcache); + gconf = gconf_client_get_default (); + /* (Pre)view toggle */ - state = mail_config_get_show_preview (FOLDER_BROWSER (fb)->uri); - bonobo_ui_component_set_prop (uic, "/commands/ViewPreview", "state", state ? "1" : "0", NULL); + /* watch the show_preview setting */ + gconf_client_add_dir (gconf, "/apps/evolution/mail/display/show_preview", + GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + + /* listen for changed events to the show_preview setting */ + gconf_client_notify_add (gconf, "/apps/evolution/mail/display/show_preview", + show_preview_changed, fb, NULL, NULL); + + show_preview = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_preview", NULL); + bonobo_ui_component_set_prop (uic, "/commands/ViewPreview", "state", show_preview ? "1" : "0", NULL); + + /* listen for user-changes */ bonobo_ui_component_add_listener (uic, "ViewPreview", folder_browser_toggle_preview, fb); /* FIXME: this kind of bypasses bonobo but seems the only way when we change components */ - folder_browser_toggle_preview (uic, "", Bonobo_UIComponent_STATE_CHANGED, state ? "1" : "0", fb); + folder_browser_toggle_preview (uic, "", Bonobo_UIComponent_STATE_CHANGED, show_preview ? "1" : "0", fb); /* Stop button */ /* TODO: Go through cache, but we can't becaus eof mail-mt.c:set_stop at the moment */ |