aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-folder-view.c24
2 files changed, 31 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e48bbac5de..1c3248e773 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2005-11-25 Tor Lillqvist <tml@novell.com>
* em-composer-prefs.c (sig_add_script_response): Use gstdio
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;}
}
}