evolution r37375 - in trunk/calendar: . gui gui/dialogs



Author: pchen
Date: Thu Mar  5 10:29:43 2009
New Revision: 37375
URL: http://svn.gnome.org/viewvc/evolution?rev=37375&view=rev

Log:
Fixes #435455 (bnc)

Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/dialogs/comp-editor.c
   trunk/calendar/gui/dialogs/event-editor.c
   trunk/calendar/gui/dialogs/event-page.c
   trunk/calendar/gui/dialogs/memo-page.c
   trunk/calendar/gui/dialogs/task-page.c
   trunk/calendar/gui/e-calendar-view.c
   trunk/calendar/gui/e-calendar-view.h
   trunk/calendar/gui/e-day-view.c
   trunk/calendar/gui/itip-utils.c
   trunk/calendar/gui/itip-utils.h

Modified: trunk/calendar/gui/dialogs/comp-editor.c
==============================================================================
--- trunk/calendar/gui/dialogs/comp-editor.c	(original)
+++ trunk/calendar/gui/dialogs/comp-editor.c	Thu Mar  5 10:29:43 2009
@@ -774,7 +774,7 @@
 	}
 
 	/* If we are not the organizer, we don't update the sequence number */
-	if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone))
+	if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone, priv->client))
 		e_cal_component_commit_sequence (clone);
 	else
 		e_cal_component_abort_sequence (clone);
@@ -809,7 +809,7 @@
 
 		if (result && priv->mod == CALOBJ_MOD_THIS) {
 			/* FIXME do we really need to do this ? */
-			if ((flags & COMP_EDITOR_DELEGATE) || !e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone))
+			if ((flags & COMP_EDITOR_DELEGATE) || !e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone, priv->client))
 				e_cal_component_commit_sequence (clone);
 			else
 				e_cal_component_abort_sequence (clone);
@@ -909,7 +909,7 @@
 		return FALSE;
 
 	if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org, &strip_alarms))) {
- 		if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp))) {
+ 		if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp, priv->client))) {
  			if (e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_JOURNAL)
 				return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_PUBLISH, strip_alarms);
 			else
@@ -2989,7 +2989,7 @@
 		priv->comp = e_cal_component_clone (comp);
 
  	priv->existing_org = e_cal_component_has_organizer (comp);
- 	priv->user_org = (itip_organizer_is_user (comp, priv->client) || itip_sentby_is_user (comp));
+ 	priv->user_org = (itip_organizer_is_user (comp, priv->client) || itip_sentby_is_user (comp, priv->client));
  	priv->warned = FALSE;
 
 	update_window_border (editor, NULL);

Modified: trunk/calendar/gui/dialogs/event-editor.c
==============================================================================
--- trunk/calendar/gui/dialogs/event-editor.c	(original)
+++ trunk/calendar/gui/dialogs/event-editor.c	Thu Mar  5 10:29:43 2009
@@ -616,7 +616,7 @@
 	}
 	e_cal_component_free_attendee_list (attendees);
 
-	comp_editor_set_needs_send (editor, priv->meeting_shown && (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)));
+	comp_editor_set_needs_send (editor, priv->meeting_shown && (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)));
 
 	priv->updating = FALSE;
 }

Modified: trunk/calendar/gui/dialogs/event-page.c
==============================================================================
--- trunk/calendar/gui/dialogs/event-page.c	(original)
+++ trunk/calendar/gui/dialogs/event-page.c	Thu Mar  5 10:29:43 2009
@@ -962,7 +962,7 @@
 				gchar *string;
 				GList *list = NULL;
 
-				if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) {
+				if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) {
 					if (e_cal_get_static_capability (
 								client,
 								CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))

Modified: trunk/calendar/gui/dialogs/memo-page.c
==============================================================================
--- trunk/calendar/gui/dialogs/memo-page.c	(original)
+++ trunk/calendar/gui/dialogs/memo-page.c	Thu Mar  5 10:29:43 2009
@@ -262,7 +262,7 @@
 			else
 				string = g_strdup (strip);
 
-			if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) {
+			if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) {
 				gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), string);
 			} else {
 				list = g_list_append (list, string);

Modified: trunk/calendar/gui/dialogs/task-page.c
==============================================================================
--- trunk/calendar/gui/dialogs/task-page.c	(original)
+++ trunk/calendar/gui/dialogs/task-page.c	Thu Mar  5 10:29:43 2009
@@ -616,7 +616,7 @@
 				gchar *string;
 				GList *list = NULL;
 
-				if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) {
+				if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) {
 					if (e_cal_get_static_capability (
 								client,
 								CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))

Modified: trunk/calendar/gui/e-calendar-view.c
==============================================================================
--- trunk/calendar/gui/e-calendar-view.c	(original)
+++ trunk/calendar/gui/e-calendar-view.c	Thu Mar  5 10:29:43 2009
@@ -368,7 +368,7 @@
 			g_free (uid);
 		}
 
-		if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) &&
+		if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) &&
 		    send_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
 					   client, comp, TRUE, &strip_alarms)) {
 			itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
@@ -670,7 +670,7 @@
 		comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 
-		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp))
+		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client))
 		    && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
 						event->comp_data->client, comp, TRUE))
 			itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
@@ -1064,7 +1064,7 @@
 		const char *uid;
 		char *rid = NULL;
 
-		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp))
+		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client))
 		    && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
 						event->comp_data->client,
 						comp, TRUE))
@@ -1203,7 +1203,7 @@
 		e_cal_component_free_datetime (&dt);
 
 
-		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp))
+		if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp, event->comp_data->client))
 				&& cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
 					event->comp_data->client,
 					comp, TRUE) && !e_cal_get_save_schedules (event->comp_data->client)) {
@@ -2159,7 +2159,7 @@
 		ECalComponent *comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 		flags |= COMP_EDITOR_MEETING;
-		if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp) || !e_cal_component_has_attendees (comp))
+		if (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client) || !e_cal_component_has_attendees (comp))
 			flags |= COMP_EDITOR_USER_ORG;
 		g_object_unref (comp);
 	}
@@ -2178,7 +2178,7 @@
 	if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
 		gboolean strip_alarms = TRUE;
 
-		if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) &&
+		if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp, client)) &&
 		    send_component_dialog (toplevel, client, comp, new, &strip_alarms)) {
 			ECalComponent *send_comp = NULL;
 

Modified: trunk/calendar/gui/e-calendar-view.h
==============================================================================
--- trunk/calendar/gui/e-calendar-view.h	(original)
+++ trunk/calendar/gui/e-calendar-view.h	Thu Mar  5 10:29:43 2009
@@ -67,6 +67,7 @@
         guint16 start_minute; \
         guint16 end_minute; \
         guint different_timezone : 1; \
+	gboolean is_editable;	\
 	GtkWidget *tooltip; \
 	gint	timeout; \
 	GdkColor *color; \

Modified: trunk/calendar/gui/e-day-view.c
==============================================================================
--- trunk/calendar/gui/e-day-view.c	(original)
+++ trunk/calendar/gui/e-day-view.c	Thu Mar  5 10:29:43 2009
@@ -3250,6 +3250,13 @@
 	     !e_cal_util_component_has_recurrences (event->comp_data->icalcomp))
 	    && (pos == E_CALENDAR_VIEW_POS_TOP_EDGE
 		|| pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)) {
+		gboolean read_only = FALSE;
+	
+		if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) {
+			return;
+		}
+
+
 		/* Grab the keyboard focus, so the event being edited is saved
 		   and we can use the Escape key to abort the resize. */
 		if (!GTK_WIDGET_HAS_FOCUS (day_view))
@@ -3722,9 +3729,12 @@
 			gtk_target_list_unref (target_list);
 		}
 	} else {
+		gboolean read_only = FALSE;
 		cursor = day_view->normal_cursor;
 
-		if (event) {
+		/* Check if the event is editable and client is not readonly while changing the cursor */
+		if (event && event->is_editable && e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && !read_only) {
+
 			switch (pos) {
 			case E_CALENDAR_VIEW_POS_LEFT_EDGE:
 				cursor = day_view->move_cursor;
@@ -3903,6 +3913,7 @@
 	EDayViewEvent *event;
 	gint day, event_num;
 	gboolean need_reshape = FALSE;
+	gboolean read_only = FALSE;
 
 #if 0
 	g_print ("Updating resize Row:%i\n", row);
@@ -3916,6 +3927,10 @@
 	event = &g_array_index (day_view->events[day], EDayViewEvent,
 				event_num);
 
+	if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) {
+		return;
+	}
+
 	if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
 		row = MIN (row, day_view->resize_end_row);
 		if (row != day_view->resize_start_row) {
@@ -4289,6 +4304,11 @@
 						    e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))))
 		event.different_timezone = TRUE;
 
+	if (!e_cal_component_has_attendees (comp) || itip_organizer_is_user (comp, event.comp_data->client) || itip_sentby_is_user (comp, event.comp_data->client))
+		event.is_editable = TRUE;
+	else
+		event.is_editable = FALSE;
+
 	/* Find out which array to add the event to. */
 	for (day = 0; day < add_event_data->day_view->days_shown; day++) {
 		if (start >= add_event_data->day_view->day_starts[day]

Modified: trunk/calendar/gui/itip-utils.c
==============================================================================
--- trunk/calendar/gui/itip-utils.c	(original)
+++ trunk/calendar/gui/itip-utils.c	Thu Mar  5 10:29:43 2009
@@ -123,13 +123,13 @@
 }
 
 gboolean
-itip_sentby_is_user (ECalComponent *comp)
+itip_sentby_is_user (ECalComponent *comp, ECal *client)
 {
 	ECalComponentOrganizer organizer;
 	const char *strip;
 	gboolean user_sentby = FALSE;
 
-	if (!e_cal_component_has_organizer (comp))
+	if (!e_cal_component_has_organizer (comp) ||e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER))
 		return FALSE;
 
 	e_cal_component_get_organizer (comp, &organizer);
@@ -936,7 +936,7 @@
 		}
 	}
 
-	if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp)) {
+	if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp, client)) {
 		EAccount *a = itip_addresses_get_default ();
 
 		organizer.value = g_strdup (organizer.value);

Modified: trunk/calendar/gui/itip-utils.h
==============================================================================
--- trunk/calendar/gui/itip-utils.h	(original)
+++ trunk/calendar/gui/itip-utils.h	Thu Mar  5 10:29:43 2009
@@ -52,7 +52,7 @@
 
 gboolean itip_organizer_is_user (ECalComponent *comp, ECal *client);
 gboolean itip_organizer_is_user_ex (ECalComponent *comp, ECal *client, gboolean skip_cap_test);
-gboolean itip_sentby_is_user (ECalComponent *comp);
+gboolean itip_sentby_is_user (ECalComponent *comp, ECal *client);
 
 const gchar *itip_strip_mailto (const gchar *address);
 



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