Skip to content

feat: Import - Export Layouts - #356

Open
jhery-rdo wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
jhery-rdo:feat/layout-io
Open

jhery-rdo wants to merge 1 commit into
AcademySoftwareFoundation:developfrom
jhery-rdo:feat/layout-io

Conversation

@jhery-rdo

Copy link
Copy Markdown
Contributor

Linked issues

None. This is a self-contained new plugin.

Summarize your change.

Adds a layout_io Python plugin with File > Import > Layouts ... and File > Export > Layouts .... It saves the layouts shown in the layout bar to a .json file and loads them back, so a layout can be shared between users or machines.

Describe the reason for the change.

Layouts can be created, renamed and re-ordered, but there is no way to move one to another machine or share it with a colleague.

Describe what you have tested and on which operating system.

Loaded as a Python plugin into xSTUDIO 1.4.0 on Linux (Rocky 8) and exercised export and import through the File menu. Not tested on Windows or macOS.

Add a list of changes, and note any that might need special attention during the review.

  • New plugin src/plugin/python_plugins/layout_io/ and one add_python_plugin(layout_io) line. There is no C++ and no new dependency.
  • QML reads and writes the layouts through a second XsPanelsLayoutModel. The messages that change that model are not bound to Python, so QML has to do it. Python does the file IO and validation.
  • On import, layouts are appended, never replaced. A clashing name gets a numeric suffix, panels that are not registered here are flagged in the dialog, and an xSTUDIO version mismatch is flagged without blocking.
  • File paths are decoded in Python, so spaces and Windows drive letters are handled.
  • Docs: a "Sharing Layouts" section in layouts.rst, CHANGELOG.md and the release notes.
  • Review focus: the menu positions (3.2 in Import, 6.0 in Export) are chosen so they do not tie with existing items.

If possible, provide screenshots.

None attached yet.

Adds File > Import > Layouts... and File > Export > Layouts... so the
layouts shown in the layout bar can be saved to a .json file and loaded
again in another session.

The QML dialog talks to the layouts model. Python handles the file IO
and validation. Imported layouts are appended to the existing list, and
a name that clashes with an existing layout gets a numeric suffix. Panels
that are not registered in this session are flagged rather than dropped.

Docs, changelog and release notes are updated to match.

Signed-off-by: Julien Hery <julien.hery@yahoo.fr>
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