From a5b5910f7fd649257c87fba3350f8183601bbcd4 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Wed, 8 Jan 2020 20:49:29 +0000 Subject: [PATCH] For all types of EditPrimary window, consistently call self._do_close() before self.callback(), during save() EditFamily, EditPerson, EditPlace, EditRepository and EditSource already call self._do_close() before self.callback(). --- gramps/gui/editors/editcitation.py | 2 +- gramps/gui/editors/editevent.py | 2 +- gramps/gui/editors/editmedia.py | 2 +- gramps/gui/editors/editnote.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py index fc5c6eba4..b8efb358e 100644 --- a/gramps/gui/editors/editcitation.py +++ b/gramps/gui/editors/editcitation.py @@ -341,9 +341,9 @@ class EditCitation(EditPrimary): self.obj.set_gramps_id(self.db.find_next_citation_gramps_id()) self.db.commit_citation(self.obj, trans) + self._do_close() if self.callback: self.callback(self.obj.get_handle()) - self._do_close() def data_has_changed(self): """ diff --git a/gramps/gui/editors/editevent.py b/gramps/gui/editors/editevent.py index ccda9ef48..af56791ab 100644 --- a/gramps/gui/editors/editevent.py +++ b/gramps/gui/editors/editevent.py @@ -278,9 +278,9 @@ class EditEvent(EditPrimary): self.obj.set_gramps_id(self.db.find_next_event_gramps_id()) self.db.commit_event(self.obj, trans) + self._do_close() if self.callback: self.callback(self.obj) - self._do_close() def data_has_changed(self): """ diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index 392811a64..d90dbf471 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -334,9 +334,9 @@ class EditMedia(EditPrimary): self.obj.set_gramps_id(self.db.find_next_media_gramps_id()) self.db.commit_media(self.obj, trans) + self._do_close() if self.callback: self.callback(self.obj) - self._do_close() def data_has_changed(self): """ diff --git a/gramps/gui/editors/editnote.py b/gramps/gui/editors/editnote.py index a3e5daefb..cf819d66b 100644 --- a/gramps/gui/editors/editnote.py +++ b/gramps/gui/editors/editnote.py @@ -346,9 +346,9 @@ class EditNote(EditPrimary): self.obj.set_gramps_id(self.db.find_next_note_gramps_id()) self.db.commit_note(self.obj, trans) + self._do_close() if self.callback: self.callback(self.obj.get_handle()) - self._do_close() class DeleteNoteQuery: def __init__(self, dbstate, uistate, note, the_lists):