diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-model.c | 22 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 10 |
2 files changed, 27 insertions, 5 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: 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); |