Skip to content
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

Do not destroy plugin dialog on close, just hide it #42

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

goanpeca
Copy link
Contributor

@goanpeca goanpeca commented May 29, 2024

This is handling the plugin dialog from this side, but maybe it would be better to handle it on the napari side, to avoid the creation of a duplicate dialog for some seconds.

I will open a PR on the napari side https://github.com/napari/napari/blob/f3b00c0936caaa87814e8c9b0497f20008d057e1/napari/_qt/_qapp_model/qactions/_plugins.py#L35C20-L35C37

To only create the dialog once. This however serves as POC so you can test how it works!

See how the counter keeps running between open and closing and how it remains on 406 after open and closing once it has finished.

napari-dialog

@goanpeca goanpeca self-assigned this May 29, 2024
@psobolewskiPhD
Copy link
Member

Here's the napari PR:
napari/napari#6944

This feels really nice. Not sure where it's better for it to live.
@Czaki any thoughts?

Copy link
Contributor

@jaimergp jaimergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this one better because getattr() is used in both approaches and that's still hacky. napari could have a public API for public references and that would be a cleaner solution, so for now let's go with this one but let's see if that public API lands sometime in the future.

@goanpeca goanpeca marked this pull request as ready for review June 4, 2024 20:44
@goanpeca goanpeca merged commit 6265b28 into napari:main Jun 5, 2024
10 checks passed
@goanpeca goanpeca deleted the enh/preserve-dialog-and-cache branch June 5, 2024 23:35
@goanpeca goanpeca added the enhancement New feature or request label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants