Elaborate more on the use case and requirements for dialog registration

This commit is contained in:
Glutanimate 2020-03-07 17:43:21 +01:00
parent 1ed2ba8983
commit 05f69272d0

View file

@ -130,7 +130,18 @@ class DialogManager:
self, name: str, creator: Union[Callable, type], instance: Optional[Any] = None
):
"""Allows add-ons to register a custom dialog to be managed by Anki's dialog
manager
manager, which ensures that only one copy of the window is open at once,
and that the dialog cleans up asynchronously when the collection closes
Please note that dialogs added in this manner need to define a close behavior
by either:
- setting `dialog.silentlyClose = True` to have it close immediately
- define a `dialog.closeWithCallback()` method that is called when closed
by the dialog manager
TODO?: Implement more restrictive type check to ensure these requirements
are met
Arguments:
name {str} -- Name/identifier of the dialog in question