Show latest updates after refresh #2552
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.
Problem
After you click Refresh in GUI, the latest updates are downloaded from the repo, but only certain changes are reflected in the mod list:
But if other things change, this isn't shown in the mod list until you restart CKAN:
Cause
ConstructModList
goes out of its way to cause this problem in order to avoid losing user changes. ArefreshAll
parameter is passed based on whether we're doing a repo update, in which case the previousGUIMod
objects are mostly kept. This is kind of odd because a repo update is the only way that most of those properties can be changed.CKAN/GUI/MainModList.cs
Lines 198 to 199 in b9a91fa
CKAN/GUI/MainModList.cs
Line 682 in b9a91fa
CKAN/GUI/MainModList.cs
Lines 692 to 697 in b9a91fa
(The answer to that final question is, "No.")
Changes
Now the
GUIMod
objects built byUpdateModsList
will have.IsInstallChecked
and.IsUpgradeChecked
set to match the change set parameter, and the Refresh button passes the current change set in that parameter. This ensures that the newGUIMod
objects will not lose the change set when refreshing.Then
ConstructModList
just unconditionally generates new rows for everything, since it can trust that their checkbox values are reflected in theGUIMod
objects. TherefreshAll
parameter is removed as it is no longer needed.Together, these changes mean that if you select several mods to install and click Refresh, then those same mods will still be checked afterwards, and all rows will show the latest info, even the ones you checked.
Fixes #1738.