schrodinger.application.bunsen.modal_dialog_handler module¶
Handle modal Qt dialogs shown during a Bunsen tool call.
- class schrodinger.application.bunsen.modal_dialog_handler.ModalDialogHandler(ui_events: list[dict])¶
Bases:
QObjectResolve modal Qt dialogs shown during a Bunsen tool call.
- __init__(ui_events: list[dict]) None¶
Create a handler that records auto-dismissed dialogs.
- Parameters:
ui_events – Mutable response UI-event list to populate.
- Returns:
None.
- suspended() Iterator[None]¶
Temporarily leave modal dialogs open instead of auto-dismissing.
Suspension is nestable so callers can safely compose operations that each need to preserve a modal interaction.
- reportUiEvent(message: str, action: str) None¶
Add an auto-dismissal UI event supplied by cooperating dialog code.
- Parameters:
message – Message displayed by the dismissed dialog.
action – Label of the button selected to dismiss the dialog.
- Returns:
None.
- eventFilter(watched: QObject, event: QEvent) bool¶
Schedule supported modal dialogs to be auto-dismissed when shown.
- Parameters:
watched – Object receiving the event.
event – Event being delivered to the watched object.
- Returns:
Falseso Qt continues normal event processing.
- schrodinger.application.bunsen.modal_dialog_handler.handle_modal_dialogs(ui_events: list[dict]) Iterator[None]¶
Install the modal-dialog filter for one tool-call scope.
- Parameters:
ui_events – Mutable response UI-event list to populate.
- Returns:
A context manager that removes the installed filter on exit.
- schrodinger.application.bunsen.modal_dialog_handler.pause_auto_dismissal() Iterator[None]¶
Pause the active Bunsen modal-dialog handler’s auto-dismissal.