aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-07-29 02:51:32 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-07-29 02:51:32 +0800
commit3a68f719775b66faeb267cea99879dd659ab1cdf (patch)
tree53ad24710c9cc2b27f46224fa58a9dea01731feb /calendar
parentdad7bd83ff0af51cae48a41c242b05602b971d50 (diff)
downloadgsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar.gz
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar.bz2
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar.lz
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar.xz
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.tar.zst
gsoc2013-evolution-3a68f719775b66faeb267cea99879dd659ab1cdf.zip
fixed mapping of popdown menu to ICAL_STATUS_ values.
2002-07-28 Rodrigo Moya <rodrigo@ximian.com> * gui/dialogs/task-details-page.c: fixed mapping of popdown menu to ICAL_STATUS_ values. (task_details_page_fill_widgets): when we can't set the status, default to ICAL_STATUS_NONE, which maps to 'Not started'. Fixed use of 'percent' variable, which was being used after being freed. (percent_complete_changed): default to ICAL_STATUS_NONE (Not Started). * gui/dialogs/task-details-page.glade: added 'Needs Action' to popdown menu values. svn path=/trunk/; revision=17624
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/dialogs/task-details-page.c25
-rw-r--r--calendar/gui/dialogs/task-details-page.glade1
3 files changed, 28 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 05a5b1d99c..b251dcb448 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2002-07-28 Rodrigo Moya <rodrigo@ximian.com>
+
+ * gui/dialogs/task-details-page.c: fixed mapping of popdown menu
+ to ICAL_STATUS_ values.
+ (task_details_page_fill_widgets): when we can't set the status,
+ default to ICAL_STATUS_NONE, which maps to 'Not started'. Fixed
+ use of 'percent' variable, which was being used after being freed.
+ (percent_complete_changed): default to ICAL_STATUS_NONE (Not Started).
+
+ * gui/dialogs/task-details-page.glade: added 'Needs Action' to
+ popdown menu values.
+
2002-07-26 Rodrigo Moya <rodrigo@ximian.com>
* cal-util/cal-util.[ch] (cal_util_add_timezones_from_component):
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 84070ff541..d92b5c18e7 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -61,8 +61,9 @@ struct _TaskDetailsPagePrivate {
/* Note that these two arrays must match. */
static const int status_map[] = {
- ICAL_STATUS_NEEDSACTION,
+ ICAL_STATUS_NONE,
ICAL_STATUS_INPROCESS,
+ ICAL_STATUS_NEEDSACTION,
ICAL_STATUS_COMPLETED,
ICAL_STATUS_CANCELLED,
-1
@@ -295,7 +296,7 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
- int *priority_value, *percent;
+ int *priority_value, *percent = NULL;
TaskEditorPriority priority;
icalproperty_status status;
const char *url;
@@ -313,7 +314,6 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_percent (comp, &percent);
if (percent) {
e_dialog_spin_set (priv->percent_complete, *percent);
- cal_component_free_percent (percent);
} else {
/* FIXME: Could check if task is completed and set 100%. */
e_dialog_spin_set (priv->percent_complete, 0);
@@ -324,17 +324,19 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
if (status == ICAL_STATUS_NONE) {
/* Try to use the percent value. */
if (percent) {
- if (*percent == 0)
- status = ICAL_STATUS_NEEDSACTION;
- else if (*percent == 100)
+ if (*percent == 100)
status = ICAL_STATUS_COMPLETED;
- else
+ else if (*percent > 0)
status = ICAL_STATUS_INPROCESS;
+ else
+ status = ICAL_STATUS_NONE;
} else
- status = ICAL_STATUS_NEEDSACTION;
+ status = ICAL_STATUS_NONE;
}
e_dialog_option_menu_set (priv->status, status, status_map);
+ cal_component_free_percent (percent);
+
/* Completed Date. */
cal_component_get_completed (comp, &completed);
if (completed) {
@@ -586,10 +588,13 @@ status_changed (GtkMenu *menu, TaskDetailsPage *tdpage)
priv->updating = TRUE;
status = e_dialog_option_menu_get (priv->status, status_map);
- if (status == ICAL_STATUS_NEEDSACTION) {
+ if (status == ICAL_STATUS_NONE) {
e_dialog_spin_set (priv->percent_complete, 0);
e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
complete_date_changed (tdpage, 0, FALSE);
+ } else if (status == ICAL_STATUS_NEEDSACTION) {
+ e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
+ complete_date_changed (tdpage, 0, FALSE);
} else if (status == ICAL_STATUS_INPROCESS) {
e_dialog_spin_set (priv->percent_complete, 50);
e_date_edit_set_time (E_DATE_EDIT (priv->completed_date), ctime);
@@ -631,7 +636,7 @@ percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage)
complete = FALSE;
if (percent == 0)
- status = ICAL_STATUS_NEEDSACTION;
+ status = ICAL_STATUS_NONE;
else
status = ICAL_STATUS_INPROCESS;
}
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index 28bf6a3bcc..8c47c7d725 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -85,6 +85,7 @@
<can_focus>True</can_focus>
<items>Not Started
In Progress
+Needs Action
Completed
Cancelled
</items>