Skip to content

add: machine-local window layout persistence (#85, part 1) - #172

Merged
Osayi-ANL merged 3 commits into
mainfrom
add/85-p1-window-layout-persistence
Oct 6, 2026
Merged

Osayi-ANL merged 3 commits into
mainfrom
add/85-p1-window-layout-persistence

Conversation

@Osayi-ANL

@Osayi-ANL Osayi-ANL commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

First of eleven parts for #85.

A window reopens at the size, position and dock arrangement it was closed at. State goes to QSettings("DashPVA", <viewer type>) — Qt's per-user store, so nothing lands in the repo, and each viewer gets its own keys.

DOCK_STATE_VERSION guards the dock layout: raise it when a viewer's dock set changes and a stale layout is retired rather than restored into the wrong places.

Restore runs on a deferred singleShot once __init__ has finished. Docks cannot be restored before they exist, and a subclass's hardcoded defaults would otherwise overwrite restored values. Living in BaseWindow means no window can forget to.

HKL3D and Workbench get this by inheritance — neither file is touched. The area-detector viewer sets persist_state = False for now because it still restores its own area_det_* keys; that comes off in part 4 when it migrates onto the shared store.

Inputs and session restore follow as parts 2 and 3.

Test Plan

  • Open HKL3D
  • Move it to a new location on the screen and change the geometry(shrink window or enlarge)
  • Close HKL3D and Open it -- It stays persistent
  • Do the same with the workbench

@Osayi-ANL
Osayi-ANL requested a review from pecomyint September 16, 2026 22:12
@Osayi-ANL
Osayi-ANL force-pushed the add/85-p1-window-layout-persistence branch from 7fd1f42 to b71faa3 Compare September 23, 2026 19:15

@pecomyint pecomyint left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add focused save/restore/version tests, use a per-viewer dock-state version, and remove the 1.1.2 version bump. The BaseWindow consolidation otherwise matches #85 part 1.

…ngs — a window reopens at the size, position and dock arrangement it was closed at, per viewer type, with a dock-state version each viewer raises on its own
@Osayi-ANL
Osayi-ANL force-pushed the add/85-p1-window-layout-persistence branch from b71faa3 to b812bcd Compare September 24, 2026 20:52

@pecomyint pecomyint left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge this before viewer-specific persistence work; #175 and #190 should then be updated against it so closeEvent preserves both layout saving and teardown

@Osayi-ANL
Osayi-ANL merged commit 2404528 into main Oct 6, 2026
3 checks passed
@Osayi-ANL
Osayi-ANL deleted the add/85-p1-window-layout-persistence branch October 9, 2026 19:29
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.

2 participants