aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-config.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-08-22 03:06:17 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-08-22 03:06:17 +0800
commitc8905eabfcb6120fbf7f4ba67043d1780396dc01 (patch)
tree2642e85770860b956abd09c6728e1e11cc9517cb /calendar/gui/calendar-config.c
parenta70082de9ea4f4558d6494efc5e130250ed99448 (diff)
downloadgsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar.gz
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar.bz2
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar.lz
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar.xz
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.tar.zst
gsoc2013-evolution-c8905eabfcb6120fbf7f4ba67043d1780396dc01.zip
added new e-sexp operator. We don't currently use it though.
2001-08-21 Damon Chaplin <damon@ximian.com> * pcs/query.c (func_is_completed): added new e-sexp operator. We don't currently use it though. * gui/dialogs/cal-prefs-dialog.glade: Changed '_Overdue' to 'O_verdue' since we have an '_Other' notebook tab. Added '_Hide' accel. * gui/dialogs/cal-prefs-dialog.c: hooked up config options to dialog. * gui/calendar-config.c: added config options for hiding completed tasks. * gui/e-week-view-event-item.c (e_week_view_event_item_draw): * gui/e-day-view-top-item.c (e_day_view_top_item_draw_long_event): * gui/e-day-view.c (e_day_view_reshape_long_event): added 2 pixels extra space between icons and text for long events, and 1 pixel space between icons in all events. (e_day_view_realize): changed the background color to match the EGrayBar in the shell. svn path=/trunk/; revision=12347
Diffstat (limited to 'calendar/gui/calendar-config.c')
-rw-r--r--calendar/gui/calendar-config.c82
1 files changed, 81 insertions, 1 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index fd95a573b0..33be9f2f02 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -62,6 +62,9 @@ typedef struct
gboolean show_event_end;
char *tasks_due_today_color;
char *tasks_overdue_color;
+ gboolean hide_completed_tasks;
+ CalUnits hide_completed_tasks_units;
+ gint hide_completed_tasks_value;
} CalendarConfig;
@@ -102,6 +105,7 @@ config_read (void)
{
Bonobo_ConfigDatabase db;
CORBA_Environment ev;
+ char *units;
CORBA_exception_init (&ev);
@@ -179,6 +183,23 @@ config_read (void)
config->tasks_overdue_color = bonobo_config_get_string_with_default (
db, "/Calendar/Tasks/Colors/TasksOverdue", "red", NULL);
+ config->hide_completed_tasks = bonobo_config_get_boolean_with_default (
+ db, "/Calendar/Tasks/HideCompletedTasks", FALSE, NULL);
+
+ units = bonobo_config_get_string_with_default (db,
+ "/Calendar/Tasks/HideCompletedTasksUnits", "days", NULL);
+
+ if (!strcmp (units, "minutes"))
+ config->hide_completed_tasks_units = CAL_MINUTES;
+ else if (!strcmp (units, "hours"))
+ config->hide_completed_tasks_units = CAL_HOURS;
+ else
+ config->hide_completed_tasks_units = CAL_DAYS;
+
+ config->hide_completed_tasks_value = bonobo_config_get_long_with_default (
+ db, "/Calendar/Tasks/HideCompletedTasksValue", 1, NULL);
+
+
bonobo_object_release_unref (db, NULL);
}
@@ -188,7 +209,7 @@ calendar_config_write (void)
{
Bonobo_ConfigDatabase db;
CORBA_Environment ev;
-
+ char *units;
CORBA_exception_init (&ev);
@@ -232,6 +253,22 @@ calendar_config_write (void)
bonobo_config_set_string (db, "/Calendar/Tasks/Colors/TasksOverdue",
config->tasks_overdue_color, NULL);
+ bonobo_config_set_boolean (db, "/Calendar/Tasks/HideCompletedTasks",
+ config->hide_completed_tasks, NULL);
+
+ if (config->hide_completed_tasks_units == CAL_MINUTES)
+ units = "minutes";
+ else if (config->hide_completed_tasks_units == CAL_HOURS)
+ units = "hours";
+ else
+ units = "days";
+ bonobo_config_set_string (db,
+ "/Calendar/Tasks/HideCompletedTasksUnits",
+ units, NULL);
+ bonobo_config_set_long (db,
+ "/Calendar/Tasks/HideCompletedTasksValue",
+ config->hide_completed_tasks_value, NULL);
+
Bonobo_ConfigDatabase_sync (db, &ev);
bonobo_object_release_unref (db, NULL);
@@ -538,6 +575,49 @@ calendar_config_set_working_days (CalWeekdays days)
}
+/* Settings to hide completed tasks. */
+gboolean
+calendar_config_get_hide_completed_tasks (void)
+{
+ return config->hide_completed_tasks;
+}
+
+
+void
+calendar_config_set_hide_completed_tasks (gboolean hide)
+{
+ config->hide_completed_tasks = hide;
+}
+
+
+CalUnits
+calendar_config_get_hide_completed_tasks_units (void)
+{
+ return config->hide_completed_tasks_units;
+}
+
+
+void
+calendar_config_set_hide_completed_tasks_units (CalUnits units)
+{
+ config->hide_completed_tasks_units = units;
+}
+
+
+gint
+calendar_config_get_hide_completed_tasks_value (void)
+{
+ return config->hide_completed_tasks_value;
+}
+
+
+void
+calendar_config_set_hide_completed_tasks_value (gint value)
+{
+ config->hide_completed_tasks_value = value;
+}
+
+
/* This sets all the common config settings for an ECalendar widget.
These are the week start day, and whether we show week numbers. */
void