[evolution-patches] event editor optimizations



hi,

 The following patch prevents the 'Invitations' and 'Scheduling' pages
from getting added to the event editor, if the component being edited is
not a meeting. Currently, they do not appear in the GUI, but issue a
spate of free/busy calls to eds, event when the items are not meetings.
Also, modified the 'meeting' argument in the
e_calendar_view_edit_appointment call to check if the component denotes
a meeting, instead of always sending FALSE.

Kindly review the same.

harish

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2547
diff -u -p -r1.2547 ChangeLog
--- ChangeLog	19 Oct 2004 03:51:00 -0000	1.2547
+++ ChangeLog	19 Oct 2004 15:01:11 -0000
@@ -1,5 +1,16 @@
 2004-10-19  Harish Krishnaswamy  <kharish novell com>
 
+	* gui/comp-editor-factory.c: (edit_existing):
+	Use e_cal_component_has_attendees to test if it is a meeting.
+	* gui/dialogs/event-editor.c: (event_editor_init):
+	By default, the event is not a meeting.
+	(event_editor_construct): Do not add the invitation, scheduling pages
+	to the editor if it is not a meeting. 
+	* gui/e-day-view.c: (e_day_view_on_event_double_click):
+	check the icalproperty to test if the event is a meeting.
+
+2004-10-19  Harish Krishnaswamy  <kharish novell com>
+
 	* gui/calendar-component.c (create_new_event):
 	* gui/e-calendar-view.c: (e_calendar_view_edit_appointment):
 	* gui/comp-editor-factory.c (edit_existing), (edit_new):
Index: gui/comp-editor-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/comp-editor-factory.c,v
retrieving revision 1.39
diff -u -p -r1.39 comp-editor-factory.c
--- gui/comp-editor-factory.c	19 Oct 2004 03:51:01 -0000	1.39
+++ gui/comp-editor-factory.c	19 Oct 2004 15:01:11 -0000
@@ -245,8 +245,6 @@ edit_existing (OpenClient *oc, const cha
 	icalcomponent *icalcomp;
 	CompEditor *editor;
 	ECalComponentVType vtype;
-	/* Presence of attendees indicates that component is a meeting */
-	GSList *attendees = NULL;
 
 	g_assert (oc->open);
 
@@ -271,8 +269,7 @@ edit_existing (OpenClient *oc, const cha
 
 	switch (vtype) {
 	case E_CAL_COMPONENT_EVENT:
-		e_cal_component_get_attendee_list (comp, &attendees);
-		editor = COMP_EDITOR (event_editor_new (oc->client, attendees ? TRUE: FALSE));
+		editor = COMP_EDITOR (event_editor_new (oc->client, e_cal_component_has_attendees (comp)));
 		break;
 
 	case E_CAL_COMPONENT_TODO:
Index: gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.255
diff -u -p -r1.255 e-day-view.c
--- gui/e-day-view.c	14 Oct 2004 14:44:41 -0000	1.255
+++ gui/e-day-view.c	19 Oct 2004 15:01:12 -0000
@@ -3246,6 +3246,7 @@ e_day_view_on_event_double_click (EDayVi
 				  gint event_num)
 {
 	EDayViewEvent *event;
+	icalproperty *attendee_prop = NULL;
 
 	if (day == -1)
 		event = &g_array_index (day_view->long_events, EDayViewEvent,
@@ -3256,9 +3257,11 @@ e_day_view_on_event_double_click (EDayVi
 
 	e_day_view_stop_editing_event (day_view);
 
+    
+	attendee_prop = icalcomponent_get_first_property (event->comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY);
 	e_calendar_view_edit_appointment (E_CALENDAR_VIEW (day_view),
 				     event->comp_data->client, 
-				     event->comp_data->icalcomp, FALSE);
+				     event->comp_data->icalcomp, attendee_prop ? TRUE:FALSE);
 }
 
 static void
Index: gui/dialogs/event-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-editor.c,v
retrieving revision 1.48
diff -u -p -r1.48 event-editor.c
--- gui/dialogs/event-editor.c	19 Oct 2004 03:51:01 -0000	1.48
+++ gui/dialogs/event-editor.c	19 Oct 2004 15:01:12 -0000
@@ -120,6 +120,7 @@ event_editor_init (EventEditor *ee)
 	priv->model = E_MEETING_STORE (e_meeting_store_new ());
 	priv->meeting_shown = TRUE;
 	priv->updating = FALSE;	
+	priv->is_meeting = FALSE;
 }
 
 EventEditor *
@@ -145,20 +146,21 @@ event_editor_construct (EventEditor *ee,
 				 COMP_EDITOR_PAGE (priv->recur_page),
 				 _("Recurrence"));
 	
-	priv->sched_page = schedule_page_new (priv->model);
-	g_object_ref (priv->sched_page);
-	gtk_object_sink (GTK_OBJECT (priv->sched_page));
-	comp_editor_append_page (COMP_EDITOR (ee),
-				 COMP_EDITOR_PAGE (priv->sched_page),
-				 _("Scheduling"));
-
-	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 (ee),
-				 COMP_EDITOR_PAGE (priv->meet_page),
-				 _("Invitations"));
-
+	if (priv->is_meeting) {
+		priv->sched_page = schedule_page_new (priv->model);
+		g_object_ref (priv->sched_page);
+		gtk_object_sink (GTK_OBJECT (priv->sched_page));
+		comp_editor_append_page (COMP_EDITOR (ee),
+					 COMP_EDITOR_PAGE (priv->sched_page),
+					 _("Scheduling"));
+		
+		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 (ee),
+					 COMP_EDITOR_PAGE (priv->meet_page),
+					 _("Invitations"));
+	}
 	comp_editor_set_e_cal (COMP_EDITOR (ee), client);
 
 	init_widgets (ee);


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