Skip to content

Commit

Permalink
Move AutoUpdate.CanUpdate check to InstallUpdateButton_Click
Browse files Browse the repository at this point in the history
Show full `AutoUpdateCheckbox`, even if AutoUpdate isn't avaiable to solve VisualStudio Designer Error.
Instead, check for `AutoUpdate.CanUpdate` on `InstallUpdateButton_Click` and raise error, if false.
  • Loading branch information
DasSkelett committed Apr 3, 2018
1 parent c8d3297 commit c9bf1f8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
41 changes: 19 additions & 22 deletions GUI/SettingsDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions GUI/SettingsDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,16 @@ private void CheckForUpdatesButton_Click(object sender, EventArgs e)

private void InstallUpdateButton_Click(object sender, EventArgs e)
{
Hide();
Main.Instance.UpdateCKAN();
if (AutoUpdate.CanUpdate)
{
Hide();
Main.Instance.UpdateCKAN();
}
else
{
GUI.user.RaiseError("Can't autoupdate. Please check https://github.com/KSP-CKAN/CKAN/ for help!");
}

}

private void CheckUpdateOnLaunchCheckbox_CheckedChanged(object sender, EventArgs e)
Expand Down

0 comments on commit c9bf1f8

Please sign in to comment.