Order of close and callback in Editor Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Order of close and callback in Editor Windows

Steve Youngs
Hi,
Looking at the various editors save() functions, some call
self._do_close() before the self.callback() [EditFamily, EditPerson]:

   self._do_close()
   if self.callback:
     self.callback(self.obj)

whilst others have the calls the other way around [EditEvent]:

   if self.callback:
     self.callback(self.obj)
   self._do_close()

Is this deliberate or should I make a PR to make them consistent?

Steve


_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: Order of close and callback in Editor Windows

prculley
The callback is generally used to update the GUI or db data on the object being edited, if the object was actually changed.  As we don't generally care about whether the Editor GUI has closed, or just getting ready to close, it makes no difference what order these are in.

If you do feel a need to generate a PR, please give a good example for a justification on the change.  That will improve the odds of the PR being accepted.

Paul C.

On Sat, Jan 4, 2020 at 4:07 PM Steve Youngs <[hidden email]> wrote:
Hi,
Looking at the various editors save() functions, some call
self._do_close() before the self.callback() [EditFamily, EditPerson]:

   self._do_close()
   if self.callback:
     self.callback(self.obj)

whilst others have the calls the other way around [EditEvent]:

   if self.callback:
     self.callback(self.obj)
   self._do_close()

Is this deliberate or should I make a PR to make them consistent?

Steve


_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel


_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel