aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-09-11 07:25:16 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-09-11 07:25:16 +0800
commit278215b3cf2caa93af681a771e4003288cdaf203 (patch)
tree1cfaca8aef9bf3eb5138b21fffc24a78089863a5 /calendar/cal-util
parent3ef38d9cc08d0dc1e0e94bfc8b01ca78416bae30 (diff)
downloadgsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar.gz
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar.bz2
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar.lz
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar.xz
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.tar.zst
gsoc2013-evolution-278215b3cf2caa93af681a771e4003288cdaf203.zip
changed to use EDateEdit.
2000-09-11 Damon Chaplin <damon@helixcode.com> * gui/dialogs/task-editor.c: changed to use EDateEdit. * gui/dialogs/task-editor-dialog.glade: added "None" option to Classification option menu, and used custom widgets for the date entries so we can use EDateEdit widgets. * gui/event-editor.c: changed to use EDateEdit. Note that this needs to be fixed at some point to handle invalid dates, i.e. when e_date_edit_get_time returns -1. * gui/calendar-model.c (ensure_task_complete): (ensure_task_not_complete): new functions to set the related properties to make sure a task is marked as complete on not, i.e. "Date Completed" "Status" and "Percent" properties. 2000-09-08 Damon Chaplin <damon@helixcode.com> * gui/calendar-model.c (get_is_complete): use the status field rather than the completed date, as it is more reliable. (get_is_overdue): use get_is_complete(). (calendar_model_mark_task_complete): check if it is already complete, and if so don't update it. * cal-util/cal-component.c (cal_component_get_status): (cal_component_set_status): added functions to support the STATUS property. Also added the property to CalComponentPrivate and set it to NULL in free_icalcomponent(). Someone should check my code as I've mainly done a Cut & Paste job. svn path=/trunk/; revision=5305
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c75
-rw-r--r--calendar/cal-util/cal-component.h3
2 files changed, 78 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index ff3bcd6d96..4ddec62159 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -37,6 +37,8 @@ struct _CalComponentPrivate {
icalproperty *uid;
+ icalproperty *status;
+
struct categories {
icalproperty *prop;
};
@@ -221,6 +223,8 @@ free_icalcomponent (CalComponent *comp)
priv->uid = NULL;
+ priv->status = NULL;
+
priv->categories_list = free_slist (priv->categories_list);
priv->classification = NULL;
@@ -471,6 +475,10 @@ scan_property (CalComponent *comp, icalproperty *prop)
kind = icalproperty_isa (prop);
switch (kind) {
+ case ICAL_STATUS_PROPERTY:
+ priv->status = prop;
+ break;
+
case ICAL_CATEGORIES_PROPERTY:
scan_categories (comp, prop);
break;
@@ -953,6 +961,73 @@ cal_component_set_uid (CalComponent *comp, const char *uid)
}
/**
+ * cal_component_get_status:
+ * @comp: A calendar component object.
+ * @status: Return value for the status string.
+ *
+ * Queries the status property of a calendar component object.
+ **/
+void
+cal_component_get_status (CalComponent *comp, const char **status)
+{
+ CalComponentPrivate *priv;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (IS_CAL_COMPONENT (comp));
+ g_return_if_fail (status != NULL);
+
+ priv = comp->priv;
+ g_return_if_fail (priv->icalcomp != NULL);
+
+ if (!priv->status) {
+ *status = NULL;
+ return;
+ }
+
+ *status = icalproperty_get_status (priv->status);
+}
+
+/**
+ * cal_component_set_status:
+ * @comp: A calendar component object.
+ * @status: a status string, e.g. "IN-PROCESS", "NEEDS-ACTION". See the RFC.
+ *
+ * Sets the status string property of a calendar component object.
+ **/
+void
+cal_component_set_status (CalComponent *comp, const char *status)
+{
+ CalComponentPrivate *priv;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (IS_CAL_COMPONENT (comp));
+ g_return_if_fail (status != NULL);
+
+ priv = comp->priv;
+ g_return_if_fail (priv->icalcomp != NULL);
+
+ priv->need_sequence_inc = TRUE;
+
+ if (status == NULL) {
+ if (priv->status) {
+ icalcomponent_remove_property (priv->icalcomp, priv->status);
+ icalproperty_free (priv->status);
+ priv->status = NULL;
+ }
+
+ return;
+ }
+
+ if (priv->status) {
+ icalproperty_set_status (priv->status, (char *) status);
+ } else {
+ priv->status = icalproperty_new_status ((char *) status);
+ icalcomponent_add_property (priv->icalcomp,
+ priv->status);
+ }
+}
+
+/**
* cal_component_get_categories_list:
* @comp: A calendar component object.
* @categ_list: Return value for the list of strings, where each string is a
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index 5fa759748f..253d7b411f 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -165,6 +165,9 @@ void cal_component_commit_sequence (CalComponent *comp);
void cal_component_get_uid (CalComponent *comp, const char **uid);
void cal_component_set_uid (CalComponent *comp, const char *uid);
+void cal_component_get_status (CalComponent *comp, const char **status);
+void cal_component_set_status (CalComponent *comp, const char *status);
+
void cal_component_get_categories_list (CalComponent *comp, GSList **categ_list);
void cal_component_set_categories_list (CalComponent *comp, GSList *categ_list);