mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Elaborate more on the use case and requirements for dialog registration
This commit is contained in:
parent
1ed2ba8983
commit
05f69272d0
1 changed files with 12 additions and 1 deletions
|
@ -130,7 +130,18 @@ class DialogManager:
|
||||||
self, name: str, creator: Union[Callable, type], instance: Optional[Any] = None
|
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
|
"""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:
|
Arguments:
|
||||||
name {str} -- Name/identifier of the dialog in question
|
name {str} -- Name/identifier of the dialog in question
|
||||||
|
|
Loading…
Reference in a new issue