Command check file save before open #7061
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-10495
1 - This PR adds another command to the
DynamoViewModel-OpenIfSavedcommand which wraps aDynamoModelOpenFileCommandwith a check for unsaved changes on the home workspace. If there are unsaved changes the message box requesting a save is popped up.2 - This task also requested exploring a property exposing the modal state of the Dynamo UI - I.E, are there any windows open that would disallow interactions with the
DynamoModel.the best I have found is the static class
ComponentDispatcher.EnterThreadModalevent which would allow us to set a bool flag somewhere on the view or view model. Unfortunately message boxes(without owners) do not fire this event so a scan over all message box and other popup / window code would need to be done and consequences of this would need to be tested.I would guess this handler would be set at view model or view construction time. Looking for thoughts and feedback on this, note this PR does not include this handler.
For now, I will leave this property as a followup task if deemed necessary
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@ramramps
@sharadkjaiswal
FYIs
@kronz @BogdanZavu