From 1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Nov 2010 11:49:38 -0400 Subject: Move calendar preferences to the calendar module. Continue replacing the use of calendar-config functions with GObject property bindings to EShellSettings properties. --- modules/calendar/e-cal-shell-settings.c | 95 +++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 3 deletions(-) (limited to 'modules/calendar/e-cal-shell-settings.c') diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c index 524157c5a9..30fc1c4fa7 100644 --- a/modules/calendar/e-cal-shell-settings.c +++ b/modules/calendar/e-cal-shell-settings.c @@ -24,6 +24,9 @@ #include #include +#include +#include + static gboolean transform_string_to_icaltimezone (GBinding *binding, const GValue *source_value, @@ -494,6 +497,14 @@ e_cal_shell_backend_init_settings (EShell *shell) shell_settings = e_shell_get_shell_settings (shell); + e_shell_settings_install_property_for_key ( + "cal-ba-reminder-interval", + "/apps/evolution/calendar/other/ba_reminder_interval"); + + e_shell_settings_install_property_for_key ( + "cal-ba-reminder-units-string", + "/apps/evolution/calendar/other/ba_reminder_units"); + e_shell_settings_install_property_for_key ( "cal-compress-weekend", "/apps/evolution/calendar/display/compress_weekend"); @@ -507,8 +518,14 @@ e_cal_shell_backend_init_settings (EShell *shell) "/apps/evolution/calendar/prompts/confirm_purge"); e_shell_settings_install_property_for_key ( - "cal-show-week-numbers", - "/apps/evolution/calendar/display/show_week_numbers"); + "cal-default-reminder-interval", + "/apps/evolution/calendar/other/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"); e_shell_settings_install_property_for_key ( "cal-free-busy-template", @@ -518,8 +535,10 @@ e_cal_shell_backend_init_settings (EShell *shell) "cal-hide-completed-tasks", "/apps/evolution/calendar/tasks/hide_completed"); + /* Do not bind to this. + * Use "cal-hide-completed-tasks-units" instead. */ e_shell_settings_install_property_for_key ( - "cal-hide-completed-tasks-units", + "cal-hide-completed-tasks-units-string", "/apps/evolution/calendar/tasks/hide_completed_units"); e_shell_settings_install_property_for_key ( @@ -538,6 +557,10 @@ e_cal_shell_backend_init_settings (EShell *shell) "cal-marcus-bains-show-line", "/apps/evolution/calendar/display/marcus_bains_line"); + e_shell_settings_install_property_for_key ( + "cal-month-scroll-by-week", + "/apps/evolution/calendar/display/month_scroll_by_week"); + e_shell_settings_install_property_for_key ( "cal-primary-calendar", "/apps/evolution/calendar/display/primary_calendar"); @@ -558,6 +581,10 @@ e_cal_shell_backend_init_settings (EShell *shell) "cal-show-event-end-times", "/apps/evolution/calendar/display/show_event_end"); + e_shell_settings_install_property_for_key ( + "cal-show-week-numbers", + "/apps/evolution/calendar/display/show_week_numbers"); + e_shell_settings_install_property_for_key ( "cal-tasks-color-due-today", "/apps/evolution/calendar/tasks/colors/due_today"); @@ -579,6 +606,14 @@ e_cal_shell_backend_init_settings (EShell *shell) "cal-use-24-hour-format", "/apps/evolution/calendar/display/use_24hour_format"); + e_shell_settings_install_property_for_key ( + "cal-use-ba-reminder", + "/apps/evolution/calendar/other/use_ba_reminder"); + + e_shell_settings_install_property_for_key ( + "cal-use-default-reminder", + "/apps/evolution/calendar/other/use_default_reminder"); + e_shell_settings_install_property_for_key ( "cal-use-system-timezone", "/apps/evolution/calendar/display/use_system_timezone"); @@ -615,6 +650,60 @@ e_cal_shell_backend_init_settings (EShell *shell) * is backward-compatibility cruft for poorly designed * GConf schemas. */ + e_shell_settings_install_property ( + g_param_spec_enum ( + "cal-ba-reminder-units", + NULL, + NULL, + E_TYPE_DURATION_TYPE, + E_DURATION_MINUTES, + G_PARAM_READWRITE)); + + g_object_bind_property_full ( + shell_settings, "cal-ba-reminder-units-string", + shell_settings, "cal-ba-reminder-units", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, + e_binding_transform_enum_nick_to_value, + e_binding_transform_enum_value_to_nick, + NULL, (GDestroyNotify) NULL); + + e_shell_settings_install_property ( + g_param_spec_enum ( + "cal-default-reminder-units", + NULL, + NULL, + E_TYPE_DURATION_TYPE, + E_DURATION_MINUTES, + G_PARAM_READWRITE)); + + g_object_bind_property_full ( + shell_settings, "cal-default-reminder-units-string", + shell_settings, "cal-default-reminder-units", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, + e_binding_transform_enum_nick_to_value, + e_binding_transform_enum_value_to_nick, + NULL, (GDestroyNotify) NULL); + + e_shell_settings_install_property ( + g_param_spec_enum ( + "cal-hide-completed-tasks-units", + NULL, + NULL, + E_TYPE_DURATION_TYPE, + E_DURATION_MINUTES, + G_PARAM_READWRITE)); + + g_object_bind_property_full ( + shell_settings, "cal-hide-completed-tasks-units-string", + shell_settings, "cal-hide-completed-tasks-units", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE, + e_binding_transform_enum_nick_to_value, + e_binding_transform_enum_value_to_nick, + NULL, (GDestroyNotify) NULL); + e_shell_settings_install_property ( g_param_spec_pointer ( "cal-timezone", -- cgit v1.2.3