Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layouts/LayoutMenu : Improve management of custom layouts #2698

Merged
merged 1 commit into from
Jul 31, 2018

Conversation

johnhaddon
Copy link
Member

@johnhaddon johnhaddon commented Jul 24, 2018

This is a stab at implementing the layout improvements requested in #51 - the ability to replace the existing layouts, including the Default one. Have a play with it and see what you think.

I have a couple of queries :

Default layout mechanism

Currently you replace the default layout by saving a layout and naming it "Default" (handled for you by the "Save As/Default" menu item. Would it instead be better to just choose which is the default layout from the current list of layouts via a "Default Layout" submenu with a series of checkboxes? Consider this sequence of operations :

  • User chooses "Scene" layout (one of the defaults shipped with Gaffer)
  • User chooses "Save as Default" (gets saved into user preferences)
  • We update Gaffer, bundling a new "Scene" layout with changes (perhaps a shiny PrimitiveInspector!)
  • User restarts Gaffer, but their default layout doesn't pick up the change because it was frozen at the point of saving

Deleting layouts

You can currently temporarily delete a standard layout as follows :

  • Pick "Save As/<StandardName>" to make a custom layout with the same name
  • Pick "Delete/<StandardName>" to blow it away

It will only become available again on a restart, when the config files are reloaded. Should I instead make it so that deleting the custom version causes us to revert back to the standard one?

I feel like maybe both those things are worth sorting out?

@andrewkaufman
Copy link
Contributor

I'd be in favor of the Default Layout Submenu. That's very handy in some other apps, where I know my default is the shipped "Technical" layout, and it updates whenever we get new versions of the app.

@johnhaddon
Copy link
Member Author

I'd be in favor of the Default Layout Submenu.

OK, cool, I'll sort that out. Should we rename the layout currently called "Default" to "Standard" so we don't have the confusing situation of it not actually being the default one?

@andrewkaufman
Copy link
Contributor

Sure, Standard works

- LayoutMenu :
	- New "Default/..." submenu allows the default layout to be chosen
	- New "Save As/*" options allow previously saved layouts to be replaced
- Layouts :
	- Added `persistent` argument to `add()` method, mirroring the `Bookmarks.add()` API. This automatically takes care of saving persistent layouts into the startup location.
	- Added `setDefault()/getDefault()` and `createDefault()` methods to allow the management of a default layout.

Breaking Changes :

- Layouts :
	- Removed `save()` method. Use the `persistent` argument to `add()` and `setDefault()` instead.
	- Added applicationRoot argument to constructor. You should use `acquire()` instead anyway.
- LayoutMenu :
	- Removed `delete()` method.
- GUI config : Renamed standard layout from "Default" to "Standard".

Fixes GafferHQ#51
@johnhaddon
Copy link
Member Author

OK, pushed those changes. Also removed the menu items to save over the standard layouts (but kept the items to save over existing custom layouts).

@andrewkaufman andrewkaufman merged commit 27b5133 into GafferHQ:master Jul 31, 2018
@johnhaddon johnhaddon deleted the layouts branch August 3, 2018 09:25
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