Fix "save" on generate #4619#4623
Merged
LocalIdentity merged 2 commits intoPathOfBuildingCommunity:devfrom Aug 14, 2022
Merged
Conversation
2 tasks
LocalIdentity
approved these changes
Aug 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4619 and #2271
The Generate button in "Import/Export Build" ran buildMode:SaveDB, which runsdifferent Saver functions to generate the build XML . However it did not run the function that saves the file.
The problem is that the modFlags that are used to see if the build is unsaved is reset already in the Save functions. This causes the save button to be disabled, looking like the build is saved, but not really saving.
I created a new function to do the reset-logic and moved that to when buildMode:SaveDBFile is run (since that is when the file is actually saved).
I defined all the modFlags separately to reset in the reset function (i was initially thinking about creating a reset-function in each "saver"-class and iterating over them, however it does not cover all the cases and the actual check against the modFlags are hardcoded in the statement verifying them i.e:
self.unsaved = self.modFlag or self.notesTab.modFlag or self.configTab.modFlag or self.treeTab.modFlag or self.spec.modFlag or self.skillsTab.modFlag or self.itemsTab.modFlag or self.calcsTab.modFlagThis also solved the issue with the save-button having strange behaviour for notes as described in #2271.