diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 09:48:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 09:48:44 +0800 |
commit | 9918361aef9ad1360a0ed3a240cc58d6cd9e30f8 (patch) | |
tree | 50bf24934b5ab3fefcc27913d1855a27c75e6d40 /modules/calendar | |
parent | fa1bb9a17e11cf12ce02d9b49bba2753f6020ea0 (diff) | |
parent | e64d6fe05c30c2cc1d7625a202afba3ba2da07cd (diff) | |
download | gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.gz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.bz2 gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.lz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.xz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.zst gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.zip |
Merge branch 'wip/gsettings'
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 41 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-content.c | 33 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-settings.c | 108 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 13 | ||||
-rw-r--r-- | modules/calendar/e-calendar-preferences.c | 16 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-backend.c | 41 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-content.c | 14 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 15 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-backend.c | 41 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 16 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-actions.c | 15 |
11 files changed, 203 insertions, 150 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 5693994277..af1ca215fd 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -901,18 +901,24 @@ e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend) GSList * e_cal_shell_backend_get_selected_calendars (ECalShellBackend *cal_shell_backend) { - GConfClient *client; - GSList *selected_calendars; - const gchar *key; + GSettings *settings; + GSList *selected_calendars = NULL; + gchar **strv; + gint ii; g_return_val_if_fail ( E_IS_CAL_SHELL_BACKEND (cal_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - selected_calendars = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-calendars"); + g_object_unref (settings); + + if (strv != NULL) { + for (ii = 0; strv[ii] != NULL; ii++) + selected_calendars = g_slist_append (selected_calendars, g_strdup (strv[ii])); + + g_strfreev (strv); + } return selected_calendars; } @@ -921,16 +927,21 @@ void e_cal_shell_backend_set_selected_calendars (ECalShellBackend *cal_shell_backend, GSList *selected_calendars) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *link; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_CAL_SHELL_BACKEND (cal_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/display/selected_calendars"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_calendars, NULL); - g_object_unref (client); + for (link = selected_calendars; link != NULL; link = link->next) + g_ptr_array_add (array, link->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-calendars", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } void diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 81fc76b3cb..e2e1ce58cf 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -28,7 +28,6 @@ #include <string.h> #include <glib/gi18n.h> -#include "e-util/gconf-bridge.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" #include "widgets/misc/e-selectable.h" @@ -53,8 +52,6 @@ struct _ECalShellContentPrivate { GtkWidget *memo_table; GalViewInstance *view_instance; - - guint paned_binding_id; }; enum { @@ -111,32 +108,28 @@ cal_shell_content_notify_view_id_cb (ECalShellContent *cal_shell_content) { EShellContent *shell_content; EShellView *shell_view; - GConfBridge *bridge; + GSettings *settings; GtkWidget *paned; - guint binding_id; const gchar *key; const gchar *view_id; - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); paned = cal_shell_content->priv->hpaned; - binding_id = cal_shell_content->priv->paned_binding_id; shell_content = E_SHELL_CONTENT (cal_shell_content); shell_view = e_shell_content_get_shell_view (shell_content); view_id = e_shell_view_get_view_id (shell_view); - if (binding_id > 0) - gconf_bridge_unbind (bridge, binding_id); - if (view_id != NULL && strcmp (view_id, "Month_View") == 0) - key = "/apps/evolution/calendar/display/month_hpane_position"; + key = "month-hpane-position"; else - key = "/apps/evolution/calendar/display/hpane_position"; + key = "hpane-position"; + + g_settings_unbind (settings, key); - binding_id = gconf_bridge_bind_property_delayed ( - bridge, key, G_OBJECT (paned), "hposition"); + g_settings_bind (settings, key, G_OBJECT (paned), "hposition", G_SETTINGS_BIND_DEFAULT); - cal_shell_content->priv->paned_binding_id = binding_id; + g_object_unref (settings); } static gchar * @@ -332,10 +325,9 @@ cal_shell_content_constructed (GObject *object) EShellView *foreign_view; GnomeCalendar *calendar; GalViewInstance *view_instance; - GConfBridge *bridge; + GSettings *settings; GtkWidget *container; GtkWidget *widget; - const gchar *key; gchar *markup; gint ii; @@ -521,11 +513,12 @@ cal_shell_content_constructed (GObject *object) G_CALLBACK (cal_shell_content_notify_view_id_cb), object); - bridge = gconf_bridge_get (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (priv->vpaned); - key = "/apps/evolution/calendar/display/tag_vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "proportion"); + g_settings_bind (settings, "tag-vpane-position", object, "proportion", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (settings); } if (memo_model) diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c index 456f95707c..88b961e64f 100644 --- a/modules/calendar/e-cal-shell-settings.c +++ b/modules/calendar/e-cal-shell-settings.c @@ -25,12 +25,13 @@ #include "e-cal-shell-settings.h" -#include <gconf/gconf-client.h> #include <libecal/e-cal-util.h> #include <e-util/e-util.h> #include <e-util/e-util-enumtypes.h> +#define CALENDAR_SCHEMA "org.gnome.evolution.calendar" + static gboolean transform_string_to_icaltimezone (GBinding *binding, const GValue *source_value, @@ -524,149 +525,184 @@ e_cal_shell_backend_init_settings (EShell *shell) e_shell_settings_install_property_for_key ( "cal-ba-reminder-interval", - "/apps/evolution/calendar/other/ba_reminder_interval"); + CALENDAR_SCHEMA, + "ba-reminder-interval"); e_shell_settings_install_property_for_key ( "cal-ba-reminder-units-string", - "/apps/evolution/calendar/other/ba_reminder_units"); + CALENDAR_SCHEMA, + "ba-reminder-units"); e_shell_settings_install_property_for_key ( "cal-compress-weekend", - "/apps/evolution/calendar/display/compress_weekend"); + CALENDAR_SCHEMA, + "compress-weekend"); e_shell_settings_install_property_for_key ( "cal-confirm-delete", - "/apps/evolution/calendar/prompts/confirm_delete"); + CALENDAR_SCHEMA, + "confirm-delete"); e_shell_settings_install_property_for_key ( "cal-confirm-purge", - "/apps/evolution/calendar/prompts/confirm_purge"); + CALENDAR_SCHEMA, + "confirm-purge"); e_shell_settings_install_property_for_key ( "cal-default-reminder-interval", - "/apps/evolution/calendar/other/default_reminder_interval"); + CALENDAR_SCHEMA, + "default-reminder-interval"); /* Do not bind to this. * Use "cal-default-reminder-units" instead. */ e_shell_settings_install_property_for_key ( "cal-default-reminder-units-string", - "/apps/evolution/calendar/other/default_reminder_units"); + CALENDAR_SCHEMA, + "default-reminder-units"); e_shell_settings_install_property_for_key ( "cal-free-busy-template", - "/apps/evolution/calendar/publish/template"); + CALENDAR_SCHEMA, + "publish-template"); e_shell_settings_install_property_for_key ( "cal-hide-completed-tasks", - "/apps/evolution/calendar/tasks/hide_completed"); + CALENDAR_SCHEMA, + "hide-completed-tasks"); /* Do not bind to this. * Use "cal-hide-completed-tasks-units" instead. */ e_shell_settings_install_property_for_key ( "cal-hide-completed-tasks-units-string", - "/apps/evolution/calendar/tasks/hide_completed_units"); + CALENDAR_SCHEMA, + "hide-completed-tasks-units"); e_shell_settings_install_property_for_key ( "cal-hide-completed-tasks-value", - "/apps/evolution/calendar/tasks/hide_completed_value"); + CALENDAR_SCHEMA, + "hide-completed-tasks-value"); e_shell_settings_install_property_for_key ( "cal-marcus-bains-day-view-color", - "/apps/evolution/calendar/display/marcus_bains_color_dayview"); + CALENDAR_SCHEMA, + "marcus-bains-color-dayview"); e_shell_settings_install_property_for_key ( "cal-marcus-bains-time-bar-color", - "/apps/evolution/calendar/display/marcus_bains_color_timebar"); + CALENDAR_SCHEMA, + "marcus-bains-color-timebar"); e_shell_settings_install_property_for_key ( "cal-marcus-bains-show-line", - "/apps/evolution/calendar/display/marcus_bains_line"); + CALENDAR_SCHEMA, + "marcus-bains-line"); e_shell_settings_install_property_for_key ( "cal-month-scroll-by-week", - "/apps/evolution/calendar/display/month_scroll_by_week"); + CALENDAR_SCHEMA, + "month-scroll-by-week"); e_shell_settings_install_property_for_key ( "cal-primary-calendar", - "/apps/evolution/calendar/display/primary_calendar"); + CALENDAR_SCHEMA, + "primary-calendar"); e_shell_settings_install_property_for_key ( "cal-primary-memo-list", - "/apps/evolution/calendar/memos/primary_memos"); + CALENDAR_SCHEMA, + "primary-memos"); e_shell_settings_install_property_for_key ( "cal-primary-task-list", - "/apps/evolution/calendar/tasks/primary_tasks"); + CALENDAR_SCHEMA, + "primary-tasks"); e_shell_settings_install_property_for_key ( "cal-recur-events-italic", - "/apps/evolution/calendar/display/recur_events_italic"); + CALENDAR_SCHEMA, + "recur-events-italic"); e_shell_settings_install_property_for_key ( "cal-show-event-end-times", - "/apps/evolution/calendar/display/show_event_end"); + CALENDAR_SCHEMA, + "show-event-end"); e_shell_settings_install_property_for_key ( "cal-show-week-numbers", - "/apps/evolution/calendar/display/show_week_numbers"); + CALENDAR_SCHEMA, + "show-week-numbers"); e_shell_settings_install_property_for_key ( "cal-tasks-color-due-today", - "/apps/evolution/calendar/tasks/colors/due_today"); + CALENDAR_SCHEMA, + "task-due-today-color"); e_shell_settings_install_property_for_key ( "cal-tasks-color-overdue", - "/apps/evolution/calendar/tasks/colors/overdue"); + CALENDAR_SCHEMA, + "task-overdue-color"); e_shell_settings_install_property_for_key ( "cal-time-divisions", - "/apps/evolution/calendar/display/time_divisions"); + CALENDAR_SCHEMA, + "time-divisions"); /* Do not bind to this. Use "cal-timezone" instead. */ e_shell_settings_install_property_for_key ( "cal-timezone-string", - "/apps/evolution/calendar/display/timezone"); + CALENDAR_SCHEMA, + "timezone"); e_shell_settings_install_property_for_key ( "cal-use-24-hour-format", - "/apps/evolution/calendar/display/use_24hour_format"); + CALENDAR_SCHEMA, + "use-24hour-format"); e_shell_settings_install_property_for_key ( "cal-use-ba-reminder", - "/apps/evolution/calendar/other/use_ba_reminder"); + CALENDAR_SCHEMA, + "use-ba-reminder"); e_shell_settings_install_property_for_key ( "cal-use-default-reminder", - "/apps/evolution/calendar/other/use_default_reminder"); + CALENDAR_SCHEMA, + "use-default-reminder"); e_shell_settings_install_property_for_key ( "cal-use-system-timezone", - "/apps/evolution/calendar/display/use_system_timezone"); + CALENDAR_SCHEMA, + "use-system-timezone"); /* Do not bind to this. Use "cal-week-start-day" instead. */ e_shell_settings_install_property_for_key ( "cal-week-start-day-gconf", - "/apps/evolution/calendar/display/week_start_day"); + CALENDAR_SCHEMA, + "week-start-day"); e_shell_settings_install_property_for_key ( "cal-work-day-end-hour", - "/apps/evolution/calendar/display/day_end_hour"); + CALENDAR_SCHEMA, + "day-end-hour"); e_shell_settings_install_property_for_key ( "cal-work-day-end-minute", - "/apps/evolution/calendar/display/day_end_minute"); + CALENDAR_SCHEMA, + "day-end-minute"); e_shell_settings_install_property_for_key ( "cal-work-day-start-hour", - "/apps/evolution/calendar/display/day_start_hour"); + CALENDAR_SCHEMA, + "day-start-hour"); e_shell_settings_install_property_for_key ( "cal-work-day-start-minute", - "/apps/evolution/calendar/display/day_start_minute"); + CALENDAR_SCHEMA, + "day-start-minute"); e_shell_settings_install_property_for_key ( "cal-working-days-bitset", - "/apps/evolution/calendar/display/working_days"); + CALENDAR_SCHEMA, + "working-days"); /* These properties use transform functions to convert * GConf values to forms more useful to Evolution. We diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 77c5639a78..c73ca8ab77 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -30,7 +30,6 @@ #include <libedataserverui/e-client-utils.h> #include "e-util/e-alert-dialog.h" -#include "e-util/gconf-bridge.h" #include "widgets/misc/e-paned.h" #include "calendar/gui/e-calendar-selector.h" @@ -523,11 +522,10 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, ESourceSelector *selector; ESourceList *source_list; ESource *source; - GConfBridge *bridge; + GSettings *settings; GtkTreeModel *model; GSList *list, *iter; GObject *object; - const gchar *key; priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv; @@ -585,13 +583,14 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window, G_CALLBACK (cal_shell_sidebar_selection_changed_cb), shell_sidebar); - /* 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/date_navigator_pane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + g_settings_bind (settings, "date-navigator-pane-position", object, "vposition", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (settings)); } static void diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c index 85eddd9736..5578f39a2c 100644 --- a/modules/calendar/e-calendar-preferences.c +++ b/modules/calendar/e-calendar-preferences.c @@ -329,13 +329,13 @@ static void notify_with_tray_toggled (GtkToggleButton *toggle, ECalendarPreferences *prefs) { - GConfClient *gconf; + GSettings *settings; g_return_if_fail (toggle != NULL); - gconf = gconf_client_get_default (); - gconf_client_set_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", gtk_toggle_button_get_active (toggle), NULL); - g_object_unref (gconf); + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_boolean (settings, "notify-with-tray", gtk_toggle_button_get_active (toggle)); + g_object_unref (settings); } static void @@ -454,7 +454,7 @@ initialize_selection (ESourceSelector *selector, static void show_alarms_config (ECalendarPreferences *prefs) { - GConfClient *gconf; + GSettings *settings; if (e_cal_client_get_sources (&prefs->alarms_list, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL)) { prefs->alarm_list_widget = e_source_selector_new (prefs->alarms_list); @@ -464,9 +464,9 @@ show_alarms_config (ECalendarPreferences *prefs) initialize_selection (E_SOURCE_SELECTOR (prefs->alarm_list_widget), prefs->alarms_list); } - gconf = gconf_client_get_default (); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), gconf_client_get_bool (gconf, "/apps/evolution/calendar/notify/notify_with_tray", NULL)); - g_object_unref (gconf); + settings = g_settings_new ("org.gnome.evolution.calendar"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->notify_with_tray), g_settings_get_boolean (settings, "notify-with-tray")); + g_object_unref (settings); } /* Shows the current config settings in the dialog. */ diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c index ed4e81d559..c31689fec9 100644 --- a/modules/calendar/e-memo-shell-backend.c +++ b/modules/calendar/e-memo-shell-backend.c @@ -645,18 +645,24 @@ e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend) GSList * e_memo_shell_backend_get_selected_memo_lists (EMemoShellBackend *memo_shell_backend) { - GConfClient *client; - GSList *selected_memo_lists; - const gchar *key; + GSettings *settings; + GSList *selected_memo_lists = NULL; + gchar **strv; + gint ii; g_return_val_if_fail ( E_IS_MEMO_SHELL_BACKEND (memo_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - selected_memo_lists = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-memos"); + g_object_unref (settings); + + if (strv != NULL) { + for (ii = 0; strv[ii] != NULL; ii++) + selected_memo_lists = g_slist_append (selected_memo_lists, g_strdup (strv[ii])); + + g_strfreev (strv); + } return selected_memo_lists; } @@ -665,14 +671,19 @@ void e_memo_shell_backend_set_selected_memo_lists (EMemoShellBackend *memo_shell_backend, GSList *selected_memo_lists) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *link; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_MEMO_SHELL_BACKEND (memo_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/memos/selected_memos"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_memo_lists, NULL); - g_object_unref (client); + for (link = selected_memo_lists; link != NULL; link = link->next) + g_ptr_array_add (array, link->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-memos", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index f0f4fe958f..60936ccb8c 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-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index d71b893fe3..3a0874616f 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -863,10 +863,9 @@ 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; shell_view = E_SHELL_VIEW (memo_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -922,17 +921,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", G_SETTINGS_BIND_DEFAULT); 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_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (memo_settings)); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c index 2fc8ce1e5f..deca594c08 100644 --- a/modules/calendar/e-task-shell-backend.c +++ b/modules/calendar/e-task-shell-backend.c @@ -650,18 +650,24 @@ e_task_shell_backend_get_source_list (ETaskShellBackend *task_shell_backend) GSList * e_task_shell_backend_get_selected_task_lists (ETaskShellBackend *task_shell_backend) { - GConfClient *client; - GSList *selected_task_lists; - const gchar *key; + GSettings *settings; + GSList *selected_task_lists = NULL; + gchar **strv; + gint ii; g_return_val_if_fail ( E_IS_TASK_SHELL_BACKEND (task_shell_backend), NULL); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/tasks/selected_tasks"; - selected_task_lists = gconf_client_get_list ( - client, key, GCONF_VALUE_STRING, NULL); - g_object_unref (client); + settings = g_settings_new ("org.gnome.evolution.calendar"); + strv = g_settings_get_strv (settings, "selected-tasks"); + g_object_unref (G_OBJECT (settings)); + + if (strv != NULL) { + for (ii = 0; strv[ii] != NULL; ii++) + selected_task_lists = g_slist_append (selected_task_lists, g_strdup (strv[ii])); + + g_strfreev (strv); + } return selected_task_lists; } @@ -670,14 +676,19 @@ void e_task_shell_backend_set_selected_task_lists (ETaskShellBackend *task_shell_backend, GSList *selected_task_lists) { - GConfClient *client; - const gchar *key; + GSettings *settings; + GSList *link; + GPtrArray *array = g_ptr_array_new (); g_return_if_fail (E_IS_TASK_SHELL_BACKEND (task_shell_backend)); - client = gconf_client_get_default (); - key = "/apps/evolution/calendar/tasks/selected_tasks"; - gconf_client_set_list ( - client, key, GCONF_VALUE_STRING, selected_task_lists, NULL); - g_object_unref (client); + for (link = selected_task_lists; link != NULL; link = link->next) + g_ptr_array_add (array, link->data); + g_ptr_array_add (array, NULL); + + settings = g_settings_new ("org.gnome.evolution.calendar"); + g_settings_set_strv (settings, "selected-tasks", (const gchar *const *) array->pdata); + g_object_unref (settings); + + g_ptr_array_free (array, FALSE); } diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 743bb937e7..cb2443f19d 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-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" @@ -271,23 +270,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 diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 2fe28494ac..c7e91d2955 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1062,10 +1062,9 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) EPreviewPane *preview_pane; EWebView *web_view; GtkActionGroup *action_group; - GConfBridge *bridge; + GSettings *settings; GtkAction *action; GObject *object; - const gchar *key; shell_view = E_SHELL_VIEW (task_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); @@ -1121,17 +1120,17 @@ e_task_shell_view_actions_init (ETaskShellView *task_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 (); + settings = g_settings_new ("org.gnome.evolution.calendar"); object = G_OBJECT (ACTION (TASK_PREVIEW)); - key = "/apps/evolution/calendar/display/show_task_preview"; - gconf_bridge_bind_property (bridge, key, object, "active"); + g_settings_bind (settings, "show-task-preview", object, "active", G_SETTINGS_BIND_DEFAULT); object = G_OBJECT (ACTION (TASK_VIEW_VERTICAL)); - key = "/apps/evolution/calendar/display/task_layout"; - gconf_bridge_bind_property (bridge, key, object, "current-value"); + g_settings_bind (settings, "task-layout", object, "current-value", G_SETTINGS_BIND_DEFAULT); + + g_object_unref (G_OBJECT (settings)); /* Fine tuning. */ |