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 *selected_calendar;
|
||||||
GcalCalendar *calendar;
|
GcalCalendar *calendar;
|
||||||
GcalManager *manager;
|
GcalManager *manager;
|
||||||
|
gboolean schedule_changed;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
manager = gcal_context_get_manager (self->context);
|
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))
|
if (gcal_calendar_is_read_only (calendar))
|
||||||
GCAL_GOTO (out);
|
GCAL_GOTO (out);
|
||||||
|
|
||||||
|
schedule_changed = FALSE;
|
||||||
if (!self->event_is_new)
|
if (!self->event_is_new)
|
||||||
{
|
{
|
||||||
gboolean anything_changed = FALSE;
|
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]);
|
section_changed = gcal_event_editor_section_changed (self->sections[i]);
|
||||||
anything_changed |= section_changed;
|
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)
|
if (!anything_changed)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -379,7 +389,7 @@ on_done_button_clicked_cb (GtkButton *button,
|
|||||||
{
|
{
|
||||||
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
|
gcal_utils_ask_recurrence_modification_type (GTK_WIDGET (self),
|
||||||
self->event,
|
self->event,
|
||||||
TRUE,
|
!schedule_changed,
|
||||||
on_ask_recurrence_response_save_cb,
|
on_ask_recurrence_response_save_cb,
|
||||||
self);
|
self);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user