mbdlyb_ui.dialogs
Copyright (c) 2026 TNO-ESI All rights reserved.
Functions
|
Show a confirmation dialog and invoke the selected callback on acceptance. |
|
Confirm deletion of an object before navigating away. |
|
Confirm disconnection of two elements before navigating away. |
Module Contents
- mbdlyb_ui.dialogs.confirm(title: str, message: str, confirm_text: str, on_confirm: Callable | tuple[Callable, tuple[Any]], confirm_color: str = 'primary')
Show a confirmation dialog and invoke the selected callback on acceptance.
- Parameters:
title – Dialog heading.
message – Explanation displayed beneath the heading.
confirm_text – Label of the acceptance button.
on_confirm – Callback or a callback paired with its positional arguments.
confirm_color – Color of the acceptance button.
- mbdlyb_ui.dialogs.confirm_delete(obj, redirect_url: str | mbdlyb.gdb.GMBDElement)
Confirm deletion of an object before navigating away.
- Parameters:
obj – Object with a
deletemethod and optionalon_deletehook.redirect_url – URL or element to visit after deletion.
- mbdlyb_ui.dialogs.confirm_delete_relation(relation: str, start: mbdlyb.gdb.GMBDElement, end: mbdlyb.gdb.GMBDElement, redirect_url: str | mbdlyb.gdb.GMBDElement)
Confirm disconnection of two elements before navigating away.
- Parameters:
relation – Relationship attribute on the starting element.
start – Element owning the relationship.
end – Element to disconnect.
redirect_url – URL or element to visit after disconnection.