diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-03-15 19:29:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-03-15 19:29:30 +0800 |
commit | 3662d9bca108622527746d8e9ce1117d584cab00 (patch) | |
tree | 5d8a3618a08eef55753ded4536022db2c35e35a0 /calendar/gui/e-calendar-view.c | |
parent | 8f1fd2e906395b1b0143b906015d2d14d84de311 (diff) | |
download | gsoc2013-evolution-3662d9bca108622527746d8e9ce1117d584cab00.tar.gz gsoc2013-evolution-3662d9bca108622527746d8e9ce1117d584cab00.tar.zst gsoc2013-evolution-3662d9bca108622527746d8e9ce1117d584cab00.zip |
Fixes #35577
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.
svn path=/trunk/; revision=25066
Diffstat (limited to 'calendar/gui/e-calendar-view.c')
-rw-r--r-- | calendar/gui/e-calendar-view.c | 28 |
1 files changed, 22 insertions, 6 deletions
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 |