From 017f373b5284b4d7177c19e5ac2a142a5362a15c Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 14 Dec 2011 14:48:34 +0100 Subject: Bug #582649 - Toggle for coloring today and overdue tasks --- modules/calendar/e-cal-config-model.c | 10 ++++++++++ modules/calendar/e-cal-shell-settings.c | 10 ++++++++++ modules/calendar/e-calendar-preferences.c | 22 ++++++++++++++++++++++ modules/calendar/e-calendar-preferences.ui | 18 ++++++++++-------- 4 files changed, 52 insertions(+), 8 deletions(-) (limited to 'modules/calendar') diff --git a/modules/calendar/e-cal-config-model.c b/modules/calendar/e-cal-config-model.c index 9898942bf9..f7a0e162af 100644 --- a/modules/calendar/e-cal-config-model.c +++ b/modules/calendar/e-cal-config-model.c @@ -110,11 +110,21 @@ cal_config_model_constructed (GObject *object) if (E_IS_CAL_MODEL_TASKS (extensible)) { + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-due-today", + extensible, "highlight-due-today", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "cal-tasks-color-due-today", extensible, "color-due-today", G_BINDING_SYNC_CREATE); + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-overdue", + extensible, "highlight-overdue", + G_BINDING_SYNC_CREATE); + g_object_bind_property ( shell_settings, "cal-tasks-color-overdue", extensible, "color-overdue", diff --git a/modules/calendar/e-cal-shell-settings.c b/modules/calendar/e-cal-shell-settings.c index 88b961e64f..9810d816e6 100644 --- a/modules/calendar/e-cal-shell-settings.c +++ b/modules/calendar/e-cal-shell-settings.c @@ -632,11 +632,21 @@ e_cal_shell_backend_init_settings (EShell *shell) CALENDAR_SCHEMA, "show-week-numbers"); + e_shell_settings_install_property_for_key ( + "cal-tasks-highlight-due-today", + CALENDAR_SCHEMA, + "task-due-today-highlight"); + e_shell_settings_install_property_for_key ( "cal-tasks-color-due-today", CALENDAR_SCHEMA, "task-due-today-color"); + e_shell_settings_install_property_for_key ( + "cal-tasks-highlight-overdue", + CALENDAR_SCHEMA, + "task-overdue-highlight"); + e_shell_settings_install_property_for_key ( "cal-tasks-color-overdue", CALENDAR_SCHEMA, diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c index 5578f39a2c..55a91acd70 100644 --- a/modules/calendar/e-calendar-preferences.c +++ b/modules/calendar/e-calendar-preferences.c @@ -797,6 +797,13 @@ calendar_preferences_construct (ECalendarPreferences *prefs, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + widget = e_builder_get_widget (prefs->builder, "tasks_due_today_highlight"); + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-due-today", + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + widget = e_builder_get_widget (prefs->builder, "tasks_due_today_color"); g_object_bind_property_full ( shell_settings, "cal-tasks-color-due-today", @@ -806,6 +813,17 @@ calendar_preferences_construct (ECalendarPreferences *prefs, e_binding_transform_string_to_color, e_binding_transform_color_to_string, NULL, (GDestroyNotify) NULL); + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-due-today", + widget, "sensitive", + G_BINDING_SYNC_CREATE); + + widget = e_builder_get_widget (prefs->builder, "tasks_overdue_highlight"); + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-overdue", + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "tasks_overdue_color"); g_object_bind_property_full ( @@ -816,6 +834,10 @@ calendar_preferences_construct (ECalendarPreferences *prefs, e_binding_transform_string_to_color, e_binding_transform_color_to_string, (GDestroyNotify) NULL, NULL); + g_object_bind_property ( + shell_settings, "cal-tasks-highlight-overdue", + widget, "sensitive", + G_BINDING_SYNC_CREATE); widget = e_builder_get_widget (prefs->builder, "tasks_hide_completed"); g_object_bind_property ( diff --git a/modules/calendar/e-calendar-preferences.ui b/modules/calendar/e-calendar-preferences.ui index 44ffc19100..5cbc82fbf4 100644 --- a/modules/calendar/e-calendar-preferences.ui +++ b/modules/calendar/e-calendar-preferences.ui @@ -1032,12 +1032,13 @@ True 12 - + + Highlight t_asks due today True - 0 - T_asks due today: + True + False True - tasks_due_today_color + True False @@ -1071,12 +1072,13 @@ True 12 - + + Highlight _overdue tasks True - 0 - _Overdue tasks: + True + False True - tasks_overdue_color + True False -- cgit