[gnome-calendar/gbsneto/recurring-event-editing-fixes: 20/24] event-editor/dialog: Don't hide dialog on cancelling operation




commit 679a392b71e67cf5769501dcd100dd4042255c24
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Oct 15 19:06:29 2022 -0300

    event-editor/dialog: Don't hide dialog on cancelling operation
    
    If the user clicks the "Cancel" button, it obviously means "cancel",
    so let's cancel.

 src/gui/event-editor/gcal-event-editor-dialog.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c
index 77b01218..3f83e7a1 100644
--- a/src/gui/event-editor/gcal-event-editor-dialog.c
+++ b/src/gui/event-editor/gcal-event-editor-dialog.c
@@ -275,6 +275,9 @@ on_ask_recurrence_response_delete_cb (GcalEvent             *event,
 {
   GcalEventEditorDialog *self = GCAL_EVENT_EDITOR_DIALOG (user_data);
 
+  if (mod_type == GCAL_RECURRENCE_MOD_NONE)
+    return;
+
   g_signal_emit (self, signals[REMOVE_EVENT], 0, event, mod_type);
   clear_and_hide_dialog (self);
 }
@@ -310,14 +313,14 @@ on_ask_recurrence_response_save_cb (GcalEvent             *event,
                                     gpointer               user_data)
 {
   GcalEventEditorDialog *self = GCAL_EVENT_EDITOR_DIALOG (user_data);
+  GcalManager *manager;
 
-  if (mod_type != GCAL_RECURRENCE_MOD_NONE)
-    {
-      GcalManager *manager = gcal_context_get_manager (self->context);
+  if (mod_type == GCAL_RECURRENCE_MOD_NONE)
+    return;
 
-      gcal_manager_update_event (manager, self->event, mod_type);
-    }
+  manager = gcal_context_get_manager (self->context);
 
+  gcal_manager_update_event (manager, self->event, mod_type);
   clear_and_hide_dialog (self);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]