Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.3054
diff -r1.3054 ChangeLog
0a1,50
> 2006-14-06 Ushveen Kaur <kushveen@novell.com>
> 
> 	fixes bug #329772
> 	* gui/e-cal-model-tasks.c:
> 	function added to change status of a task as incomplete
> 	* gui/e-cal-popup.c:
> 	status of task checked and changed to incomplete if option selected
> 	* gui/e-cal-popup.h:
> 	E_CAL_POPUP_SELECT_COMPLETE added
> 	* gui/e-calendar-table.c:
> 	function added to mark the task in selected row as incomplete
Index: e-cal-model-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model-tasks.c,v
retrieving revision 1.36
diff -r1.36 e-cal-model-tasks.c
1080c1080
<  * e_cal_model_tasks_mark_task_complete
---
>  *e_cal_model_tasks_mark_task_complete
1098a1099,1144
> 
> /**
>  * e_cal_model_tasks_mark_task_incomplete
>  */
> void
> e_cal_model_tasks_mark_task_incomplete (ECalModelTasks *model, gint model_row)
> {
>  	ECalModelComponent *comp_data; 
> 	icalproperty *prop,*prop1,*prop2;
> 	gboolean set_completed = TRUE;
> 
>  	g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); 
>  	g_return_if_fail (model_row >= 0 && model_row < e_table_model_row_count (E_TABLE_MODEL (model))); 
> 
>  	comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), model_row); 
>  	if (comp_data)
> 	{ 
> 	    e_table_model_pre_change (E_TABLE_MODEL (model));
> 	    /* Status */
> 	    prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY); 
>  	    if (prop) 
> 		icalproperty_set_status (prop, ICAL_STATUS_NEEDSACTION);
> 	    else 	     
> 		icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_status (ICAL_STATUS_NEEDSACTION));
> 	    {
> 		/*complete property*/
> 		prop1= icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY);
> 		if (prop1) 
> 		{
> 		    icalcomponent_remove_property (comp_data->icalcomp, prop1);
> 		    icalproperty_free (prop1);
> 		}
> 		
> 		/* Percent. */
> 		prop1 = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_PERCENTCOMPLETE_PROPERTY);
> 		if (prop1)
> 		{
> 		    icalcomponent_remove_property (comp_data->icalcomp, prop1);
> 		    icalproperty_free (prop1);
> 		}
> 				
> 	    }
> 	    e_table_model_row_changed (E_TABLE_MODEL (model), model_row); 
> 	}
> }
> 
Index: e-cal-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.c,v
retrieving revision 1.24
diff -r1.24 e-cal-popup.c
584c584
< 				if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) {
---
> 				if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) 
586,587c586,587
< 					break;
< 				}
---
> 				else
> 					mask &= ~E_CAL_POPUP_SELECT_COMPLETE;
638a639,642
> 		if (icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY))
> 			mask &= ~E_CAL_POPUP_SELECT_COMPLETE;
> 		
> 
801a806
> 	{ "complete" , E_CAL_POPUP_SELECT_COMPLETE},
Index: e-cal-popup.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.h,v
retrieving revision 1.12
diff -r1.12 e-cal-popup.h
89a90
> 	E_CAL_POPUP_SELECT_COMPLETE = 1<<17,
Index: e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.154
diff -r1.154 e-calendar-table.c
1201a1202,1222
> /* Used from e_table_selected_row_foreach() */
> static void
> mark_row_incomplete_cb (int model_row, gpointer data)
> {
> 	ECalendarTable *cal_table;
> 
> 	cal_table = E_CALENDAR_TABLE (data);
> 	e_cal_model_tasks_mark_task_incomplete (E_CAL_MODEL_TASKS (cal_table->model), model_row);
> }
> 
> /* Callback used for the "mark tasks as incomplete" menu item */
> static void
> mark_as_incomplete_cb (EPopup *ep, EPopupItem *pitem, void *data)
> {
> 	ECalendarTable *cal_table = data;
> 	ETable *etable;
> 
> 	etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
> 	e_table_selected_row_foreach (etable, mark_row_incomplete_cb, cal_table);
> }
1274a1296
> 	{ E_POPUP_ITEM, "c0.markoneincomplete", N_("Mark as _Incomplete"), mark_as_incomplete_cb, NULL, NULL, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE|E_CAL_POPUP_SELECT_COMPLETE},
1277c1299
< 	{ E_POPUP_BAR, "c0.bar" },
---
> 	{ E_POPUP_BAR, "d0.bar" },
1279,1280c1301,1302
< 	{ E_POPUP_ITEM, "d0.delete", N_("_Delete"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE },
< 	{ E_POPUP_ITEM, "e0.deletemany", N_("_Delete Selected Tasks"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_MANY, E_CAL_POPUP_SELECT_EDITABLE },
---
> 	{ E_POPUP_ITEM, "e0.delete", N_("_Delete"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE },
> 	{ E_POPUP_ITEM, "f0.deletemany", N_("_Delete Selected Tasks"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_MANY, E_CAL_POPUP_SELECT_EDITABLE },
