mbdlyb_ui.dialogs

Copyright (c) 2026 TNO-ESI All rights reserved.

Functions

confirm(title, message, confirm_text, on_confirm[, ...])

Show a confirmation dialog and invoke the selected callback on acceptance.

confirm_delete(obj, redirect_url)

Confirm deletion of an object before navigating away.

confirm_delete_relation(relation, start, end, redirect_url)

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 delete method and optional on_delete hook.

  • 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.