aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/e-cal-view.c28
-rw-r--r--calendar/gui/e-calendar-view.c28
3 files changed, 53 insertions, 12 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 5908cd9249..2601312fb9 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-15 Rodrigo Moya <rodrigo@ximian.com>
+
+ Fixes #35577
+
+ * gui/e-cal-view.c (e_calendar_view_delete_selected_occurrence):
+ if the component is an instance, pass the recurrence ID to
+ e_cal_remove_object_with_mod. Also, make the user confirm the
+ deletion, and send the cancellation message for meetings.
+
2004-03-12 Not Zed <NotZed@Ximian.com>
* gui/e-cal-model.c (ecm_initialize_value): return "" instead of
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
index b02b51e6ff..bb33b9bfc4 100644
--- a/calendar/gui/e-cal-view.c
+++ b/calendar/gui/e-cal-view.c
@@ -944,8 +944,9 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
{
ECalendarViewEvent *event;
GList *selected;
- const char *uid;
+ const char *uid, *rid;
GError *error = NULL;
+ ECalComponent *comp;
selected = e_calendar_view_get_selected_events (cal_view);
if (!selected)
@@ -953,15 +954,30 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
event = (ECalendarViewEvent *) selected->data;
- uid = icalcomponent_get_uid (event->comp_data->icalcomp);
- /* FIXME: use 'rid' argument */
- e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, &error);
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ e_cal_component_get_uid (comp, &uid);
+ if (e_cal_component_is_instance (comp))
+ rid = e_cal_component_get_recur_id_as_string (comp);
+ else
+ rid = "";
+
+ if (delete_component_dialog (comp, FALSE, 1, e_cal_component_get_vtype (comp), GTK_WIDGET (cal_view))) {
+
+ if (itip_organizer_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, event->comp_data->client, NULL);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
+ e_cal_remove_object_with_mod (event->comp_data->client, uid, rid, CALOBJ_MOD_THIS, &error);
+ delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
+ g_clear_error (&error);
+ }
/* free memory */
g_list_free (selected);
+ g_object_unref (comp);
}
static void
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index b02b51e6ff..bb33b9bfc4 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -944,8 +944,9 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
{
ECalendarViewEvent *event;
GList *selected;
- const char *uid;
+ const char *uid, *rid;
GError *error = NULL;
+ ECalComponent *comp;
selected = e_calendar_view_get_selected_events (cal_view);
if (!selected)
@@ -953,15 +954,30 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view)
event = (ECalendarViewEvent *) selected->data;
- uid = icalcomponent_get_uid (event->comp_data->icalcomp);
- /* FIXME: use 'rid' argument */
- e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, &error);
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ e_cal_component_get_uid (comp, &uid);
+ if (e_cal_component_is_instance (comp))
+ rid = e_cal_component_get_recur_id_as_string (comp);
+ else
+ rid = "";
+
+ if (delete_component_dialog (comp, FALSE, 1, e_cal_component_get_vtype (comp), GTK_WIDGET (cal_view))) {
+
+ if (itip_organizer_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, event->comp_data->client, NULL);
- delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
- g_clear_error (&error);
+ e_cal_remove_object_with_mod (event->comp_data->client, uid, rid, CALOBJ_MOD_THIS, &error);
+ delete_error_dialog (error, E_CAL_COMPONENT_EVENT);
+ g_clear_error (&error);
+ }
/* free memory */
g_list_free (selected);
+ g_object_unref (comp);
}
static void