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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user