aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2009-03-05 18:29:43 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2009-03-05 18:29:43 +0800
commitf04e4e06d22dc1ab0dd25501d9199d7e5014dbf9 (patch)
treed20f3cf8250c50090453d359ed6972fe96f0f3e3
parentb8301aa653a2ce7cbe3785f175b85a7f32e67be7 (diff)
downloadgsoc2013-evolution-f04e4e06d22dc1ab0dd25501d9199d7e5014dbf9.tar.gz
gsoc2013-evolution-f04e4e06d22dc1ab0dd25501d9199d7e5014dbf9.tar.zst
gsoc2013-evolution-f04e4e06d22dc1ab0dd25501d9199d7e5014dbf9.zip
Fixes #435455 (bnc)
svn path=/trunk/; revision=37375
-rw-r--r--calendar/ChangeLog15
-rw-r--r--calendar/gui/dialogs/comp-editor.c8
-rw-r--r--calendar/gui/dialogs/event-editor.c2
-rw-r--r--calendar/gui/dialogs/event-page.c2
-rw-r--r--calendar/gui/dialogs/memo-page.c2
-rw-r--r--calendar/gui/dialogs/task-page.c2
-rw-r--r--calendar/gui/e-calendar-view.c12
-rw-r--r--calendar/gui/e-calendar-view.h1
-rw-r--r--calendar/gui/e-day-view.c22
-rw-r--r--calendar/gui/itip-utils.c6
-rw-r--r--calendar/gui/itip-utils.h2
11 files changed, 55 insertions, 19 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 5d6e0903bb..b38d2dd1f4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,18 @@
+2009-03-05 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes #435455 (bnc)
+ * calendar/gui/dialogs/comp-editor.c:
+ * calendar/gui/dialogs/event-editor.c:
+ * calendar/gui/dialogs/event-page.c:
+ * calendar/gui/dialogs/memo-page.c:
+ * calendar/gui/dialogs/task-page.c:
+ * calendar/gui/e-calendar-view.c:
+ * calendar/gui/e-calendar-view.h:
+ * calendar/gui/e-day-view.c:
+ * calendar/gui/itip-utils.c:
+ * calendar/gui/itip-utils.h: Do not allow read-only
+ events to be resized.
+
2009-03-04 Milan Crha <mcrha@redhat.com>
** Fix for bug #573119
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 61331e97f7..93ae0c6549 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -774,7 +774,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);
@@ -809,7 +809,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);
@@ -909,7 +909,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, &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 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp)
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);
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index a297765fa6..b95493b7f7 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -616,7 +616,7 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp)
}
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;
}
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 4ea1bbde7b..03447bf3a2 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -962,7 +962,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
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))
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 362a8b0e9a..9277a3c111 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -262,7 +262,7 @@ memo_page_fill_widgets (CompEditorPage *page,
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);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 091a7b50d2..d9078c61b7 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -616,7 +616,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
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))
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 49a23c4120..495b50d0e9 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -368,7 +368,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart
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 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view)
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 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event)
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_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
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 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view,
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 @@ e_calendar_view_modify_and_send (ECalComponent *comp,
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;
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index 63e3c149fd..1f18e67241 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -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; \
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 9060fa2999..91da668000 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3250,6 +3250,13 @@ e_day_view_on_event_click (EDayView *day_view,
!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 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget,
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 @@ e_day_view_update_resize (EDayView *day_view,
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 @@ e_day_view_update_resize (EDayView *day_view,
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_day_view_add_event (ECalComponent *comp,
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]
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 574c7800f1..829ac287ce 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -123,13 +123,13 @@ itip_organizer_is_user (ECalComponent *comp, ECal *client)
}
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 @@ comp_sentby (ECalComponent *comp, ECal *client)
}
}
- 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);
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
index 631c0a3430..9c8ffa1b60 100644
--- a/calendar/gui/itip-utils.h
+++ b/calendar/gui/itip-utils.h
@@ -52,7 +52,7 @@ EAccount *itip_addresses_get_default (void);
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);