From 5e15a674255ad881ee977536aaf923700bb45364 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 17 Jul 2026 21:12:55 +0800 Subject: [PATCH] fix: deprecate show_dialog api and add an option to create_window params --- .../orca_inspector_plugin_example_any.py | 35 ++++--- src/slic3r/GUI/PluginWebDialog.cpp | 76 ++++++++------ src/slic3r/GUI/PluginWebDialog.hpp | 28 +++--- src/slic3r/plugin/host/PluginHostUi.cpp | 99 +++++++++++-------- src/slic3r/plugin/host/PluginHostUi.hpp | 4 +- tests/slic3rutils/test_plugin_host_api.cpp | 6 +- 6 files changed, 142 insertions(+), 106 deletions(-) diff --git a/sandboxes/orca_inspector_plugin_example_any.py b/sandboxes/orca_inspector_plugin_example_any.py index d5fc78bd8a..deada9eab8 100644 --- a/sandboxes/orca_inspector_plugin_example_any.py +++ b/sandboxes/orca_inspector_plugin_example_any.py @@ -18,7 +18,7 @@ usable) with a sidebar of sections, each exercising one part of the API: Config the complete merged full_config as a searchable table Model Model -> Object -> Volume/Instance tree with lazy mesh geometry Assembly objects grouped by module_name, per-instance assemble transforms - UI Toolkit live demos of message/show_dialog/create_window/ProgressDialog + UI Toolkit live demos of message/create_window/ProgressDialog The page and the plugin talk JSON through the injected `window.orca` bridge: @@ -1006,8 +1006,8 @@ function renderUikit() { '' + '
' + '
' + - '

Modal HTML dialog · ui.show_dialog()

' + - '

Blocks until closed; returns the orca.submit() payload.

' + + '

Modal HTML dialog · ui.create_window()

' + + '

Uses WINDOW_MODAL; messages and the final orca.submit() payload are callbacks.

' + '
' + '

Progress dialog · ui.ProgressDialog

' + '

Determinate update() loop (cancellable) and start_pulse()/stop_pulse().

' + @@ -1107,13 +1107,13 @@ show('overview'); """ -# The modal page demoed from the UI Toolkit tab: orca.submit(payload) resolves the -# blocking show_dialog() call with that payload; orca.close() resolves it with None. +# The modal page demoed from the UI Toolkit tab: create_window(style=WINDOW_MODAL) +# keeps the handle alive for callbacks; orca.submit(payload) invokes on_submit. MODAL_PAGE = r"""

Modal dialog

-

show_dialog() blocks the plugin until this closes, then returns the submitted payload.

+

create_window(style=WINDOW_MODAL) keeps this page interactive until it submits or closes.