GUI_Layout_persistence - ISISComputingGroup/ibex_developers_manual GitHub Wiki

Note: the text below applies to the implementation in #3503. This has not been merged as it required restarting the user interface to reload the last saved layout.

# Layout persistence

In the user interface, as of ticket 3503, perspective layouts are saved. The location of the save files is:

C:\Users\<current user>\ibex-gui\perspective_layouts

The format of these files is an E4 XMI application model. It is generated by the Eclipse framework.

# How it works

When the GUI first starts up, it will iterate over each perspective that is defined. For each perspective:
- If a layout file with the correct ID exists in the save file location, it will load the perspective layout from that file
- Otherwise, it will load the default layout from the E4 application model defined in the client.

# Upgrade scripts

Note that at no point are layouts *merged* between the persisted state and the state defined in the client's default application model. This means that, if the application model is changed between client releases, clients with a persisted layout will *not* see any of the new changes.

This means that if perspective layouts are changed or views are added, the persisted state of each client needs to be updated. This could be one of several things, depending on the change:
- If the ID of a view has changed, an upgrade script should update the corresponding IDs in save files
- If a new view has been introduced, an upgrade script could modify the persisted state to introduce the new view into a sensible place.
- If a perspective has been completely changed, the upgrade script should prompt the developer doing the upgrade to save screenshots of the client before upgrading, and then manually re-create and re-save these layouts with the new views in sensible places once the client has been upgraded.