diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 9 | ||||
-rw-r--r-- | calendar/gui/calendar-model.c | 22 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 10 |
3 files changed, 36 insertions, 5 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d9bb24774b..9c4e077705 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,14 @@ 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 + +2000-08-25 JP Rosevear <jpr@helixcode.com> + * gui/calendar-model.c (get_is_complete): Don't attempt to free this if its null (calendar_model_duplicate_value): Implement for summary field 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: diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index a1b224c424..b84e21b34a 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -204,11 +204,11 @@ e_calendar_table_init (ECalendarTable *cal_table) create_column (header, model, CAL_COMPONENT_FIELD_PRIORITY, _("Priority")); cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); -// gtk_object_set (GTK_OBJECT (cell), -// "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, -// "bold_column", CAL_COMPONENT_FIELD_OVERDUE, -// "color_column", CAL_COMPONENT_FIELD_COLOR, -// NULL); + gtk_object_set (GTK_OBJECT (cell), + "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, + "bold_column", CAL_COMPONENT_FIELD_OVERDUE, + "color_column", CAL_COMPONENT_FIELD_COLOR, + NULL); column = e_table_col_new (CAL_COMPONENT_FIELD_SUMMARY, _("Summary"), 1.0, 10, cell, g_str_compare, TRUE); e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_SUMMARY); |