napari / napari-plugin-manager

napari plugin manager to provide a graphical user interface for installing napari plugins.
https://napari.org/napari-plugin-manager
BSD 3-Clause "New" or "Revised" License
5 stars 5 forks source link

Check on napari, if the plugin manager is busy and provide a dialog on close #53

Open goanpeca opened 3 months ago

goanpeca commented 3 months ago

Avoid closing napari if the plugin manager is busy

ref: https://github.com/napari/napari/blob/eab7661459e70479c7c7d587a36463f3b099b64a/napari/_qt/qt_main_window.py#L442

jaimergp commented 3 months ago

Short-term I guess we would need to poll napari directly. Long-term I envision an API in napari where plugins can register their long-running tasks (with a predefined expiry date, so maybe it's a matter of "keeping them alive" as needed) and would also unregister them once done. Then napari would check that list when needed (e.g. upon closing), and could even be exposed somewhere in the UI for more information.

jaimergp commented 3 months ago

The status payload would look something like this:

{
  "status": "some-value-from-enum",
  "description": "additional details for a tooltip or whatever",
  "timestamp": "ISO-something for the moment the payload was sent (or received; delegated to napari?)",
  "id": "some sort of unique identifier to retrieve this later and remove it"
}