[evolution-patches] [evolution patch] Patch to making evolution respond to change in gconf



Hi,

The attached patch tries to make evolution respect and respond to the
change of /apps/evolution/mail/display/show_preview in gconf. Thus
helping to implement central management. Fixes #322414.

Please review it.

Thanks,
Sam
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3726
diff -u -r1.3726 ChangeLog
--- ChangeLog	23 Nov 2005 06:46:51 -0000	1.3726
+++ ChangeLog	25 Nov 2005 10:31:29 -0000
@@ -1,3 +1,9 @@
+2005-11-25  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-23  Parthasarathi Susarla <sparthasarathi novell com>
 	
 	** See bug #315987
Index: em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.133
diff -u -r1.133 em-folder-view.c
--- em-folder-view.c	18 Oct 2005 08:31:39 -0000	1.133
+++ em-folder-view.c	25 Nov 2005 10:31:29 -0000
@@ -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 @@
 	EMFV_MARK_SEEN_TIMEOUT,
 	EMFV_LOAD_HTTP,
 	EMFV_HEADERS,
+	EMFV_SHOW_PREVIEW,
 	EMFV_SETTINGS		/* last, for loop count */
 };
 
@@ -2538,6 +2540,7 @@
 	"mark_seen_timeout",
 	"load_http_images",
 	"headers",
+	"show_preview",
 };
 
 static GHashTable *emfv_setting_key;
@@ -2628,6 +2631,27 @@
 		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;}
 	}
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]