File bnc-435455-dont-resize-meeting.patch of Package evolution
--- calendar/gui/dialogs/comp-editor.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/dialogs/comp-editor.c 2009-02-05 16:46:44.000000000 +0530
@@ -773,7 +773,7 @@ save_comp (CompEditor *editor)
}
/* 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);
@@ -815,7 +815,7 @@ save_comp (CompEditor *editor)
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);
@@ -914,7 +914,7 @@ save_comp_with_send (CompEditor *editor)
return FALSE;
if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org))) {
- 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);
else
@@ -3014,7 +3014,7 @@ real_edit_comp (CompEditor *editor, ECal
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);
--- calendar/gui/dialogs/event-editor.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/dialogs/event-editor.c 2009-02-05 16:44:14.000000000 +0530
@@ -640,7 +640,7 @@ event_editor_edit_comp (CompEditor *edit
}
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;
}
--- calendar/gui/dialogs/event-page.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/dialogs/event-page.c 2009-02-05 16:44:14.000000000 +0530
@@ -981,7 +981,7 @@ event_page_fill_widgets (CompEditorPage
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))
--- calendar/gui/dialogs/memo-page.c 2008-10-13 14:13:39.000000000 +0530
+++ calendar/gui/dialogs/memo-page.c 2009-02-05 16:44:14.000000000 +0530
@@ -261,7 +261,7 @@ memo_page_fill_widgets (CompEditorPage *
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);
--- calendar/gui/dialogs/task-page.c 2008-10-13 14:13:39.000000000 +0530
+++ calendar/gui/dialogs/task-page.c 2009-02-05 16:44:14.000000000 +0530
@@ -615,7 +615,7 @@ task_page_fill_widgets (CompEditorPage *
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))
--- calendar/gui/e-calendar-view.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/e-calendar-view.c 2009-02-05 16:49:08.000000000 +0530
@@ -375,7 +375,7 @@ e_calendar_view_add_event (ECalendarView
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)) {
itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
@@ -675,7 +675,7 @@ e_calendar_view_cut_clipboard (ECalendar
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,
@@ -948,7 +948,7 @@ delete_event (ECalendarView *cal_view, E
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))
@@ -1087,7 +1087,7 @@ e_calendar_view_delete_selected_occurren
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)) {
@@ -2016,7 +2016,7 @@ e_calendar_view_edit_appointment (ECalen
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);
}
@@ -2033,7 +2033,7 @@ e_calendar_view_modify_and_send (ECalCom
gboolean new)
{
if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, 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)) &&
send_component_dialog (toplevel, client, comp, new)) {
ECalComponent *send_comp = NULL;
--- calendar/gui/e-calendar-view.h 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/e-calendar-view.h 2009-02-05 16:44:14.000000000 +0530
@@ -67,6 +67,7 @@ typedef enum {
guint16 start_minute; \
guint16 end_minute; \
guint different_timezone : 1; \
+ gboolean is_editable; \
GtkWidget *tooltip; \
gint timeout; \
GdkColor *color; \
--- calendar/gui/e-day-view.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/e-day-view.c 2009-02-05 16:44:14.000000000 +0530
@@ -3202,6 +3202,13 @@ e_day_view_on_event_click (EDayView *day
!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))
@@ -3674,9 +3681,12 @@ e_day_view_on_main_canvas_motion (GtkWid
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;
@@ -3855,6 +3865,7 @@ e_day_view_update_resize (EDayView *day_
EDayViewEvent *event;
gint day, event_num;
gboolean need_reshape = FALSE;
+ gboolean read_only = FALSE;
#if 0
g_print ("Updating resize Row:%i\n", row);
@@ -3868,6 +3879,10 @@ e_day_view_update_resize (EDayView *day_
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) {
@@ -4243,6 +4258,11 @@ e_day_view_add_event (ECalComponent *com
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]
--- calendar/gui/itip-utils.c 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/itip-utils.c 2009-02-05 16:44:14.000000000 +0530
@@ -123,13 +123,13 @@ itip_organizer_is_user (ECalComponent *c
}
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);
@@ -905,7 +905,7 @@ comp_sentby (ECalComponent *comp, ECal *
}
}
- 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);
--- calendar/gui/itip-utils.h 2009-02-04 09:57:29.000000000 +0530
+++ calendar/gui/itip-utils.h 2009-02-05 16:44:14.000000000 +0530
@@ -52,7 +52,7 @@ EAccount *itip_addresses_get_default (vo
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);