Re: [evolution-patches] patch for bug 317014 [Tasks]



Patch looks good. Added a missing flag to be set when a personal task is
converted to assigned one. Committed to both gnome-12 and HEAD.

thanks, Chenthill.

On Wed, 2005-09-28 at 07:28 -0600, Viren L wrote:
> Sorry missed the file e-tasks.c in the patch.
> Revised patch is attahced.
> 
> 
> Thanks,
> Viren
> >>> chen <pchenthill novell com> 09/27/05 17:37 PM >>>
> On Tue, 2005-09-27 at 05:01 -0600, Viren L wrote:
> >      if (!priv->assignment_shown) {
> > +               flags |= COMP_EDITOR_USER_ORG;
> > +               comp_editor_set_flags (COMP_EDITOR (te), fla 
> 
> The flags should be set when the task editor is created.
> 
> thanks, Chenthill.
> 
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-patches
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2804
diff -u -p -r1.2804 ChangeLog
--- ChangeLog	19 Sep 2005 08:10:51 -0000	1.2804
+++ ChangeLog	29 Sep 2005 12:46:47 -0000
@@ -1,3 +1,23 @@
+2005-08-29  Chenthill Palanisamy  <pchenthill novell com>
+
+	* gui/e-calendar-table.c (e_calendar_table_open_task): Set the 
+	USER_ORG flag while converting a personal task to assigned one.
+
+2005-09-28  Viren.L  <lviren novell com>
+
+	Fixes #317014
+	* gui/e-calendar-table.c (e_calendar_table_open_task):
+	Set the flags in e_calendar_table_open_task.
+	* gui/gnome-cal.c (gnome_calendar_new_task):set the NEW_ITEM flag.
+	* gui/tasks-component.c (create_new_todo),
+	* gui/e-tasks.c (e_tasks_new_task): set NEW_ITEM & USER_ORG flag.
+	* gui/comp-editor-factory.c (edit_existing):check itip_organizer_is_user
+	  for tasks as well. 
+	* gui/dialogs/comp-editor.h: Added COMP_EDITOR_IS_ASSIGNED to CompEditorFlags.
+	* gui/dialogs/comp-editor-page.h: Added COMP_EDITOR_PAGE_IS_ASSIGNED to page flags.
+	* gui/dialogs/task-editor.[ch]: Changed parameters for task_editor_new and
+	  task_editor_construct.
+
 2005-09-08  P. S. Chakravarthi <pchakravarthi novell com>
 
 	Fix #261625
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.139
diff -u -p -r1.139 e-calendar-table.c
--- gui/e-calendar-table.c	24 Aug 2005 03:07:49 -0000	1.139
+++ gui/e-calendar-table.c	29 Sep 2005 12:46:52 -0000
@@ -938,6 +938,7 @@ e_calendar_table_open_task (ECalendarTab
 {
 	CompEditor *tedit;
 	const char *uid;
+	guint32 flags = 0;
 	
 	uid = icalcomponent_get_uid (comp_data->icalcomp);
 
@@ -945,17 +946,25 @@ e_calendar_table_open_task (ECalendarTab
 	if (tedit == NULL) {
 		ECalComponent *comp;
 
-		tedit = COMP_EDITOR (task_editor_new (comp_data->client, assign));
-
 		comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
+
+		if (assign) {
+			flags |= COMP_EDITOR_IS_ASSIGNED;
+
+			if (itip_organizer_is_user (comp, comp_data->client) || 
+					!e_cal_component_has_attendees (comp))
+				flags |= COMP_EDITOR_USER_ORG;
+		}
+
+		tedit = COMP_EDITOR (task_editor_new (comp_data->client, flags));
 		comp_editor_edit_comp (tedit, comp);
-		if (assign)
+	
+		if (flags & COMP_EDITOR_IS_ASSIGNED)
 			task_editor_show_assignment (TASK_EDITOR (tedit));
 		
 		e_comp_editor_registry_add (comp_editor_registry, tedit, FALSE);
 	}
-	
 	comp_editor_focus (tedit);
 }
 
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.386
diff -u -p -r1.386 gnome-cal.c
--- gui/gnome-cal.c	24 Aug 2005 03:07:49 -0000	1.386
+++ gui/gnome-cal.c	29 Sep 2005 12:47:09 -0000
@@ -2924,18 +2924,19 @@ gnome_calendar_new_task		(GnomeCalendar 
 	ECalComponent *comp;
 	icalcomponent *icalcomp;
 	const char *category;
+	guint32 flags = 0;
 	
 	g_return_if_fail (gcal != NULL);
 	g_return_if_fail (GNOME_IS_CALENDAR (gcal));
 
 	priv = gcal->priv;
-
 	model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
 	ecal = e_cal_model_get_default_client (model);
 	if (!ecal)
 		return;
 	
-	tedit = task_editor_new (ecal, FALSE);
+	flags |= COMP_EDITOR_NEW_ITEM;
+	tedit = task_editor_new (ecal, flags);
 
 	icalcomp = e_cal_model_create_component_with_defaults (model);
 	comp = e_cal_component_new ();
Index: gui/tasks-component.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/tasks-component.c,v
retrieving revision 1.90
diff -u -p -r1.90 tasks-component.c
--- gui/tasks-component.c	24 Aug 2005 03:07:49 -0000	1.90
+++ gui/tasks-component.c	29 Sep 2005 12:47:14 -0000
@@ -909,6 +909,7 @@ create_new_todo (TasksComponent *task_co
 	TasksComponentPrivate *priv;
 	ECalComponent *comp;
 	TaskEditor *editor;
+	guint32 flags = 0;	
 	
 	priv = task_component->priv;
 	
@@ -916,7 +917,12 @@ create_new_todo (TasksComponent *task_co
 	if (!ecal)
 		return FALSE;
 
-	editor = task_editor_new (ecal, is_assigned);
+	if (is_assigned)
+		flags |= COMP_EDITOR_IS_ASSIGNED;
+	
+	flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG;
+
+	editor = task_editor_new (ecal, flags);
 	comp = cal_comp_task_new_with_defaults (ecal);
 
 	comp_editor_edit_comp (COMP_EDITOR (editor), comp);
Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.120
diff -u -p -r1.120 e-tasks.c
--- gui/e-tasks.c	24 Aug 2005 03:07:49 -0000	1.120
+++ gui/e-tasks.c	29 Sep 2005 12:47:20 -0000
@@ -952,6 +952,7 @@ e_tasks_new_task			(ETasks		*tasks)
 	ECalComponent *comp;
 	const char *category;
 	ECal *ecal;
+	guint32 flags = 0;
 	
 	g_return_if_fail (E_IS_TASKS (tasks));
 
@@ -962,12 +963,14 @@ e_tasks_new_task			(ETasks		*tasks)
 	if (!ecal)
 		return;
 	
+	flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG;
+	
 	comp = cal_comp_task_new_with_defaults (ecal);
 
 	category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar));
 	e_cal_component_set_categories (comp, category);
 
-	tedit = task_editor_new (ecal, FALSE);
+	tedit = task_editor_new (ecal, flags);
 	comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
 	g_object_unref (comp);
 
Index: gui/comp-editor-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/comp-editor-factory.c,v
retrieving revision 1.44
diff -u -p -r1.44 comp-editor-factory.c
--- gui/comp-editor-factory.c	12 Aug 2005 13:55:49 -0000	1.44
+++ gui/comp-editor-factory.c	29 Sep 2005 12:47:21 -0000
@@ -267,20 +267,20 @@ edit_existing (OpenClient *oc, const cha
 	/* Create the appropriate type of editor */
 	
 	vtype = e_cal_component_get_vtype (comp);
+	if (itip_organizer_is_user (comp, oc->client))
+		flags |= COMP_EDITOR_USER_ORG;
+
 
 	switch (vtype) {
 	case E_CAL_COMPONENT_EVENT:
 		if (e_cal_component_has_attendees (comp))
 			flags |= COMP_EDITOR_MEETING;
 	
-		if (itip_organizer_is_user (comp, oc->client))
-			flags |= COMP_EDITOR_USER_ORG;
-
 		editor = COMP_EDITOR (event_editor_new (oc->client, flags));
 		break;
 
 	case E_CAL_COMPONENT_TODO:
-		editor = COMP_EDITOR (task_editor_new (oc->client, e_cal_component_has_attendees (comp)));
+		editor = COMP_EDITOR (task_editor_new (oc->client, flags));
 		break;
 
 	default:
Index: gui/dialogs/comp-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.h,v
retrieving revision 1.29
diff -u -p -r1.29 comp-editor.h
--- gui/dialogs/comp-editor.h	19 Aug 2005 13:11:56 -0000	1.29
+++ gui/dialogs/comp-editor.h	29 Sep 2005 12:47:23 -0000
@@ -59,6 +59,7 @@ typedef enum {
 	COMP_EDITOR_MEETING = 1<<1,
 	COMP_EDITOR_DELEGATE = 1<<2,
 	COMP_EDITOR_USER_ORG = 1<<3,
+	COMP_EDITOR_IS_ASSIGNED = 1<<4,
 } CompEditorFlags;
 
 GtkType       comp_editor_get_type         (void);
Index: gui/dialogs/comp-editor-page.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor-page.h,v
retrieving revision 1.21
diff -u -p -r1.21 comp-editor-page.h
--- gui/dialogs/comp-editor-page.h	6 Jun 2005 21:05:18 -0000	1.21
+++ gui/dialogs/comp-editor-page.h	29 Sep 2005 12:47:23 -0000
@@ -48,6 +48,7 @@ typedef enum {
 	COMP_EDITOR_PAGE_MEETING = 1<<1,
 	COMP_EDITOR_PAGE_DELEGATE = 1<<2,
 	COMP_EDITOR_PAGE_USER_ORG = 1<<3,
+	COMP_EDITOR_PAGE_IS_ASSIGNED = 1<<4,
 } CompEditorPageFlags;
 
 typedef struct {
Index: gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.84
diff -u -p -r1.84 task-editor.c
--- gui/dialogs/task-editor.c	18 Aug 2005 11:20:23 -0000	1.84
+++ gui/dialogs/task-editor.c	29 Sep 2005 12:47:24 -0000
@@ -122,14 +122,13 @@ task_editor_init (TaskEditor *te)
 }
 
 TaskEditor *
-task_editor_construct (TaskEditor *te, ECal *client, gboolean is_assigned)
+task_editor_construct (TaskEditor *te, ECal *client)
 {
 	TaskEditorPrivate *priv;
 	gboolean read_only = FALSE;
 	
 	priv = te->priv;
 
-	priv->is_assigned = is_assigned;
 	priv->task_page = task_page_new ();
 	g_object_ref (priv->task_page);
 	gtk_object_sink (GTK_OBJECT (priv->task_page));
@@ -356,12 +355,15 @@ task_editor_finalize (GObject *object)
  * editor could not be created.
  **/
 TaskEditor *
-task_editor_new (ECal *client, gboolean is_assigned)
+task_editor_new (ECal *client, CompEditorFlags flags)
 {
 	TaskEditor *te;
 
 	te = g_object_new (TYPE_TASK_EDITOR, NULL);
-	return task_editor_construct (te, client, is_assigned);
+	te->priv->is_assigned = flags & COMP_EDITOR_IS_ASSIGNED;
+	comp_editor_set_flags (COMP_EDITOR (te), flags);
+
+	return task_editor_construct (te, client);
 }
 
 static void
Index: gui/dialogs/task-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.h,v
retrieving revision 1.15
diff -u -p -r1.15 task-editor.h
--- gui/dialogs/task-editor.h	2 Dec 2004 14:05:50 -0000	1.15
+++ gui/dialogs/task-editor.h	29 Sep 2005 12:47:24 -0000
@@ -53,8 +53,8 @@ struct _TaskEditorClass {
 
 GtkType     task_editor_get_type       (void);
 TaskEditor *task_editor_construct      (TaskEditor *te,
-					ECal  *client, gboolean is_assigned);
-TaskEditor *task_editor_new            (ECal  *client, gboolean is_assigned);
+					ECal  *client);
+TaskEditor *task_editor_new            (ECal  *client, CompEditorFlags flags);
 void        task_editor_show_assignment(TaskEditor *te);
 
 


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