-
Notifications
You must be signed in to change notification settings - Fork 203
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
Adds the ability to lock layers and sublayers at once #3646
Adds the ability to lock layers and sublayers at once #3646
Conversation
… all affected layers. - Also added previous lock state information to LockLayer command.
- RefreshSystemLockLayer now handles changing multiple layer permissions with a single Undo command. - LockLayer is now capable of locking sub layers of a given layer. New parameter added to include sublayers. - Fixed Layer Lock undo when Undoing from Unlocked -> Locked - Updated the command documentation
- Updated the lockLayer command with the ability to lock sublayers. - Added hasSubLayers LayerEditorWindow command. - Added a context menu item for the layer editor to Locking a layer and its sublayers - Updated the layerLocking test sample to include a sublayer. - Added a test unit to check lock status of sublayers.
@@ -901,24 +930,42 @@ class RefreshSystemLockLayer : public BaseCmd | |||
_refreshLayerSystemLock(layer); | |||
} | |||
|
|||
// Execute lock commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do and undo stop at the first error and execute in the same order. For composite commands, the usual way to handle it is to record which were done so undo only undoes those that were actually successful. Also, undo usually execute in reverse order as do. Might be worthwhile to either execute as much as possible (execute all, return if any failed) or to undo on error.
For locking, these things are less critical, I don't think there will be anything bad so you can keep the simpler code that you currently have, but it is something to keep in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point!
In this implementation, the layer hierarchy is flattened and since locking only affects the local variables of each layer, the lock / unlock doesn't have to be in an order. I'll keep the error checking in mind going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds the ability to lock layers and sublayers at once
Note: This PR has file change overlaps with #3643