[evolution-patches] Patch for some UI changes in [calendar/tasks]



Hi,
   Made a patch which does the following
1) Set the Title of the appointment editor as "Meeting" if a New meeting
or an existing meeting is opened. Similarly set the title for the task
editor as "Assigned Task".
2) Show the task page in the task editor when a assigned task is opened
instead of showing the meeting page.
3) Construct the Meeting page only for the assigned tasks.


thanks, chenthill.
? .ChangeLog.swp
? .patch.swp
? patch
? patch_editor.diff
? patch_editors.diff
? gui/.e-calendar-table.c.swp
? gui/diff
? gui/dialogs/.comp-editor.c.swp
? gui/dialogs/.task-editor.c.swp
? gui/dialogs/.task-page.h.swp
? gui/dialogs/diff
? gui/dialogs/event-page.gladep
? gui/dialogs/send-options.gladep
? gui/dialogs/task-page.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2570
diff -u -p -r1.2570 ChangeLog
--- ChangeLog	29 Nov 2004 09:03:43 -0000	1.2570
+++ ChangeLog	29 Nov 2004 10:26:40 -0000
@@ -1,4 +1,29 @@
 2004-11-29  Chenthill Palanisamy  <pchenthill novell com>
+
+	* gui/task-editor.[ch] (task_editor_new), (task_editor_construct):
+	Add a boolean variable to denote assigned task and construct the 
+	meeting page only for the assigned task. Set it as a group item
+	in component editor.
+	(_TaskEditorPrivate): added the boolean variable (is_assigned).
+	(task_editor_init): initialized the variable.
+	* gui/comp-editor.[ch]: Added functions to set and get whether comp
+	 is a group item or individual item.
+	* gui/comp-editor.c (make_title_from_string), (make_title_from_comp):
+	Set the Title for the appointment editor window as "Meeting" or "Assigned
+	Task" if its a group calendar/task item.
+	(_CompEditorPrivate): added a boolean variable (is_group_item).
+	(comp_editor_init): initialized the same.
+	* gui/e-calendar-table.c (e_calendar_table_open_task), (e_calendar_table_open_selected),
+	(open_task_by_row): Check whether the component being opened is an assigned task by
+	checking for attendees and call open_task with proper value for boolean variable assign.
+	* gui/comp-editor-factory.c (edit_existing):
+	* gui/e-calendar-table.c (open_task):
+	* gui/e-tasks.c (e_tasks_new_task):
+	* gui/gnome-cal.c (gnome_calendar_new_task):
+	* gui/tasks-component.c (create_new_todo):
+	Called the function task_editor_new with a added argument.
+	
+2004-11-29  Chenthill Palanisamy  <pchenthill novell com>
 	* calendar-errors.xml.h: committng this file. Missed to
 	commit this one.
 
Index: gui/comp-editor-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/comp-editor-factory.c,v
retrieving revision 1.40
diff -u -p -r1.40 comp-editor-factory.c
--- gui/comp-editor-factory.c	19 Oct 2004 16:20:07 -0000	1.40
+++ gui/comp-editor-factory.c	29 Nov 2004 10:26:40 -0000
@@ -273,7 +273,7 @@ edit_existing (OpenClient *oc, const cha
 		break;
 
 	case E_CAL_COMPONENT_TODO:
-		editor = COMP_EDITOR (task_editor_new (oc->client));
+		editor = COMP_EDITOR (task_editor_new (oc->client, e_cal_component_has_attendees (comp)));
 		break;
 
 	default:
@@ -323,7 +323,7 @@ edit_new (OpenClient *oc, const GNOME_Ev
 		comp = cal_comp_event_new_with_current_time (oc->client, TRUE);
 		break;
 	case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO:
-		editor = COMP_EDITOR (task_editor_new (oc->client));
+		editor = COMP_EDITOR (task_editor_new (oc->client, FALSE));
 		comp = get_default_task (oc->client);
 		break;
 	default:
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.128
diff -u -p -r1.128 e-calendar-table.c
--- gui/e-calendar-table.c	28 Oct 2004 09:26:13 -0000	1.128
+++ gui/e-calendar-table.c	29 Nov 2004 10:26:40 -0000
@@ -584,10 +584,12 @@ void
 e_calendar_table_open_selected (ECalendarTable *cal_table)
 {
 	ECalModelComponent *comp_data;
+	icalproperty *prop;
 
 	comp_data = get_selected_comp (cal_table);
+	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	if (comp_data != NULL)
-		open_task (cal_table, comp_data, FALSE);
+		open_task (cal_table, comp_data, prop ? TRUE : FALSE);
 }
 
 /**
@@ -940,7 +942,7 @@ open_task (ECalendarTable *cal_table, EC
 	if (tedit == NULL) {
 		ECalComponent *comp;
 
-		tedit = COMP_EDITOR (task_editor_new (comp_data->client));
+		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));
@@ -959,9 +961,11 @@ static void
 open_task_by_row (ECalendarTable *cal_table, int row)
 {
 	ECalModelComponent *comp_data;
+	icalproperty *prop;
 
 	comp_data = e_cal_model_get_component_at (cal_table->model, row);
-	open_task (cal_table, comp_data, FALSE);
+	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
+	open_task (cal_table, comp_data, prop ? TRUE : FALSE);
 }
 
 static void
@@ -981,10 +985,12 @@ e_calendar_table_on_open_task (EPopup *e
 {
 	ECalendarTable *cal_table = data;
 	ECalModelComponent *comp_data;
+	icalproperty *prop;
 
 	comp_data = get_selected_comp (cal_table);
+	prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	if (comp_data)
-		open_task (cal_table, comp_data, FALSE);
+		open_task (cal_table, comp_data, prop ? TRUE : FALSE);
 }
 
 static void
Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.104
diff -u -p -r1.104 e-tasks.c
--- gui/e-tasks.c	14 Oct 2004 15:53:29 -0000	1.104
+++ gui/e-tasks.c	29 Nov 2004 10:26:40 -0000
@@ -901,7 +901,7 @@ e_tasks_new_task			(ETasks		*tasks)
 	category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar));
 	e_cal_component_set_categories (comp, category);
 
-	tedit = task_editor_new (ecal);
+	tedit = task_editor_new (ecal, FALSE);
 	comp_editor_edit_comp (COMP_EDITOR (tedit), comp);
 	g_object_unref (comp);
 
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.356
diff -u -p -r1.356 gnome-cal.c
--- gui/gnome-cal.c	20 Oct 2004 03:03:30 -0000	1.356
+++ gui/gnome-cal.c	29 Nov 2004 10:26:41 -0000
@@ -2833,7 +2833,7 @@ gnome_calendar_new_task		(GnomeCalendar 
 	if (!ecal)
 		return;
 	
-	tedit = task_editor_new (ecal);
+	tedit = task_editor_new (ecal, FALSE);
 
 	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.80
diff -u -p -r1.80 tasks-component.c
--- gui/tasks-component.c	28 Oct 2004 09:26:13 -0000	1.80
+++ gui/tasks-component.c	29 Nov 2004 10:26:41 -0000
@@ -791,7 +791,7 @@ create_new_todo (TasksComponent *task_co
 	if (!ecal)
 		return FALSE;
 
-	editor = task_editor_new (ecal);
+	editor = task_editor_new (ecal, is_assigned);
 	comp = cal_comp_task_new_with_defaults (ecal);
 
 	comp_editor_edit_comp (COMP_EDITOR (editor), comp);
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.113
diff -u -p -r1.113 comp-editor.c
--- gui/dialogs/comp-editor.c	29 Nov 2004 08:45:59 -0000	1.113
+++ gui/dialogs/comp-editor.c	29 Nov 2004 10:26:41 -0000
@@ -76,6 +76,7 @@ struct _CompEditorPrivate {
 	
  	gboolean existing_org;
  	gboolean user_org;
+	gboolean is_group_item;
 	
  	gboolean warned;
 };
@@ -358,16 +359,16 @@ response_cb (GtkWidget *widget, int resp
 		if (e_cal_component_is_instance (priv->comp))
 			if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
 				return;
-		
+	
 		if (save_comp_with_send (editor)) {
-
+	
 			e_cal_component_get_summary (priv->comp, &text);
 		
 			if (!text.value) {
 				if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp))
 					return;
 			}
-				close_dialog (editor);
+			close_dialog (editor);
 		}
 
 		break;
@@ -421,6 +422,7 @@ comp_editor_init (CompEditor *editor)
  	priv->existing_org = FALSE;
  	priv->user_org = FALSE;
  	priv->warned = FALSE;
+	priv->is_group_item = FALSE;
 
 	gtk_window_set_type_hint (GTK_WINDOW (editor), GDK_WINDOW_TYPE_HINT_NORMAL);
 }
@@ -578,6 +580,31 @@ comp_editor_get_user_org (CompEditor *ed
 	return priv->user_org;
 }
 
+void
+comp_editor_set_group_item (CompEditor *editor, gboolean group_item)
+{
+	CompEditorPrivate *priv;
+
+	g_return_if_fail (editor != NULL);
+	g_return_if_fail (IS_COMP_EDITOR (editor));
+
+	priv = editor->priv;
+
+	priv->is_group_item = group_item;
+}
+
+gboolean
+comp_editor_get_is_group_item (CompEditor *editor)
+{
+	CompEditorPrivate *priv;
+
+	g_return_val_if_fail (editor != NULL, FALSE);
+	g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
+
+	priv = editor->priv;
+
+	return priv->is_group_item;
+}
 
 /**
  * comp_editor_set_changed:
@@ -861,7 +888,7 @@ comp_editor_get_e_cal (CompEditor *edito
 
 /* Creates an appropriate title for the event editor dialog */
 static char *
-make_title_from_comp (ECalComponent *comp)
+make_title_from_comp (ECalComponent *comp, gboolean is_group_item)
 {
 	char *title;
 	const char *type_string;
@@ -874,10 +901,16 @@ make_title_from_comp (ECalComponent *com
 	type = e_cal_component_get_vtype (comp);
 	switch (type) {
 	case E_CAL_COMPONENT_EVENT:
-		type_string = _("Appointment - %s");
+		if (is_group_item)
+			type_string = _("Meeting - %s");
+		else
+			type_string = _("Appointment - %s");
 		break;
 	case E_CAL_COMPONENT_TODO:
-		type_string = _("Task - %s");
+		if (is_group_item)
+			type_string = _("Assigned Task - %s");
+		else
+			type_string = _("Task - %s");
 		break;
 	case E_CAL_COMPONENT_JOURNAL:
 		type_string = _("Journal entry - %s");
@@ -899,7 +932,7 @@ make_title_from_comp (ECalComponent *com
 
 /* Creates an appropriate title for the event editor dialog */
 static char *
-make_title_from_string (ECalComponent *comp, const char *str)
+make_title_from_string (ECalComponent *comp, const char *str, gboolean is_group_item)
 {
 	char *title;
 	const char *type_string;
@@ -911,10 +944,16 @@ make_title_from_string (ECalComponent *c
 	type = e_cal_component_get_vtype (comp);
 	switch (type) {
 	case E_CAL_COMPONENT_EVENT:
-		type_string = _("Appointment - %s");
+		if (is_group_item)
+			type_string = _("Meeting - %s");
+		else
+			type_string = _("Appointment - %s");
 		break;
 	case E_CAL_COMPONENT_TODO:
-		type_string = _("Task - %s");
+		if (is_group_item)
+			type_string = _("Assigned Task - %s");	
+		else
+			type_string = _("Task - %s");
 		break;
 	case E_CAL_COMPONENT_JOURNAL:
 		type_string = _("Journal entry - %s");
@@ -962,7 +1001,7 @@ set_title_from_comp (CompEditor *editor)
 	char *title;
 
 	priv = editor->priv;
-	title = make_title_from_comp (priv->comp);
+	title = make_title_from_comp (priv->comp, priv->is_group_item);
 	gtk_window_set_title (GTK_WINDOW (editor), title);
 	g_free (title);
 }
@@ -974,7 +1013,7 @@ set_title_from_string (CompEditor *edito
 	char *title;
 
 	priv = editor->priv;
-	title = make_title_from_string (priv->comp, str);
+	title = make_title_from_string (priv->comp, str, priv->is_group_item);
 	gtk_window_set_title (GTK_WINDOW (editor), title);
 	g_free (title);
 }
Index: gui/dialogs/comp-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.h,v
retrieving revision 1.22
diff -u -p -r1.22 comp-editor.h
--- gui/dialogs/comp-editor.h	22 Jun 2004 22:35:41 -0000	1.22
+++ gui/dialogs/comp-editor.h	29 Nov 2004 10:26:41 -0000
@@ -68,6 +68,9 @@ gboolean      comp_editor_get_existing_o
 void          comp_editor_set_user_org     (CompEditor             *editor,
 					    gboolean                user_org);
 gboolean      comp_editor_get_user_org     (CompEditor             *editor);
+void          comp_editor_set_group_item     (CompEditor             *editor,
+					    gboolean                is_group_item);
+gboolean      comp_editor_get_group_item     (CompEditor             *editor);
 void          comp_editor_append_page      (CompEditor             *editor,
 					    CompEditorPage         *page,
 					    const char             *label);
Index: gui/dialogs/event-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-editor.c,v
retrieving revision 1.50
diff -u -p -r1.50 event-editor.c
--- gui/dialogs/event-editor.c	25 Nov 2004 08:08:02 -0000	1.50
+++ gui/dialogs/event-editor.c	29 Nov 2004 10:26:42 -0000
@@ -147,6 +147,7 @@ event_editor_construct (EventEditor *ee,
 				 _("Recurrence"));
 	
 	if (priv->is_meeting) {
+		comp_editor_set_group_item (COMP_EDITOR (ee), TRUE);
 		priv->sched_page = schedule_page_new (priv->model);
 		g_object_ref (priv->sched_page);
 		gtk_object_sink (GTK_OBJECT (priv->sched_page));
@@ -359,6 +360,7 @@ show_meeting (EventEditor *ee)
 
 	priv = ee->priv;
 
+	
 	if (!priv->meeting_shown) {
 		comp_editor_append_page (COMP_EDITOR (ee),
 					 COMP_EDITOR_PAGE (priv->sched_page),
Index: gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.75
diff -u -p -r1.75 task-editor.c
--- gui/dialogs/task-editor.c	14 Oct 2004 14:22:12 -0000	1.75
+++ gui/dialogs/task-editor.c	29 Nov 2004 10:26:42 -0000
@@ -45,6 +45,7 @@ struct _TaskEditorPrivate {
 	EMeetingStore *model;
 	
 	gboolean assignment_shown;
+	gboolean is_assigned;
 	gboolean updating;	
 };
 
@@ -115,16 +116,18 @@ task_editor_init (TaskEditor *te)
 	priv->model = E_MEETING_STORE (e_meeting_store_new ());
 	priv->assignment_shown = TRUE;
 	priv->updating = FALSE;	
+	priv->is_assigned = FALSE;
 
 }
 
 TaskEditor *
-task_editor_construct (TaskEditor *te, ECal *client)
+task_editor_construct (TaskEditor *te, ECal *client, gboolean is_assigned)
 {
 	TaskEditorPrivate *priv;
 	
 	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));
@@ -140,13 +143,15 @@ task_editor_construct (TaskEditor *te, E
 	comp_editor_append_page (COMP_EDITOR (te),
 				 COMP_EDITOR_PAGE (priv->task_details_page),
 				 _("Status"));
-
-	priv->meet_page = meeting_page_new (priv->model, client);
-	g_object_ref (priv->meet_page);
-	gtk_object_sink (GTK_OBJECT (priv->meet_page));
-	comp_editor_append_page (COMP_EDITOR (te),
-				 COMP_EDITOR_PAGE (priv->meet_page),
-				 _("Assignment"));
+	if (priv->is_assigned) {
+		comp_editor_set_group_item (COMP_EDITOR (te), TRUE);
+		priv->meet_page = meeting_page_new (priv->model, client);
+		g_object_ref (priv->meet_page);
+		gtk_object_sink (GTK_OBJECT (priv->meet_page));
+		comp_editor_append_page (COMP_EDITOR (te),
+					 COMP_EDITOR_PAGE (priv->meet_page),
+					 _("Assignment"));
+	}
 
 	comp_editor_set_e_cal (COMP_EDITOR (te), client);
 
@@ -245,7 +250,9 @@ task_editor_edit_comp (CompEditor *edito
 			if (ia != NULL)
 				e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
 		}
-
+		
+		
+		comp_editor_set_group_item (COMP_EDITOR (te), TRUE);
 		priv->assignment_shown = TRUE;		
 	}
 	e_cal_component_free_attendee_list (attendees);
@@ -324,12 +331,12 @@ task_editor_finalize (GObject *object)
  * editor could not be created.
  **/
 TaskEditor *
-task_editor_new (ECal *client)
+task_editor_new (ECal *client, gboolean is_assigned)
 {
 	TaskEditor *te;
 
 	te = g_object_new (TYPE_TASK_EDITOR, NULL);
-	return task_editor_construct (te, client);
+	return task_editor_construct (te, client, is_assigned);
 }
 
 static void
@@ -349,8 +356,6 @@ show_assignment (TaskEditor *te)
 		comp_editor_set_changed (COMP_EDITOR (te), TRUE);
 	}
 
-	comp_editor_show_page (COMP_EDITOR (te),
-			       COMP_EDITOR_PAGE (priv->meet_page));
 }
 
 void
Index: gui/dialogs/task-editor.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.h,v
retrieving revision 1.14
diff -u -p -r1.14 task-editor.h
--- gui/dialogs/task-editor.h	7 Nov 2003 05:52:08 -0000	1.14
+++ gui/dialogs/task-editor.h	29 Nov 2004 10:26:42 -0000
@@ -53,8 +53,8 @@ struct _TaskEditorClass {
 
 GtkType     task_editor_get_type       (void);
 TaskEditor *task_editor_construct      (TaskEditor *te,
-					ECal  *client);
-TaskEditor *task_editor_new            (ECal  *client);
+					ECal  *client, gboolean is_assigned);
+TaskEditor *task_editor_new            (ECal  *client, gboolean is_assigned);
 void        task_editor_show_assignment(TaskEditor *te);
 
 


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