Skip to content

feat: add ToolboxSession with non-modal dialog support#44

Merged
pabloinigoblasco merged 4 commits into
developmentfrom
feat/toolbox-session
Apr 14, 2026
Merged

feat: add ToolboxSession with non-modal dialog support#44
pabloinigoblasco merged 4 commits into
developmentfrom
feat/toolbox-session

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Collaborator

@pabloinigoblasco pabloinigoblasco commented Apr 10, 2026

Summary

  • Introduces ToolboxSession — a QObject that encapsulates the full lifecycle of a toolbox plugin instance inside pj_proto_app
  • Binds the toolbox host, runtime host, and config; exposes runDialog() for the app layer
  • runDialog() reads kToolboxCapabilityNonModalDialog from the plugin capability flags and passes DialogEngineConfig::non_modal = true automatically — no per-plugin branching in app code
  • dataChanged() signal emitted when the plugin calls notify_data_changed, enabling reactive UI updates

Test plan

  • Build pj_proto_app — no compile errors
  • Load the Quaternion toolbox: dialog opens non-modally (main window stays interactive, drag-and-drop from series tree works)
  • A toolbox without kToolboxCapabilityNonModalDialog still opens a modal dialog (unchanged behaviour)
  • Config round-trip: save config → reload → dialog state restored

🤖 Generated with Claude Code

Introduces ToolboxSession, which encapsulates the lifecycle of a single
toolbox plugin instance inside pj_proto_app.

Contents:
- toolbox_session.hpp / toolbox_session.cpp: new ToolboxSession QObject that
  binds toolbox host, runtime host and config, and exposes runDialog()
- runDialog() reads kToolboxCapabilityNonModalDialog from the plugin's capability
  flags and sets DialogEngineConfig::non_modal accordingly, so plugins that
  declared non-modal capability get a non-blocking dialog automatically
- Runtime host vtable wired via captureless static lambdas; dataChanged() signal
  emitted when the plugin calls notify_data_changed
ToolboxSession::runDialog calls library_.resolveDialogVtable() but
the method was missing from ToolboxLibrary, causing a compile error.
DataSourceLibrary and MessageParserLibrary already had this method
with the same dlsym/GetProcAddress pattern — add the same to
ToolboxLibrary for consistency.
…solveDialogVtable to ToolboxLibrary

ToolboxSession::runDialog calls library_.resolveDialogVtable() but
the method was missing from ToolboxLibrary, causing a compile error.

Rather than copy-pasting the same dlsym/GetProcAddress block a third
time, extract a generic detail::resolveSymbol(handle, name) helper
into library_loader.hpp and refactor all three library classes
(DataSourceLibrary, MessageParserLibrary, ToolboxLibrary) to use it.

This removes ~90 lines of duplicated platform-specific code while
adding resolveDialogVtable to ToolboxLibrary.
toolbox_library.hpp includes pj_plugins/dialog_protocol.h for
resolveDialogVtable, but pj_toolbox_host was missing the
pj_dialog_protocol dependency so the include path was not set up.
@pabloinigoblasco pabloinigoblasco merged commit fa0b5d8 into development Apr 14, 2026
2 checks passed
pabloinigoblasco added a commit that referenced this pull request Apr 14, 2026
toolbox_session.cpp was added by PR #44 but not listed in the
CMakeLists.txt sources, causing undefined reference errors at link time.
pabloinigoblasco added a commit that referenced this pull request Apr 14, 2026
…#55)

* feat(proto-app): add Tools menu with dynamic toolbox plugin discovery

Add a Tools menu to MainWindow that dynamically discovers and lists
all loaded Toolbox plugins. Each plugin appears as a menu action that
opens its dialog via ToolboxSession::runDialog(). After the dialog
closes, the chart and series tree are refreshed.

This is the minimum wiring needed to open toolbox plugins (FFT,
Quaternion, ColorMap, etc.) from the application UI.

* fix(build): add toolbox_session.cpp to pj_proto_app sources

toolbox_session.cpp was added by PR #44 but not listed in the
CMakeLists.txt sources, causing undefined reference errors at link time.
@pabloinigoblasco pabloinigoblasco deleted the feat/toolbox-session branch May 4, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant