Installation message usability improvements #3989
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
<ALL OTHER HOSTS>
, downloads of redistributable mods will succeed but not be stored to the cache, so the installation will failarchive.org
isn't shown in the host list of that window for KSP2, even though there are redistributable mods archived there. This means that this host can't be prioritized above or below<ALL OTHER HOSTS>
, and it's easy to forget it exists.Causes
NetAsyncDownloader.shouldQueue
can return true when it shouldn't, specifically for a download that has just failed and moved on to its next URL, because the same download itself is seen as an active download from the same host, even though it hasn't started yet. When this happens, we put that download in the pending queue instead of starting it, and we will probably never return to it.CkanModule.download
list, but rather in a separateCkanModule.InternetArchiveDownload
property. Without a module, we can't validate or store to the cache.Registry.GetAllHosts
also examines onlyCkanModule.download
and notCkanModule.InternetArchiveDownload
Motivations
GUIUser
's message and progress functions are tightly coupled with code inMainDialogs.cs
(which isn't really about dialogs), and there is ambiguity about which piece of that structure should own a given bit of functionalityChanges
NetAsyncDownloader.shouldQueue
skips the same URL that it's being asked to assess, so it will return false if there are no other active downloads from the same host, as intendedFixes [Bug]: Failed downloads popup doesn't appear when downloads time out #3983.
CkanModule.InternetArchiveDownload
to find the module, so downloads from these URLs will be properly stored to cacheIUser.RaiseMessage
with an empty string to clear the status bar, a newMangageMods.ClearStatusBar
event is raised, in response to whichMain
clears the status barMain.Instance.AddStatusMessage
now raise aManageMods.RaiseMessage
event instead because global variables are badRegistry.GetAllHosts
examinesCkanModule.InternetArchiveDownload
in addition toCkanModule.download
, so archive.org will appear for any game instance containing redistributable mods that have been uploaded to archive.orgIUser
function to make it easier to exclude their spammy output from the log.MainDialogs.cs
and that functionality is now owned exclusively byGUIUser
, which accepts new parameters related to the status bar in order to do its job[ForbidGUICalls]
attribute is added to every member ofGUIUser
to ensure thread safety. I think this wasn't done previously because polymorphism via theIUser
interface inhibited Add test to check GUI thread safety #3914's test from analyzing this code fully. Something to return to.