diff options
author | Sam Yang <sam.yang@sun.com> | 2005-11-28 14:55:00 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2005-11-28 14:55:00 +0800 |
commit | e9522629d62cec1241ebae043f3cf6ffd9bae06a (patch) | |
tree | d19528502bd84a9fc0a6090ef2c373dd93ddbac8 /mail/em-folder-view.c | |
parent | 248813ae1ef1200d230acda258acc6d766c42ad0 (diff) | |
download | gsoc2013-evolution-e9522629d62cec1241ebae043f3cf6ffd9bae06a.tar.gz gsoc2013-evolution-e9522629d62cec1241ebae043f3cf6ffd9bae06a.tar.zst gsoc2013-evolution-e9522629d62cec1241ebae043f3cf6ffd9bae06a.zip |
** See bug #322414 Respond to the change of
2005-11-28 Sam Yang <sam.yang@sun.com>
** See bug #322414
* em-folder-view.c: (emfv_setting_notify):
Respond to the change of /apps/evolution/mail/display/show_preview
in gconf.
svn path=/trunk/; revision=30691
Diffstat (limited to 'mail/em-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 5c9dfdf830..2cba9e8f11 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -77,6 +77,7 @@ #include "em-format-html-print.h" #include "em-folder-selection.h" #include "em-folder-view.h" +#include "em-folder-browser.h" /* EMFolderBrowser stuff */ #include "em-mailer-prefs.h" #include "em-message-browser.h" #include "message-list.h" @@ -2523,6 +2524,7 @@ enum { EMFV_MARK_SEEN_TIMEOUT, EMFV_LOAD_HTTP, EMFV_HEADERS, + EMFV_SHOW_PREVIEW, EMFV_SETTINGS /* last, for loop count */ }; @@ -2538,6 +2540,7 @@ static const char * const emfv_display_keys[] = { "mark_seen_timeout", "load_http_images", "headers", + "show_preview", }; static GHashTable *emfv_setting_key; @@ -2628,6 +2631,27 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold if (emf->message) em_format_redraw(emf); break; } + case EMFV_SHOW_PREVIEW: { + gboolean state_gconf, state_camel; + char *ret; + + /* If emfv->folder hasn't been initialized, do nothing */ + if (!emfv->folder) + return; + state_gconf = gconf_value_get_bool (value); + ret = camel_object_meta_get (emfv->folder, "evolution:show_preview"); + if (ret){ + state_camel = (ret[0] != '0'); + g_free (ret); + if (state_gconf == state_camel) + return; + } + + if (camel_object_meta_set (emfv->folder, "evolution:show_preview", state_gconf ? "1\0" : "0\0")) + camel_object_state_write (emfv->folder); + em_folder_browser_show_preview ((EMFolderBrowser *)emfv, state_gconf); + bonobo_ui_component_set_prop (emfv->uic, "/commands/ViewPreview", "state", state_gconf ? "1" : "0", NULL); + break;} } } |