Skip to content

Commit

Permalink
Merge #4303 Guard rail for clicking refresh with refresh already in p…
Browse files Browse the repository at this point in the history
…rogress
  • Loading branch information
HebaruSan committed Feb 7, 2025
2 parents 8ec3b2c + 3ea9665 commit 793869e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ All notable changes to this project will be documented in this file.
- [Core] Fix cloning instances with shared stock files on Windows (#4297 by: HebaruSan)
- [Core] Handle paths without DriveInfo (#4300 by: HebaruSan)
- [GUI] Make versions tab non-interactive inside install flow (#4302 by: HebaruSan)
- [GUI] Guard rail for clicking refresh with refresh already in progress (#4303 by: HebaruSan)

### Internal

Expand Down
15 changes: 9 additions & 6 deletions GUI/Controls/Wait.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ public void StartWaiting(Action<object?, DoWorkEventArgs?> mainWork,
bool cancelable,
object? param)
{
bgLogic = mainWork;
postLogic = postWork;
Reset(cancelable);
ClearLog();
RetryEnabled = false;
bgWorker.RunWorkerAsync(param);
if (!Busy)
{
bgLogic = mainWork;
postLogic = postWork;
Reset(cancelable);
ClearLog();
RetryEnabled = false;
bgWorker.RunWorkerAsync(param);
}
}

public event Action? OnRetry;
Expand Down
6 changes: 3 additions & 3 deletions GUI/Main/MainRepo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ private void PostUpdateRepo(object? sender, RunWorkerCompletedEventArgs? e)
break;
}
}
else if (e?.Result is(RepositoryDataManager.UpdateResult updateResult,
Dictionary<string, bool> oldModules,
bool refreshWithoutChanges))
else if (e?.Result is (RepositoryDataManager.UpdateResult updateResult,
Dictionary<string, bool> oldModules,
bool refreshWithoutChanges))
{
switch (updateResult)
{
Expand Down
8 changes: 5 additions & 3 deletions GUI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,14 @@ If you suspect a bug in the client: https://github.com/KSP-CKAN/CKAN/issues/new/
<data name="MainRepoAutoRefreshPrompt" xml:space="preserve"><value>Would you like CKAN to refresh the mod list automatically every time it is loaded?

You can refresh the mod list manually with the Refresh button at the top, and you can change this setting later in the Settings. If you disable automatic refreshes, it's a good idea to refresh every few days.</value></data>
<data name="MainRepoBalloonTipDetails" xml:space="preserve"><value>{0} update(s) available</value></data>
<data name="MainRepoBalloonTipTooltip" xml:space="preserve"><value>Click to upgrade</value></data>
<data name="MainRepoBalloonTipDetails" xml:space="preserve"><value>Updates available: {0}

Click to install...</value></data>
<data name="MainRepoBalloonTipTooltip" xml:space="preserve"><value>Click to install updates</value></data>
<data name="MainTrayIconResume" xml:space="preserve"><value>Resume</value></data>
<data name="MainTrayIconPause" xml:space="preserve"><value>Pause</value></data>
<data name="MainTrayNoUpdates" xml:space="preserve"><value>No available updates</value></data>
<data name="MainTrayUpdatesAvailable" xml:space="preserve"><value>{0} available update(s)</value></data>
<data name="MainTrayUpdatesAvailable" xml:space="preserve"><value>Updates available: {0}</value></data>
<data name="MainWaitPleaseWait" xml:space="preserve"><value>Please wait</value></data>
<data name="MainWaitDone" xml:space="preserve"><value>All done!</value></data>
<data name="ManageGameInstancesNotValid" xml:space="preserve"><value>Directory {0} is not a valid game directory.</value></data>
Expand Down

0 comments on commit 793869e

Please sign in to comment.