-
-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 file migration option.
Some related issues were also reported:
Causes
NetModuleCache
wasn'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.vdf
file itself can be corruptedToolTip.SetToolTip
call was hard-coded inSettingsDialog.Designer.cs
and so got missed when looking for stringsChanges
-- Default
string 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.MoveFrom
andNetFileCache.MoveFrom
are updated to support anIProgress<int>
object and recursive moving of files in subdirectories (to handle thedownloading
folder)#region
/#endregion
to organize its many groups of functionsstring
toFileInfo
because it's better and because we were using thosestring
s to makeFileInfo
s much of the time anywayCacheChanged
event after it replaces the main cache object, whichMain
uses to re-subscribe to the mod added/purged eventsNetFileCache.Remove
has an overload acccepting a sequence ofUri
s, which attempts to remove all of them and returns true if any was present, andNetModuleCache.Purge
uses this to purge a modNetModuleCache.Purge
has an overload accepting a sequence ofCkanModules
, which attempts to remove all of them and only raises theModPurged
event onceshortcuts.vdf
filesAnchor
property hasTop
removed andBottom
added, 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.RaiseSelectionDialog
no longer uses a reference inMain.selectionDialog
because this makes the dialog crash when the settings dialog tries to use itFixes #4086.