[evolution/wip/gsettings] Port ETask/MemoShellContent to GSettings



commit 8732431bd961e7f75e813803575a868bada78c79
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Sep 21 18:16:23 2011 +0200

    Port ETask/MemoShellContent to GSettings

 data/evolution.convert                           |    4 ++++
 data/org.gnome.evolution.calendar.gschema.xml.in |   20 ++++++++++++++++++++
 modules/calendar/e-memo-shell-content.c          |   14 +++++---------
 modules/calendar/e-task-shell-content.c          |   15 +++++++--------
 4 files changed, 36 insertions(+), 17 deletions(-)
---
diff --git a/data/evolution.convert b/data/evolution.convert
index e9922d0..21b71cb 100644
--- a/data/evolution.convert
+++ b/data/evolution.convert
@@ -47,7 +47,9 @@ 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-hpane-position = /apps/evolution/calendar/display/memo_hpane_position
 memo-layout = /apps/evolution/calendar/display/memo_layout
+memo-vpane-position = /apps/evolution/calendar/display/memo_vpane_position
 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
@@ -56,6 +58,8 @@ selected-memos = /apps/evolution/calendar/memos/selected_memos
 selected-tasks = /apps/evolution/calendar/tasks/selected_tasks
 show-memo-preview = /apps/evolution/calendar/display/show_memo_preview
 show-task-preview = /apps/evolution/calendar/display/show_task_preview
+task-hpane-position = /apps/evolution/calendar/display/task_hpane_position
+task-vpane-position = /apps/evolution/calendar/display/task_vpane_position
 task-layout = /apps/evolution/calendar/display/task_layout
 timezone = /apps/evolution/calendar/display/timezone
 use-24hour-format = /apps/evolution/calendar/display/use_24hour_format
diff --git a/data/org.gnome.evolution.calendar.gschema.xml.in b/data/org.gnome.evolution.calendar.gschema.xml.in
index 7fb0511..12e091c 100644
--- a/data/org.gnome.evolution.calendar.gschema.xml.in
+++ b/data/org.gnome.evolution.calendar.gschema.xml.in
@@ -76,11 +76,21 @@
     <_summary>Last reminder time</_summary>
     <_description>Time the last reminder ran, in time_t</_description>
   </key>
+  <key name="memo-hpane-position" type="i">
+    <default>200</default>
+    <_summary>Memo preview pane position (horizontal)</_summary>
+    <_description>Position of the task preview pane when oriented horizontally</_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="memo-vpane-position" type="i">
+    <default>400</default>
+    <_summary>Memo preview pane position (vertical)</_summary>
+    <_description>Position of the memo preview pane when oriented vertically</_description>
+  </key>
   <key name="month-scroll-by-week" type="b">
     <default>true</default>
     <_summary>Scroll Month View by a week</_summary>
@@ -121,11 +131,21 @@
     <_summary>Show the task preview pane</_summary>
     <_description>If "true", show the task preview pane in the main window</_description>
   </key>
+  <key name="task-hpane-position" type="i">
+    <default>200</default>
+    <_summary>Task preview pane position (horizontal)</_summary>
+    <_description>Position of the task preview pane when oriented horizontally</_description>
+  </key>
   <key name="task-layout" type="i">
     <default>0</default>
     <_summary>Task layout style</_summary>
     <_description>The layout style determines where to place the preview pane in relation to the task list.  "0" (Classic View) places the preview pane below the task list.  "1" (Vertical View) places the preview pane next to the task list</_description>
   </key>
+  <key name="task-vpane-position" type="i">
+    <default>400</default>
+    <_summary>Task preview pane position (vertical)</_summary>
+    <_description>Position of the task preview pane when oriented vertically</_description>
+  </key>
   <key name="timezone" type="s">
     <default>'UTC'</default>
     <_summary>Timezone</_summary>
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index f0f4fe9..60936cc 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -28,7 +28,6 @@
 #include <glib/gi18n.h>
 
 #include "e-util/e-selection.h"
-#include "e-util/gconf-bridge.h"
 #include "shell/e-shell-utils.h"
 #include "widgets/menus/gal-view-etable.h"
 #include "widgets/misc/e-paned.h"
@@ -273,23 +272,20 @@ memo_shell_content_restore_state_cb (EShellWindow *shell_window,
                                      EShellContent *shell_content)
 {
 	EMemoShellContentPrivate *priv;
-	GConfBridge *bridge;
+	GSettings *settings;
 	GObject *object;
-	const gchar *key;
 
 	priv = E_MEMO_SHELL_CONTENT (shell_content)->priv;
 
-	/* Bind GObject properties to GConf keys. */
+	/* Bind GObject properties to settings keys. */
 
-	bridge = gconf_bridge_get ();
+	settings = g_settings_new ("org.gnome.evolution.calendar");
 
 	object = G_OBJECT (priv->paned);
-	key = "/apps/evolution/calendar/display/memo_hpane_position";
-	gconf_bridge_bind_property_delayed (bridge, key, object, "hposition");
+	g_settings_bind (settings, "memo-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT);
 
 	object = G_OBJECT (priv->paned);
-	key = "/apps/evolution/calendar/display/memo_vpane_position";
-	gconf_bridge_bind_property_delayed (bridge, key, object, "vposition");
+	g_settings_bind (settings, "memo-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT);
 }
 
 static GtkOrientation
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index 743bb93..80e9239 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -271,23 +271,22 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window,
                                      EShellContent *shell_content)
 {
 	ETaskShellContentPrivate *priv;
-	GConfBridge *bridge;
+	GSettings *settings;
 	GObject *object;
-	const gchar *key;
 
 	priv = E_TASK_SHELL_CONTENT (shell_content)->priv;
 
-	/* Bind GObject properties to GConf keys. */
+	/* Bind GObject properties to settings keys. */
 
-	bridge = gconf_bridge_get ();
+	settings = g_settings_new ("org.gnome.evolution.calendar");
 
 	object = G_OBJECT (priv->paned);
-	key = "/apps/evolution/calendar/display/task_hpane_position";
-	gconf_bridge_bind_property_delayed (bridge, key, object, "hposition");
+	g_settings_bind (settings, "task-hpane-position", object, "hposition", G_SETTINGS_BIND_DEFAULT);
 
 	object = G_OBJECT (priv->paned);
-	key = "/apps/evolution/calendar/display/task_vpane_position";
-	gconf_bridge_bind_property_delayed (bridge, key, object, "vposition");
+	g_settings_bind (settings, "task-vpane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT);
+
+	g_object_unref (G_OBJECT (settings));
 }
 
 static GtkOrientation



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