aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
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
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')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/calendar-model.c22
-rw-r--r--calendar/gui/e-calendar-table.c10
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);