evolution r34906 - in trunk/calendar: . gui



Author: msuman
Date: Mon Jan 28 04:31:51 2008
New Revision: 34906
URL: http://svn.gnome.org/viewvc/evolution?rev=34906&view=rev

Log:
Patch from Milan Crha  <mcrha redhat com>  ** Fix for bug #240073 (Cancelled tasks should get a line striked through them)

Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/e-cal-model-tasks.c
   trunk/calendar/gui/e-cal-model-tasks.h
   trunk/calendar/gui/e-calendar-table.c

Modified: trunk/calendar/gui/e-cal-model-tasks.c
==============================================================================
--- trunk/calendar/gui/e-cal-model-tasks.c	(original)
+++ trunk/calendar/gui/e-cal-model-tasks.c	Mon Jan 28 04:31:51 2008
@@ -330,6 +330,16 @@
 	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 @@
 
 	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 @@
 	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 :

Modified: trunk/calendar/gui/e-cal-model-tasks.h
==============================================================================
--- trunk/calendar/gui/e-cal-model-tasks.h	(original)
+++ trunk/calendar/gui/e-cal-model-tasks.h	Mon Jan 28 04:31:51 2008
@@ -46,7 +46,8 @@
 	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 {

Modified: trunk/calendar/gui/e-calendar-table.c
==============================================================================
--- trunk/calendar/gui/e-calendar-table.c	(original)
+++ trunk/calendar/gui/e-calendar-table.c	Mon Jan 28 04:31:51 2008
@@ -255,7 +255,7 @@
 	 */
 	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 @@
 	 */
 	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 @@
 	/* 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 @@
 	/* 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 @@
 	/* 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 @@
 	/* 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 @@
 	/* 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]