-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gui: Add fix for wxGUI Data import Python error #4504
gui: Add fix for wxGUI Data import Python error #4504
Conversation
This fixes OSGeo#648 by adding a command tracker queue. When the queue is not empty, closing the dialog is prevented to ensure the completion callback can still access UI elements.
Great to see some progress on an older issue! |
@ww2406 thank you for looking into this. I think this makes sense, I will leave just couple notes below. |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thanks for the notes, @petrasovaa! I think I've got everything taken care of. Is there anything else needed from me at all? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you for your contribution!
This fixes #648 by adding a command tracker queue.
Currently, a user can trigger an error if they manually close the dialog box before the commands. This is due to the command completion callbacks depending on state from the UI dialog which is not accessible if the dialog is destroyed.
To address this, I added a command tracking queue to keep track of the number of commands executing. This PR then modifies the close event handler so that If this queue is not empty, the close command is interrupted and does not execute.
One opportunity might be to consolidate the command dispatch mechanism into one function so future maintainers do not need to explicitly invoke the proposed
_addToCommandQueue
function, but I wasn't sure if that was optimizing more than needed at the moment.Look forward to any feedback you might have!