Commit c8328c6f authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Deleting an event now deselects it. Fixes #90

parent 71d4f013
Pipeline #99399 failed with stage
in 5 minutes and 7 seconds
......@@ -907,20 +907,47 @@ Kirigami.ApplicationWindow {
id: deleteIncidenceSheet
onAddException: {
if(incidenceInfo.incidenceWrapper.incidenceId == deleteIncidenceSheet.incidenceWrapper.incidenceId &&
DateUtils.sameDay(incidenceInfo.incidenceData.startTime, exceptionDate)) {
incidenceInfo.incidenceData = undefined;
root.openOccurrence = undefined;
}
incidenceWrapper.recurrenceExceptionsModel.addExceptionDateTime(exceptionDate);
CalendarManager.editIncidence(incidenceWrapper);
closeDialog();
}
onAddRecurrenceEndDate: {
// If occurrence is past the new recurrence end date, it has ben deleted so kill instance in incidence info
if(incidenceInfo.incidenceWrapper.incidenceId == deleteIncidenceSheet.incidenceWrapper.incidenceId &&
incidenceInfo.incidenceData.startTime >= endDate) {
incidenceInfo.incidenceData = undefined;
root.openOccurrence = undefined;
}
incidenceWrapper.setRecurrenceDataItem("endDateTime", endDate);
CalendarManager.editIncidence(incidenceWrapper);
closeDialog();
}
onDeleteIncidence: {
// Deleting an incidence also means deleting all of its occurrences
if(incidenceInfo.incidenceWrapper.incidenceId == deleteIncidenceSheet.incidenceWrapper.incidenceId) {
incidenceInfo.incidenceData = undefined;
root.openOccurrence = undefined;
}
CalendarManager.deleteIncidence(incidencePtr);
closeDialog();
}
onDeleteIncidenceWithChildren: {
// TODO: Check if parent deleted too
if(incidenceInfo.incidenceWrapper.incidenceId == deleteIncidenceSheet.incidenceWrapper.incidenceId) {
incidenceInfo.incidenceData = undefined;
root.openOccurrence = undefined;
}
CalendarManager.deleteIncidence(incidencePtr, true);
closeDialog();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment