feat(sdk): add status bar widget wrapper and origin query bindings (#356) #364

Merged
forbes merged 1 commits from feat/gears-addon into main 2026-03-01 20:16:47 +00:00
Owner

Summary

Implements issue #356 (status bar provider + origin migration) with revised scope after critical analysis.

register_status_widget() — pure Python

  • Takes a widget directly (not a factory) so addons keep their reference for live updates
  • Sets windowTitle for context menu discoverability (right-click status bar)
  • Supports left (stretches) and right (permanent) positioning
  • Duplicate prevention via objectName check

Origin query bindings — C++ forwarding

  • kcsdk.list_origins()OriginManager::originIds()
  • kcsdk.active_origin() → dict from currentOrigin()
  • kcsdk.set_active_origin(id)setCurrentOrigin()
  • kcsdk.get_origin(id) → dict from getOrigin()
  • Dict keys match ApplicationPy.cpp for behavioral parity
  • Python wrappers in kindred_sdk with kcsdk-first routing

Dropped (by design)

  • IStatusBarProvider C++ interface — pure Python is sufficient; widget created once, Qt owns lifecycle, no repeated C++→Python calls
  • IOriginProvider C++ interface — existing FileOrigin + FileOriginPython + OriginManager stack is already complete; kindred_sdk.register_origin() already wraps it

Files

  • New: statusbar.py
  • Modified: kcsdk_py.cpp, bindings/CMakeLists.txt (+FreeCADGui link), origin.py, __init__.py

Verification

  • Build: libKCSDK.so + kcsdk.so compile and link cleanly
  • Import test: all 4 origin query functions present on kcsdk module
  • Export test: kindred_sdk.__all__ includes all new symbols

Closes #356

## Summary Implements issue #356 (status bar provider + origin migration) with revised scope after critical analysis. ### register_status_widget() — pure Python - Takes a widget directly (not a factory) so addons keep their reference for live updates - Sets `windowTitle` for context menu discoverability (right-click status bar) - Supports `left` (stretches) and `right` (permanent) positioning - Duplicate prevention via `objectName` check ### Origin query bindings — C++ forwarding - `kcsdk.list_origins()` → `OriginManager::originIds()` - `kcsdk.active_origin()` → dict from `currentOrigin()` - `kcsdk.set_active_origin(id)` → `setCurrentOrigin()` - `kcsdk.get_origin(id)` → dict from `getOrigin()` - Dict keys match `ApplicationPy.cpp` for behavioral parity - Python wrappers in `kindred_sdk` with kcsdk-first routing ### Dropped (by design) - **IStatusBarProvider C++ interface** — pure Python is sufficient; widget created once, Qt owns lifecycle, no repeated C++→Python calls - **IOriginProvider C++ interface** — existing `FileOrigin` + `FileOriginPython` + `OriginManager` stack is already complete; `kindred_sdk.register_origin()` already wraps it ### Files - **New:** `statusbar.py` - **Modified:** `kcsdk_py.cpp`, `bindings/CMakeLists.txt` (+FreeCADGui link), `origin.py`, `__init__.py` ### Verification - Build: `libKCSDK.so` + `kcsdk.so` compile and link cleanly - Import test: all 4 origin query functions present on `kcsdk` module - Export test: `kindred_sdk.__all__` includes all new symbols Closes #356
forbes added 1 commit 2026-03-01 20:13:52 +00:00
feat(sdk): add status bar widget wrapper and origin query bindings (#356)
All checks were successful
Build and Test / build (pull_request) Successful in 29m13s
ab8519c272
register_status_widget(): pure Python wrapper that adds a live widget
to the main window status bar with context menu discoverability.

Origin query bindings (kcsdk.list_origins, active_origin, get_origin,
set_active_origin): thin C++ forwarding to OriginManager with Python
wrappers using kcsdk-first routing.

IOriginProvider and IStatusBarProvider C++ interfaces dropped — existing
FileOrigin stack is already complete, and status bar widgets don't need
C++ lifecycle management.
forbes merged commit 9778d0dd1b into main 2026-03-01 20:16:47 +00:00
forbes deleted branch feat/gears-addon 2026-03-01 20:16:49 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#364