Skip to content

Fix "save" on generate #4619#4623

Merged
LocalIdentity merged 2 commits intoPathOfBuildingCommunity:devfrom
talkmill:fix_save_on_generate
Aug 14, 2022
Merged

Fix "save" on generate #4619#4623
LocalIdentity merged 2 commits intoPathOfBuildingCommunity:devfrom
talkmill:fix_save_on_generate

Conversation

@talkmill
Copy link
Contributor

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.modFlag

This also solved the issue with the save-button having strange behaviour for notes as described in #2271.

@LocalIdentity LocalIdentity merged commit 6c7e19f into PathOfBuildingCommunity:dev Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generating a pob link "saves" the pob file when in fact, it doesn't

3 participants