Cache migration and other fixes#4240
Conversation
|
I need to test this in Windows before merging. |
|
Hi @gsf600y, there's a |
|
Thanks @HebaruSan ! One question - what's the different to selecting "Revert back to old folder" and hitting the Cancel button? |
|
Cool, thanks for taking a look!
They're the same. I added "Revert back to old folder" because I felt it would not necessarily be clear what the Cancel button did, and this makes it an explicit, visible option. |
|
Ah I see, understood! |
fd48127 to
4052e00
Compare
Background
The core issue was that the settings dialog primarily uses a live-editing paradigm (check a checkbox and the setting is updated instantly), but the cache path needs an edit/cancel/accept paradigm where the user explicitly chooses to validate and commit the input when it's ready and can address any errors or further choices at that time.
Motivation / Initial Problems
Users want a cache migration option.
Some related issues were also reported:
Causes
NetModuleCachewasn't handling mods with multiple download URLs correctly; one failed purge was treated as the mod not being cached at all when one of the other URLs might still be cachedProblems
While working on the above, a few small things came up:
Causes
shortcuts.vdffile itself can be corruptedToolTip.SetToolTipcall was hard-coded inSettingsDialog.Designer.csand so got missed when looking for stringsChanges
-- Defaultstring as{0} (DEFAULT), resizability with a minimum size, auto-sizing to fit, centering on the parent window, auto-selecting the default option, accepting on double-click, accepting on Enter, and cancelling on EscapeNetModuleCache.MoveFromandNetFileCache.MoveFromare updated to support anIProgress<int>object and recursive moving of files in subdirectories (to handle thedownloadingfolder)#region/#endregionto organize its many groups of functionsstringtoFileInfobecause it's better and because we were using thosestrings to makeFileInfos much of the time anywayCacheChangedevent after it replaces the main cache object, whichMainuses to re-subscribe to the mod added/purged eventsNetFileCache.Removehas an overload acccepting a sequence ofUris, which attempts to remove all of them and returns true if any was present, andNetModuleCache.Purgeuses this to purge a modNetModuleCache.Purgehas an overload accepting a sequence ofCkanModules, which attempts to remove all of them and only raises theModPurgedevent onceshortcuts.vdffilesAnchorproperty hasTopremoved andBottomadded, so it'll move up and down as its container resizes, and the container is initialized to the same height as the first search box, which will keep the button alignedGUIUser.RaiseSelectionDialogno longer uses a reference inMain.selectionDialogbecause this makes the dialog crash when the settings dialog tries to use itFixes #4086.