diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2008-01-28 12:31:51 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2008-01-28 12:31:51 +0800 |
commit | df100f4a47cfc46a01647e80622b95fa6dc76160 (patch) | |
tree | a47937578a5709d21f872eeac8e451e6273111a4 /calendar/gui | |
parent | 0d3da13635b50c5ab26d121c7dfe939713cc2f91 (diff) | |
download | gsoc2013-evolution-df100f4a47cfc46a01647e80622b95fa6dc76160.tar.gz gsoc2013-evolution-df100f4a47cfc46a01647e80622b95fa6dc76160.tar.zst gsoc2013-evolution-df100f4a47cfc46a01647e80622b95fa6dc76160.zip |
Patch from Milan Crha <mcrha@redhat.com> ** Fix for bug #240073 (Cancelled tasks should get a line striked through them)
svn path=/trunk/; revision=34906
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-cal-model-tasks.c | 14 | ||||
-rw-r--r-- | calendar/gui/e-cal-model-tasks.h | 3 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 14 |
3 files changed, 22 insertions, 9 deletions
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index a0caef3adc..05b97374bb 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -330,6 +330,16 @@ get_priority (ECalModelComponent *comp_data) return ""; } +static gboolean +is_status_canceled (ECalModelComponent *comp_data) +{ + icalproperty *prop; + + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY); + + return prop && icalproperty_get_status (prop) == ICAL_STATUS_CANCELLED; +} + static char * get_status (ECalModelComponent *comp_data) { @@ -477,7 +487,7 @@ ecmt_value_at (ETableModel *etm, int col, int row) g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL); - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL); + g_return_val_if_fail (col >= 0 && (col < E_CAL_MODEL_TASKS_FIELD_LAST || col == E_CAL_MODEL_TASKS_FIELD_STRIKEOUT), NULL); g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL); if (col < E_CAL_MODEL_FIELD_LAST) @@ -490,6 +500,8 @@ ecmt_value_at (ETableModel *etm, int col, int row) switch (col) { case E_CAL_MODEL_TASKS_FIELD_COMPLETED : return get_completed (comp_data); + case E_CAL_MODEL_TASKS_FIELD_STRIKEOUT : + return GINT_TO_POINTER (is_status_canceled (comp_data) || is_complete (comp_data)); case E_CAL_MODEL_TASKS_FIELD_COMPLETE : return GINT_TO_POINTER (is_complete (comp_data)); case E_CAL_MODEL_TASKS_FIELD_DUE : diff --git a/calendar/gui/e-cal-model-tasks.h b/calendar/gui/e-cal-model-tasks.h index 2de52d541d..eb5d0609cb 100644 --- a/calendar/gui/e-cal-model-tasks.h +++ b/calendar/gui/e-cal-model-tasks.h @@ -46,7 +46,8 @@ typedef enum { E_CAL_MODEL_TASKS_FIELD_PRIORITY, E_CAL_MODEL_TASKS_FIELD_STATUS, E_CAL_MODEL_TASKS_FIELD_URL, - E_CAL_MODEL_TASKS_FIELD_LAST + E_CAL_MODEL_TASKS_FIELD_LAST, + E_CAL_MODEL_TASKS_FIELD_STRIKEOUT /* it's another virtual readonly column */ } ECalModelTasksField; typedef struct { diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 3f39d72875..0718ac5a49 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -255,7 +255,7 @@ e_calendar_table_init (ECalendarTable *cal_table) */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -268,7 +268,7 @@ e_calendar_table_init (ECalendarTable *cal_table) */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -291,7 +291,7 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Classification field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, @@ -313,7 +313,7 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Priority field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, @@ -336,7 +336,7 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Percent field. */ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, NULL); @@ -365,7 +365,7 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Transparency field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, @@ -386,7 +386,7 @@ e_calendar_table_init (ECalendarTable *cal_table) /* Status field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); g_object_set (G_OBJECT (cell), - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_COMPLETE, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, "bg_color_column", E_CAL_MODEL_FIELD_COLOR, "editable", FALSE, |