aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-model.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-08-26 06:55:58 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-08-26 06:55:58 +0800
commit2f5e7395814b03ddfc2f612e5cd962be50f38c27 (patch)
treea0dc3dd0984cf516d9bf11840df199c43ebe8a72 /calendar/gui/calendar-model.c
parent1e0d3b18fa6fe068f84ec011ad8b78e6ef70eaf5 (diff)
downloadgsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar.gz
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar.bz2
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar.lz
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar.xz
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.tar.zst
gsoc2013-evolution-2f5e7395814b03ddfc2f612e5cd962be50f38c27.zip
Uncomment debug code.
2000-08-25 JP Rosevear <jpr@helixcode.com> * gui/e-calendar-table.c (e_calendar_table_init): Uncomment debug code. * gui/calendar-model.c (set_complete): Set the completed date to the current date (calendar_model_set_value_at): Handle complete field svn path=/trunk/; revision=5044
Diffstat (limited to 'calendar/gui/calendar-model.c')
-rw-r--r--calendar/gui/calendar-model.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index aac20d2b7c..9be00485b3 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1043,6 +1043,22 @@ set_url (CalComponent *comp, const char *value)
cal_component_set_url (comp, value);
}
+/* Sets the completion time of a component was toggled */
+static void
+set_complete (CalComponent *comp, const void *value)
+{
+ time_t t = time (NULL);
+ gint state = GPOINTER_TO_INT (value);
+ struct icaltimetype itt;
+
+ if (state) {
+ itt = icaltime_from_timet (t, FALSE, FALSE);
+ cal_component_set_completed (comp, &itt);
+ } else {
+ cal_component_set_completed (comp, NULL);
+ }
+}
+
/* set_value_at handler for the calendar table model */
static void
calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *value)
@@ -1107,6 +1123,10 @@ calendar_model_set_value_at (ETableModel *etm, int col, int row, const void *val
set_url (comp, value);
break;
+ case CAL_COMPONENT_FIELD_COMPLETE:
+ set_complete (comp, value);
+ break;
+
default:
g_message ("calendar_model_set_value_at(): Requested invalid column %d", col);
break;
@@ -1148,6 +1168,8 @@ calendar_model_is_cell_editable (ETableModel *etm, int col, int row)
case CAL_COMPONENT_FIELD_PRIORITY:
case CAL_COMPONENT_FIELD_SUMMARY:
case CAL_COMPONENT_FIELD_URL:
+ case CAL_COMPONENT_FIELD_ICON:
+ case CAL_COMPONENT_FIELD_COMPLETE:
return TRUE;
default: