aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-config.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-07-01 12:59:24 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-07-01 12:59:24 +0800
commita0afdf4f53224a55425a8826c0563faa510fa6c5 (patch)
tree0b73a44325df455ee96053f0b6983a1d5f9a7592 /calendar/gui/calendar-config.c
parent21f1aedda2c1c38589c1f0abb550cabeab8f551f (diff)
downloadgsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar.gz
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar.bz2
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar.lz
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar.xz
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.tar.zst
gsoc2013-evolution-a0afdf4f53224a55425a8826c0563faa510fa6c5.zip
Fixes bug #1406.
2001-06-30 Federico Mena Quintero <federico@ximian.com> Fixes bug #1406. * gui/calendar-config.c (config_read): Handle the options for the task list colors. (calendar_config_write): Ditto. (calendar_config_get_tasks_due_today_color): New function. (calendar_config_set_tasks_due_today_color): New function. (calendar_config_get_tasks_overdue_color): New function. (calendar_config_set_tasks_overdue_color): New function. (calendar_config_configure_e_calendar_table): Use e_table_model_changed() for the colors. * gui/dialogs/cal-prefs-dialog.glade: Updated the options for the task list and alarms. * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_show_config): Update the task list settings. (cal_prefs_dialog_update_config): Ditto. * gui/calendar-model.c (get_color): Deal with tasks for today as well as overdue tasks. Make it cleaner, even though we have to duplicate a chunk of is_overdue(). * gui/calendar-commands.c (preferences_cmd): Renamed from properties_cmd(). svn path=/trunk/; revision=10648
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r--calendar/gui/calendar-config.c98
1 files changed, 93 insertions, 5 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 135f6a42e6..f4678ab098 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -57,6 +57,8 @@ typedef struct
gfloat month_vpane_pos;
gboolean compress_weekend;
gboolean show_event_end;
+ char *tasks_due_today_color;
+ char *tasks_overdue_color;
} CalendarConfig;
@@ -76,7 +78,7 @@ calendar_config_init (void)
{
if (config)
return;
-
+
config = g_new0 (CalendarConfig, 1);
config_read ();
@@ -118,7 +120,6 @@ config_read (void)
gnome_config_pop_prefix ();
-
/* 'DateNavigator' settings. */
prefix = g_strdup_printf ("=%s/config/Calendar=/DateNavigator/",
evolution_dir);
@@ -129,7 +130,18 @@ config_read (void)
gnome_config_pop_prefix ();
+ /* Task list settings */
+
+ prefix = g_strdup_printf ("=%s/config/Tasks=/Colors/", evolution_dir);
+ gnome_config_push_prefix (prefix);
+ g_free (prefix);
+ config->tasks_due_today_color = gnome_config_get_string ("TasksDueToday=blue");
+ config->tasks_overdue_color = gnome_config_get_string ("TasksOverdue=red");
+
+ gnome_config_pop_prefix ();
+
+ /* Done */
gnome_config_sync ();
}
@@ -138,7 +150,7 @@ void
calendar_config_write (void)
{
gchar *prefix;
-
+
/* 'Display' settings. */
prefix = g_strdup_printf ("=%s/config/Calendar=/Display/",
evolution_dir);
@@ -159,7 +171,6 @@ calendar_config_write (void)
gnome_config_pop_prefix ();
-
/* 'DateNavigator' settings. */
prefix = g_strdup_printf ("=%s/config/Calendar=/DateNavigator/",
evolution_dir);
@@ -170,7 +181,18 @@ calendar_config_write (void)
gnome_config_pop_prefix ();
+ /* Task list settings */
+
+ prefix = g_strdup_printf ("=%s/config/Tasks=/Colors/", evolution_dir);
+ gnome_config_push_prefix (prefix);
+ g_free (prefix);
+
+ gnome_config_set_string ("TasksDueToday", config->tasks_due_today_color);
+ gnome_config_set_string ("TasksOverdue", config->tasks_overdue_color);
+ gnome_config_pop_prefix ();
+
+ /* Done */
gnome_config_sync ();
}
@@ -179,7 +201,7 @@ void
calendar_config_write_on_exit (void)
{
gchar *prefix;
-
+
/* 'Display' settings. */
prefix = g_strdup_printf ("=%s/config/Calendar=/Display/",
evolution_dir);
@@ -569,6 +591,11 @@ calendar_config_configure_e_calendar_table (ECalendarTable *cal_table)
calendar_model_set_use_24_hour_format (model, use_24_hour);
calendar_config_configure_e_cell_date_edit (cal_table->dates_cell);
+
+ /* This is for changing the colors of the text; they will be re-fetched
+ * by ECellText when the table is redrawn.
+ */
+ e_table_model_changed (E_TABLE_MODEL (model));
}
@@ -635,3 +662,64 @@ on_timezone_dialog_delete_event (GnomeDialog *dialog,
}
+/**
+ * calendar_config_get_tasks_due_today_color:
+ *
+ * Queries the color to be used to display tasks that are due today.
+ *
+ * Return value: An X color specification.
+ **/
+const char *
+calendar_config_get_tasks_due_today_color (void)
+{
+ g_assert (config->tasks_due_today_color != NULL);
+ return config->tasks_due_today_color;
+}
+
+/**
+ * calendar_config_set_tasks_due_today_color:
+ * @color: X color specification
+ *
+ * Sets the color to be used to display tasks that are due today.
+ **/
+void
+calendar_config_set_tasks_due_today_color (const char *color)
+{
+ g_return_if_fail (color != NULL);
+
+ g_assert (config->tasks_due_today_color != NULL);
+
+ g_free (config->tasks_due_today_color);
+ config->tasks_due_today_color = g_strdup (color);
+}
+
+/**
+ * calendar_config_get_tasks_overdue_color:
+ *
+ * Queries the color to be used to display overdue tasks.
+ *
+ * Return value: An X color specification.
+ **/
+const char *
+calendar_config_get_tasks_overdue_color (void)
+{
+ g_assert (config->tasks_overdue_color != NULL);
+ return config->tasks_overdue_color;
+}
+
+/**
+ * calendar_config_set_tasks_overdue_color:
+ * @color: X color specification
+ *
+ * Sets the color to be used to display overdue tasks.
+ **/
+void
+calendar_config_set_tasks_overdue_color (const char *color)
+{
+ g_return_if_fail (color != NULL);
+
+ g_assert (config->tasks_overdue_color != NULL);
+
+ g_free (config->tasks_overdue_color);
+ config->tasks_overdue_color = g_strdup (color);
+}