[evolution/wip/gsettings] Port e-memo-shell-view-actions.c to use GSettings



commit 5226e534df877dcb10b8f5cbb581764bb679593c
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Sep 21 16:30:48 2011 +0200

    Port e-memo-shell-view-actions.c to use GSettings

 data/evolution.convert                           |    2 ++
 data/org.gnome.evolution.calendar.gschema.xml.in |   10 ++++++++++
 modules/calendar/e-memo-shell-view-actions.c     |   14 +++++++-------
 3 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/data/evolution.convert b/data/evolution.convert
index bfea9dc..099b200 100644
--- a/data/evolution.convert
+++ b/data/evolution.convert
@@ -46,9 +46,11 @@ hide-completed-tasks = /apps/evolution/calendar/tasks/hide_completed
 hide-completed-tasks-units = /apps/evolution/calendar/tasks/hide_completed_units
 hide-completed-tasks-value = /apps/evolution/calendar/tasks/hide_completed_value
 last-notification-time = /apps/evolution/calendar/notify/last_notification_time
+memo-layout = /apps/evolution/calendar/display/memo_layout
 month-scroll-by-week = /apps/evolution/calendar/display/month_scroll_by_week
 notify-programs = /apps/evolution/calendar/notify/programs
 notify-with-tray = /apps/evolution/calendar/notify/notify_with_tray
+show-memo-preview = /apps/evolution/calendar/display/show_memo_preview
 timezone = /apps/evolution/calendar/display/timezone
 use-24hour-format = /apps/evolution/calendar/display/use_24hour_format
 use-system-timezone = /apps/evolution/calendar/display/use_system_timezone
diff --git a/data/org.gnome.evolution.calendar.gschema.xml.in b/data/org.gnome.evolution.calendar.gschema.xml.in
index 70a13b9..df27b45 100644
--- a/data/org.gnome.evolution.calendar.gschema.xml.in
+++ b/data/org.gnome.evolution.calendar.gschema.xml.in
@@ -71,6 +71,11 @@
     <_summary>Last reminder time</_summary>
     <_description>Time the last reminder ran, in time_t</_description>
   </key>
+  <key name="memo-layout" type="i">
+    <default>0</default>
+    <_summary>Memo layout style</_summary>
+    <_description>The layout style determines where to place the preview pane in relation to the memo list.  "0" (Classic View) places the preview pane below the memo list.  "1" (Vertical View) places the preview pane next to the memo list</_description>
+  </key>
   <key name="month-scroll-by-week" type="b">
     <default>true</default>
     <_summary>Scroll Month View by a week</_summary>
@@ -86,6 +91,11 @@
     <_summary>Show display reminders in notification tray</_summary>
     <_description>Whether or not to use the notification tray for display reminders</_description>
   </key>
+  <key name="show-memo-preview" type="b">
+    <default>true</default>
+    <_summary>Show the memo preview pane</_summary>
+    <_description>If "true", show the memo preview pane in the main window</_description>
+  </key>
   <key name="timezone" type="s">
     <default>'UTC'</default>
     <_summary>Timezone</_summary>
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index d71b893..c780729 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -863,7 +863,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
 	EPreviewPane *preview_pane;
 	EWebView *web_view;
 	GtkActionGroup *action_group;
-	GConfBridge *bridge;
+	GSettings *memo_settings;
 	GtkAction *action;
 	GObject *object;
 	const gchar *key;
@@ -922,17 +922,17 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
 		action_group, lockdown_save_to_disk_popup_entries,
 		G_N_ELEMENTS (lockdown_save_to_disk_popup_entries));
 
-	/* Bind GObject properties to GConf keys. */
+	/* Bind GObject properties to settings keys. */
 
-	bridge = gconf_bridge_get ();
+	memo_settings = g_settings_new ("org.gnome.evolution.calendar");
 
 	object = G_OBJECT (ACTION (MEMO_PREVIEW));
-	key = "/apps/evolution/calendar/display/show_memo_preview";
-	gconf_bridge_bind_property (bridge, key, object, "active");
+	g_settings_bind (memo_settings, "show-memo-preview", object, "active");
 
 	object = G_OBJECT (ACTION (MEMO_VIEW_VERTICAL));
-	key = "/apps/evolution/calendar/display/memo_layout";
-	gconf_bridge_bind_property (bridge, key, object, "current-value");
+	g_settings_bind (memo_settings, "memo-layout", object, "current-value");
+
+	g_object_unref (G_OBJECT (memo_settings));
 
 	/* Fine tuning. */
 



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