Properly clear AD upgrades from changeset #4037
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.
Problems
Causes
GUIMod.SetUpgradeChecked
is called twice, once to clear the checkbox and once to react to the changing of the checkbox. (I hate this and desperately want to change it, but I don't think I would be able to account for all the complexities well enough to avoid breaking something.) The first call setsGUIMod.SelectedMod
(the property that drives the changeset) to its current value again, which is incorrect, and the second call sets it to null, which is correct. (There are complex interactions with the Versions tab here in order to ensure that switching to the latest version of a mod is always equivalent to upgrading and vice versa.)When such a row is invisible, the second call does not occur because
ManageMods.ModGrid_CellValueChanged
is not called by the grid.RelationshipResolver.reasons
was usingNameComparer
, which makes it match keys only based on identifier and therefore could return the wrong reasons for a module.Changes
GUIMod.SetUpgradeChecked
setsGUIMod.SelectedMod
to null, properly removing the AD upgrade from the changeset.ManageMods.RemoveChangesetItem
unchecks the Upgrade checkbox for an Install action of an AD mod, so you can remove these actions from a changeset.RelationshipResolver.reasons
uses the normal comparer, which uses both identifier and version, so the right reason will be used for each version.ManageMods.freezeChangeSet
mechanism to skip redundant refreshes of the changeset tab is refactored into aWithFrozenChangeset
function, which is now used by the following to improve response times:UpdateChangesDialog
)Fixes #4035.