diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-03 23:20:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-17 20:49:12 +0800 |
commit | 95a0ae4afb72b534c991fbcd774733a93f256514 (patch) | |
tree | 32293990fecd6a4a6401370e2a5aa355c6454022 /modules/settings | |
parent | 23b89997658a8eb8bd2e1d9d20234a6978880aae (diff) | |
download | gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.gz gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.bz2 gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.lz gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.xz gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.tar.zst gsoc2013-evolution-95a0ae4afb72b534c991fbcd774733a93f256514.zip |
Remove ECalShellSettings.
EShellSettings predates GSettings and is no longer necessary.
GSettings allows binding GObject properties to GSettings keys,
with optional mapping functions. That fulfills the purpose of
EShellSettings.
Diffstat (limited to 'modules/settings')
-rw-r--r-- | modules/settings/e-settings-cal-model.c | 179 | ||||
-rw-r--r-- | modules/settings/e-settings-calendar-item.c | 22 | ||||
-rw-r--r-- | modules/settings/e-settings-calendar-view.c | 52 | ||||
-rw-r--r-- | modules/settings/e-settings-client-cache.c | 49 | ||||
-rw-r--r-- | modules/settings/e-settings-comp-editor.c | 83 | ||||
-rw-r--r-- | modules/settings/e-settings-date-edit.c | 28 | ||||
-rw-r--r-- | modules/settings/e-settings-meeting-store.c | 65 | ||||
-rw-r--r-- | modules/settings/e-settings-meeting-time-selector.c | 15 | ||||
-rw-r--r-- | modules/settings/e-settings-weekday-chooser.c | 15 |
9 files changed, 314 insertions, 194 deletions
diff --git a/modules/settings/e-settings-cal-model.c b/modules/settings/e-settings-cal-model.c index b973ebdc21..821f3b1165 100644 --- a/modules/settings/e-settings-cal-model.c +++ b/modules/settings/e-settings-cal-model.c @@ -22,7 +22,6 @@ #include "e-settings-cal-model.h" -#include <shell/e-shell.h> #include <calendar/gui/e-cal-model.h> #include <calendar/gui/e-cal-model-tasks.h> @@ -39,142 +38,174 @@ G_DEFINE_DYNAMIC_TYPE ( e_settings_cal_model, E_TYPE_EXTENSION) +static gboolean +settings_map_string_to_icaltimezone (GValue *value, + GVariant *variant, + gpointer user_data) +{ + GSettings *settings; + const gchar *location = NULL; + icaltimezone *timezone = NULL; + + settings = g_settings_new ("org.gnome.evolution.calendar"); + + if (g_settings_get_boolean (settings, "use-system-timezone")) + timezone = e_cal_util_get_system_timezone (); + else + location = g_variant_get_string (variant, NULL); + + if (location != NULL && *location != '\0') + timezone = icaltimezone_get_builtin_timezone (location); + + if (timezone == NULL) + timezone = icaltimezone_get_utc_timezone (); + + g_value_set_pointer (value, timezone); + + g_object_unref (settings); + + return TRUE; +} + static void settings_cal_model_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); /*** ECalModel ***/ - g_object_bind_property ( - shell_settings, "cal-compress-weekend", + g_settings_bind ( + settings, "compress-weekend", extensible, "compress-weekend", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-confirm-delete", + g_settings_bind ( + settings, "confirm-delete", extensible, "confirm-delete", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-default-reminder-interval", + g_settings_bind ( + settings, "default-reminder-interval", extensible, "default-reminder-interval", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-default-reminder-units", + g_settings_bind ( + settings, "default-reminder-units", extensible, "default-reminder-units", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-timezone", + g_settings_bind_with_mapping ( + settings, "timezone", extensible, "timezone", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET, + settings_map_string_to_icaltimezone, + NULL, /* one-way binding */ + NULL, (GDestroyNotify) NULL); - g_object_bind_property ( - shell_settings, "cal-use-24-hour-format", + g_settings_bind ( + settings, "use-24hour-format", extensible, "use-24-hour-format", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-use-default-reminder", + g_settings_bind ( + settings, "use-default-reminder", extensible, "use-default-reminder", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-week-start-day", + g_settings_bind ( + settings, "week-start-day-name", extensible, "week-start-day", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-monday", + g_settings_bind ( + settings, "work-day-monday", extensible, "work-day-monday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-tuesday", + g_settings_bind ( + settings, "work-day-tuesday", extensible, "work-day-tuesday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-wednesday", + g_settings_bind ( + settings, "work-day-wednesday", extensible, "work-day-wednesday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-thursday", + g_settings_bind ( + settings, "work-day-thursday", extensible, "work-day-thursday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-friday", + g_settings_bind ( + settings, "work-day-friday", extensible, "work-day-friday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-saturday", + g_settings_bind ( + settings, "work-day-saturday", extensible, "work-day-saturday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-working-days-sunday", + g_settings_bind ( + settings, "work-day-sunday", extensible, "work-day-sunday", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-end-hour", + g_settings_bind ( + settings, "day-end-hour", extensible, "work-day-end-hour", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-end-minute", + g_settings_bind ( + settings, "day-end-minute", extensible, "work-day-end-minute", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-start-hour", + g_settings_bind ( + settings, "day-start-hour", extensible, "work-day-start-hour", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-start-minute", + g_settings_bind ( + settings, "day-start-minute", extensible, "work-day-start-minute", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); /*** ECalModelTasks ***/ if (E_IS_CAL_MODEL_TASKS (extensible)) { - g_object_bind_property ( - shell_settings, "cal-tasks-highlight-due-today", + g_settings_bind ( + settings, "task-due-today-highlight", extensible, "highlight-due-today", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-tasks-color-due-today", + g_settings_bind ( + settings, "task-due-today-color", extensible, "color-due-today", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-tasks-highlight-overdue", + g_settings_bind ( + settings, "task-overdue-highlight", extensible, "highlight-overdue", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-tasks-color-overdue", + g_settings_bind ( + settings, "task-overdue-color", extensible, "color-overdue", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); } + g_object_unref (settings); + /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_cal_model_parent_class)-> constructed (object); diff --git a/modules/settings/e-settings-calendar-item.c b/modules/settings/e-settings-calendar-item.c index ae3c37b4ae..14420b8a57 100644 --- a/modules/settings/e-settings-calendar-item.c +++ b/modules/settings/e-settings-calendar-item.c @@ -22,7 +22,7 @@ #include "e-settings-calendar-item.h" -#include <shell/e-shell.h> +#include <e-util/e-util.h> #define E_SETTINGS_CALENDAR_ITEM_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -42,24 +42,24 @@ settings_calendar_item_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-show-week-numbers", + g_settings_bind ( + settings, "show-week-numbers", extensible, "show-week-numbers", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-week-start-day", + g_settings_bind ( + settings, "week-start-day-name", extensible, "week-start-day", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_calendar_item_parent_class)-> diff --git a/modules/settings/e-settings-calendar-view.c b/modules/settings/e-settings-calendar-view.c index 12614e6fd9..e35b5dd514 100644 --- a/modules/settings/e-settings-calendar-view.c +++ b/modules/settings/e-settings-calendar-view.c @@ -22,7 +22,6 @@ #include "e-settings-calendar-view.h" -#include <shell/e-shell.h> #include <calendar/gui/e-day-view.h> #include <calendar/gui/e-week-view.h> @@ -44,61 +43,60 @@ settings_calendar_view_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-time-divisions", + g_settings_bind ( + settings, "time-divisions", extensible, "time-divisions", - G_BINDING_BIDIRECTIONAL | - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_DEFAULT); /*** EDayView ***/ if (E_IS_DAY_VIEW (extensible)) { - g_object_bind_property ( - shell_settings, "cal-show-week-numbers", + g_settings_bind ( + settings, "show-week-numbers", E_DAY_VIEW (extensible)->week_number_label, "visible", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-marcus-bains-show-line", + g_settings_bind ( + settings, "marcus-bains-line", extensible, "marcus-bains-show-line", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-marcus-bains-day-view-color", + g_settings_bind ( + settings, "marcus-bains-color-dayview", extensible, "marcus-bains-day-view-color", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-marcus-bains-time-bar-color", + g_settings_bind ( + settings, "marcus-bains-color-timebar", extensible, "marcus-bains-time-bar-color", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); } /*** EWeekView ***/ if (E_IS_WEEK_VIEW (extensible)) { - g_object_bind_property ( - shell_settings, "cal-compress-weekend", + g_settings_bind ( + settings, "compress-weekend", extensible, "compress-weekend", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-show-event-end-times", + g_settings_bind ( + settings, "show-event-end", extensible, "show-event-end-times", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); } + g_object_unref (settings); + /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_calendar_view_parent_class)-> constructed (object); diff --git a/modules/settings/e-settings-client-cache.c b/modules/settings/e-settings-client-cache.c index 809678a513..8d74af6023 100644 --- a/modules/settings/e-settings-client-cache.c +++ b/modules/settings/e-settings-client-cache.c @@ -21,7 +21,6 @@ #include "e-settings-client-cache.h" #include <e-util/e-util.h> -#include <shell/e-shell.h> #define E_SETTINGS_CLIENT_CACHE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -36,21 +35,53 @@ G_DEFINE_DYNAMIC_TYPE ( e_settings_client_cache, E_TYPE_EXTENSION) +static gboolean +settings_map_string_to_icaltimezone (GValue *value, + GVariant *variant, + gpointer user_data) +{ + GSettings *settings; + const gchar *location = NULL; + icaltimezone *timezone = NULL; + + settings = g_settings_new ("org.gnome.evolution.calendar"); + + if (g_settings_get_boolean (settings, "use-system-timezone")) + timezone = e_cal_util_get_system_timezone (); + else + location = g_variant_get_string (variant, NULL); + + if (location != NULL && *location != '\0') + timezone = icaltimezone_get_builtin_timezone (location); + + if (timezone == NULL) + timezone = icaltimezone_get_utc_timezone (); + + g_value_set_pointer (value, timezone); + + g_object_unref (settings); + + return TRUE; +} + static void settings_client_cache_client_created_cb (EClientCache *client_cache, EClient *client) { - EShell *shell; - EShellSettings *shell_settings; + if (E_IS_CAL_CLIENT (client)) { + GSettings *settings; - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - if (E_IS_CAL_CLIENT (client)) { - g_object_bind_property ( - shell_settings, "cal-timezone", + g_settings_bind_with_mapping ( + settings, "timezone", client, "default-timezone", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET, + settings_map_string_to_icaltimezone, + NULL, /* one-way binding */ + NULL, (GDestroyNotify) NULL); + + g_object_unref (settings); } } diff --git a/modules/settings/e-settings-comp-editor.c b/modules/settings/e-settings-comp-editor.c index 574b1fb569..b783abf96b 100644 --- a/modules/settings/e-settings-comp-editor.c +++ b/modules/settings/e-settings-comp-editor.c @@ -22,7 +22,6 @@ #include "e-settings-comp-editor.h" -#include <shell/e-shell.h> #include <calendar/gui/dialogs/comp-editor.h> #define E_SETTINGS_COMP_EDITOR_GET_PRIVATE(obj) \ @@ -38,54 +37,86 @@ G_DEFINE_DYNAMIC_TYPE ( e_settings_comp_editor, E_TYPE_EXTENSION) +static gboolean +settings_map_string_to_icaltimezone (GValue *value, + GVariant *variant, + gpointer user_data) +{ + GSettings *settings; + const gchar *location = NULL; + icaltimezone *timezone = NULL; + + settings = g_settings_new ("org.gnome.evolution.calendar"); + + if (g_settings_get_boolean (settings, "use-system-timezone")) + timezone = e_cal_util_get_system_timezone (); + else + location = g_variant_get_string (variant, NULL); + + if (location != NULL && *location != '\0') + timezone = icaltimezone_get_builtin_timezone (location); + + if (timezone == NULL) + timezone = icaltimezone_get_utc_timezone (); + + g_value_set_pointer (value, timezone); + + g_object_unref (settings); + + return TRUE; +} + static void settings_comp_editor_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-timezone", + g_settings_bind_with_mapping ( + settings, "timezone", extensible, "timezone", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET, + settings_map_string_to_icaltimezone, + NULL, /* one-way binding */ + NULL, (GDestroyNotify) NULL); - g_object_bind_property ( - shell_settings, "cal-use-24-hour-format", + g_settings_bind ( + settings, "use-24hour-format", extensible, "use-24-hour-format", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-week-start-day", + g_settings_bind ( + settings, "week-start-day-name", extensible, "week-start-day", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-end-hour", + g_settings_bind ( + settings, "day-end-hour", extensible, "work-day-end-hour", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-end-minute", + g_settings_bind ( + settings, "day-end-minute", extensible, "work-day-end-minute", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-start-hour", + g_settings_bind ( + settings, "day-start-hour", extensible, "work-day-start-hour", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-work-day-start-minute", + g_settings_bind ( + settings, "day-start-minute", extensible, "work-day-start-minute", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_comp_editor_parent_class)-> diff --git a/modules/settings/e-settings-date-edit.c b/modules/settings/e-settings-date-edit.c index b7549a9425..5e9e04e3f9 100644 --- a/modules/settings/e-settings-date-edit.c +++ b/modules/settings/e-settings-date-edit.c @@ -22,7 +22,7 @@ #include "e-settings-date-edit.h" -#include <shell/e-shell.h> +#include <e-util/e-util.h> #define E_SETTINGS_DATE_EDIT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -42,29 +42,29 @@ settings_date_edit_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-show-week-numbers", + g_settings_bind ( + settings, "show-week-numbers", extensible, "show-week-numbers", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-use-24-hour-format", + g_settings_bind ( + settings, "use-24hour-format", extensible, "use-24-hour-format", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-week-start-day", + g_settings_bind ( + settings, "week-start-day-name", extensible, "week-start-day", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_date_edit_parent_class)-> diff --git a/modules/settings/e-settings-meeting-store.c b/modules/settings/e-settings-meeting-store.c index a932cfcf86..725ebcb202 100644 --- a/modules/settings/e-settings-meeting-store.c +++ b/modules/settings/e-settings-meeting-store.c @@ -22,7 +22,6 @@ #include "e-settings-meeting-store.h" -#include <shell/e-shell.h> #include <calendar/gui/e-meeting-store.h> #define E_SETTINGS_MEETING_STORE_GET_PRIVATE(obj) \ @@ -38,39 +37,71 @@ G_DEFINE_DYNAMIC_TYPE ( e_settings_meeting_store, E_TYPE_EXTENSION) +static gboolean +settings_map_string_to_icaltimezone (GValue *value, + GVariant *variant, + gpointer user_data) +{ + GSettings *settings; + const gchar *location = NULL; + icaltimezone *timezone = NULL; + + settings = g_settings_new ("org.gnome.evolution.calendar"); + + if (g_settings_get_boolean (settings, "use-system-timezone")) + timezone = e_cal_util_get_system_timezone (); + else + location = g_variant_get_string (variant, NULL); + + if (location != NULL && *location != '\0') + timezone = icaltimezone_get_builtin_timezone (location); + + if (timezone == NULL) + timezone = icaltimezone_get_utc_timezone (); + + g_value_set_pointer (value, timezone); + + g_object_unref (settings); + + return TRUE; +} + static void settings_meeting_store_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-default-reminder-interval", + g_settings_bind ( + settings, "default-reminder-interval", extensible, "default-reminder-interval", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-default-reminder-units", + g_settings_bind ( + settings, "default-reminder-units", extensible, "default-reminder-units", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-free-busy-template", + g_settings_bind ( + settings, "publish-template", extensible, "free-busy-template", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); - g_object_bind_property ( - shell_settings, "cal-timezone", + g_settings_bind_with_mapping ( + settings, "timezone", extensible, "timezone", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET, + settings_map_string_to_icaltimezone, + NULL, /* one-way binding */ + NULL, (GDestroyNotify) NULL); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_meeting_store_parent_class)-> diff --git a/modules/settings/e-settings-meeting-time-selector.c b/modules/settings/e-settings-meeting-time-selector.c index f6d9cef614..95b5dea967 100644 --- a/modules/settings/e-settings-meeting-time-selector.c +++ b/modules/settings/e-settings-meeting-time-selector.c @@ -22,7 +22,6 @@ #include "e-settings-meeting-time-selector.h" -#include <shell/e-shell.h> #include <calendar/gui/e-meeting-time-sel.h> #define E_SETTINGS_MEETING_TIME_SELECTOR_GET_PRIVATE(obj) \ @@ -43,19 +42,19 @@ settings_meeting_time_selector_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-use-24-hour-format", + g_settings_bind ( + settings, "use-24hour-format", extensible, "use-24-hour-format", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_meeting_time_selector_parent_class)-> diff --git a/modules/settings/e-settings-weekday-chooser.c b/modules/settings/e-settings-weekday-chooser.c index e4b92d73c5..594a459228 100644 --- a/modules/settings/e-settings-weekday-chooser.c +++ b/modules/settings/e-settings-weekday-chooser.c @@ -18,7 +18,6 @@ #include "e-settings-weekday-chooser.h" -#include <shell/e-shell.h> #include <calendar/gui/e-weekday-chooser.h> #define E_SETTINGS_WEEKDAY_CHOOSER_GET_PRIVATE(obj) \ @@ -39,19 +38,19 @@ settings_weekday_chooser_constructed (GObject *object) { EExtension *extension; EExtensible *extensible; - EShellSettings *shell_settings; - EShell *shell; + GSettings *settings; extension = E_EXTENSION (object); extensible = e_extension_get_extensible (extension); - shell = e_shell_get_default (); - shell_settings = e_shell_get_shell_settings (shell); + settings = g_settings_new ("org.gnome.evolution.calendar"); - g_object_bind_property ( - shell_settings, "cal-week-start-day", + g_settings_bind ( + settings, "week-start-day-name", extensible, "week-start-day", - G_BINDING_SYNC_CREATE); + G_SETTINGS_BIND_GET); + + g_object_unref (settings); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (e_settings_weekday_chooser_parent_class)-> |