Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 038e8863b6f9
Choose a base ref
...
head repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 510e77d85179
Choose a head ref
  • 4 commits
  • 3 files changed
  • 2 contributors

Commits on Dec 5, 2018

  1. Show correct error messages after cancelling

    (un)installations/upgrades
    * If user cancels install, now CKAN checks if the process completed nevertheless and accordingly prints the message in log/status bar.
    * Also deactivates Apply Changes button and Retry button in too late cancellations.
    * Also stays on log tab after cancellation
    * KNOWN ISSUE: Retry button not working - not sure if introduced with this commit
    DasSkelett committed Dec 5, 2018
    Copy the full SHA
    ce977b7 View commit details

Commits on Dec 6, 2018

  1. Don't use resolvedAllProvidedMods

    for success tracking, instead a new processSuccessful bool
    DasSkelett committed Dec 6, 2018
    Copy the full SHA
    d5b4790 View commit details

Commits on Dec 14, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    921a0fc View commit details

Commits on Dec 15, 2018

  1. Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    510e77d View commit details
Showing with 66 additions and 16 deletions.
  1. +2 −1 CHANGELOG.md
  2. +40 −14 GUI/MainInstall.cs
  3. +24 −1 GUI/MainWait.cs
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -21,8 +21,9 @@ All notable changes to this project will be documented in this file.
- [GUI] Suppress wrapping of status bar in Mono (#2607 by: HebaruSan; reviewed: politas)
- [GUI] Remove unnecessary parameter in Configuration methods (#2608 by: DasSkelett; reviewed: HebaruSan)
- [GUI] Revert unintentional tray icon change from #2587 (#2609 by: HebaruSan; reviewed: politas)
- [GUI] Show correct error messages after canceling (un)installations/upgrades (#2602 by: DasSkelett; reviewed: HebaruSan)

## v1.25.4
## v1.25.4 Kennedy

### Features

54 changes: 40 additions & 14 deletions GUI/MainInstall.cs
Original file line number Diff line number Diff line change
@@ -147,25 +147,44 @@ private void InstallMods(object sender, DoWorkEventArgs e) // this probably need
installCanceled = true;
};

// checks if all actions were successfull
bool processSuccessful = false;
bool resolvedAllProvidedMods = false;
// uninstall/installs/upgrades until every list is empty
// if the queue is NOT empty, resolvedAllProvidedMods is set to false until the action is done
while (!resolvedAllProvidedMods)
{
try
{
e.Result = new KeyValuePair<bool, ModChanges>(false, opts.Key);
if (!installCanceled && toUninstall.Count > 0)
if (toUninstall.Count > 0)
{
installer.UninstallList(toUninstall);
processSuccessful = false;
if (!installCanceled)
{
installer.UninstallList(toUninstall);
processSuccessful = true;
}
}
if (!installCanceled && toUpgrade.Count > 0)
if (toUpgrade.Count > 0)
{
installer.Upgrade(toUpgrade, downloader);
processSuccessful = false;
if (!installCanceled)
{
installer.Upgrade(toUpgrade, downloader);
processSuccessful = true;
}
}
if (!installCanceled && toInstall.Count > 0)
if (toInstall.Count > 0)
{
installer.InstallList(toInstall, opts.Value, downloader);
processSuccessful = false;
if (!installCanceled)
{
installer.InstallList(toInstall, opts.Value, downloader);
processSuccessful = true;
}
}
e.Result = new KeyValuePair<bool, ModChanges>(!installCanceled, opts.Key);
e.Result = new KeyValuePair<bool, ModChanges>(processSuccessful, opts.Key);
if (installCanceled)
{
return;
@@ -327,7 +346,7 @@ private void PostInstallMods(object sender, RunWorkerCompletedEventArgs e)

tabController.SetTabLock(false);

if (result.Key)
if (result.Key && !installCanceled)
{
// Rebuilds the list of GUIMods
UpdateModsList(false, result.Value);
@@ -347,16 +366,23 @@ private void PostInstallMods(object sender, RunWorkerCompletedEventArgs e)
RetryCurrentActionButton.Visible = false;
UpdateChangesDialog(null, installWorker);
}
else if(installCanceled)
{
// User cancelled the installation
// Rebuilds the list of GUIMods
UpdateModsList(false, result.Value);
UpdateChangesDialog(null, installWorker);
if (result.Key) {
FailWaitDialog("Cancellation to late, process complete!", "User canceled the process manually, but all mods already (un)installed/upgraded.", "Process complete!", result.Key);
} else {
FailWaitDialog("Process canceled by user!", "User canceled the process manually!", "(Un)Install/Upgrade canceled!", result.Key);
}
}
else
{
// There was an error
// Stay on the log dialog and re-apply the user's change set to allow retry
AddStatusMessage("Error!");
SetDescription("An error occurred, check the log for information");
FailWaitDialog("Error during installation!", "An unknown error occurred, please try again!", "Installation failed!", result.Key);
UpdateChangesDialog(result.Value, installWorker);
RetryCurrentActionButton.Visible = true;
Util.Invoke(DialogProgressBar, () => DialogProgressBar.Style = ProgressBarStyle.Continuous);
Util.Invoke(DialogProgressBar, () => DialogProgressBar.Value = 0);
}

Util.Invoke(this, () => Enabled = true);
25 changes: 24 additions & 1 deletion GUI/MainWait.cs
Original file line number Diff line number Diff line change
@@ -61,6 +61,30 @@ public void HideWaitDialog(bool success)
});
}

/// <summary>
/// Stay on log page and reset StatusProgress
/// </summary>
/// <param name="statusMsg">Message for the lower status bar</param>
/// <param name="logMsg">Message to display on WaitDialog-Log (not the real log!)</param>
/// <param name="description">Message displayed above the DialogProgress bar</param>
public void FailWaitDialog(string statusMsg, string logMsg, string description, bool success)
{
Util.Invoke(statusStrip1, () => {
StatusProgress.Visible = false;
AddStatusMessage(statusMsg);
});
Util.Invoke(WaitTabPage, () => {
RecreateDialogs();
RetryCurrentActionButton.Visible = !success;
CancelCurrentActionButton.Enabled = false;
SetProgress(100);
});
tabController.HideTab("ChangesetTabPage");
AddLogMessage(logMsg);
SetDescription(description);
ApplyToolButton.Enabled = !success;
}

public void SetProgress(int progress)
{
if (progress < 0)
@@ -129,7 +153,6 @@ private void CancelCurrentActionButton_Click(object sender, EventArgs e)
{
CancelCurrentActionButton.Enabled = false;
});
HideWaitDialog(true);
}

}