diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2022-10-14 14:12:20 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2022-10-17 23:37:13 -0300 |
commit | 966411843a33a917835bbcc90c7ef89b017eaafa (patch) | |
tree | f4958a71e28e286a081714c5d771b9fc5ee89cfd | |
parent | df5b9e78216db1b1e4b1ef87414058bcdd744bca (diff) | |
download | gnome-calendar-966411843a33a917835bbcc90c7ef89b017eaafa.tar.gz |
event-editor/dialog: Don't show MOD_ALL if schedule changed
We get into seriously tricky situations if we try and change the
date & time of an event with recurrency, and pass MOD_ALL. That's
because it is ambioguous *where* the change must be applied.
Don't allow selecting MOD_ALL when the scheduling of the recurrent
event changes.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/882
-rw-r--r-- | src/gui/event-editor/gcal-event-editor-dialog.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index bf2f34a3..e2d0eba2 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.c +++ b/src/gui/event-editor/gcal-event-editor-dialog.c @@ -328,6 +328,7 @@ on_done_button_clicked_cb (GtkButton *button, GcalCalendar *selected_calendar; GcalCalendar *calendar; GcalManager *manager; + gboolean schedule_changed; gint i; manager = gcal_context_get_manager (self->context); @@ -336,6 +337,7 @@ on_done_button_clicked_cb (GtkButton *button, if (gcal_calendar_is_read_only (calendar)) GCAL_GOTO (out); + schedule_changed = FALSE; if (!self->event_is_new) { gboolean anything_changed = FALSE; @@ -346,8 +348,16 @@ on_done_button_clicked_cb (GtkButton *button, section_changed = gcal_event_editor_section_changed (self->sections[i]); anything_changed |= section_changed; + + if (self->sections[i] == self->schedule_section) + schedule_changed = section_changed; } + GCAL_TRACE_MSG ("Event %s changed: %d, schedule changed: %d", + gcal_event_get_uid (self->event), + anything_changed, + schedule_changed); + if (!anything_changed) goto out; } @@ -379,7 +389,7 @@ on_done_button_clicked_cb (GtkButton *button, { gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self), self->event, - TRUE, + !schedule_changed, on_ask_recurrence_response_save_cb, self); return; |