diff --git a/CHANGELOG.md b/CHANGELOG.md index 81da7ffd14..5606b11578 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file. - [Multiple] Clean-up and debuggability (#2399 by: HebaruSan; reviewed: politas) - [Netkan] Don't double encode GitHub download URLs (#2402 by: HebaruSan; reviewed: politas) - [Netkan] Option to override SpaceDock version with AVC version (#2406 by: HebaruSan; reviewed: politas) +- [GUI] Move AutoUpdate.CanUpdate check to resolve VisualStudio Designer Error (#2407 by: DasSkellet; reviewed: Olympic1, politas) ### Internal diff --git a/GUI/SettingsDialog.Designer.cs b/GUI/SettingsDialog.Designer.cs index 50fa61e37c..bfca54715f 100644 --- a/GUI/SettingsDialog.Designer.cs +++ b/GUI/SettingsDialog.Designer.cs @@ -43,7 +43,6 @@ private void InitializeComponent() this.ClearCKANCacheButton = new System.Windows.Forms.Button(); this.CKANCacheLabel = new System.Windows.Forms.Label(); this.AutoUpdateGroupBox = new System.Windows.Forms.GroupBox(); - this.HideEpochsCheckbox = new System.Windows.Forms.CheckBox(); this.RefreshOnStartupCheckbox = new System.Windows.Forms.CheckBox(); this.CheckUpdateOnLaunchCheckbox = new System.Windows.Forms.CheckBox(); this.InstallUpdateButton = new System.Windows.Forms.Button(); @@ -52,6 +51,7 @@ private void InitializeComponent() this.LocalVersionLabel = new System.Windows.Forms.Label(); this.LocalVersionLabelLabel = new System.Windows.Forms.Label(); this.CheckForUpdatesButton = new System.Windows.Forms.Button(); + this.HideEpochsCheckbox = new System.Windows.Forms.CheckBox(); this.MoreSettingsGroupBox = new System.Windows.Forms.GroupBox(); this.AutoSortUpdateCheckBox = new System.Windows.Forms.CheckBox(); this.RepositoryGroupBox.SuspendLayout(); @@ -212,17 +212,14 @@ private void InitializeComponent() // AutoUpdateGroupBox // this.AutoUpdateGroupBox.Controls.Add(this.RefreshOnStartupCheckbox); + this.AutoUpdateGroupBox.Controls.Add(this.CheckUpdateOnLaunchCheckbox); + this.AutoUpdateGroupBox.Controls.Add(this.InstallUpdateButton); + this.AutoUpdateGroupBox.Controls.Add(this.LatestVersionLabel); + this.AutoUpdateGroupBox.Controls.Add(this.LatestVersionLabelLabel); + this.AutoUpdateGroupBox.Controls.Add(this.LocalVersionLabel); + this.AutoUpdateGroupBox.Controls.Add(this.LocalVersionLabelLabel); + this.AutoUpdateGroupBox.Controls.Add(this.CheckForUpdatesButton); this.AutoUpdateGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - if (AutoUpdate.CanUpdate) - { - this.AutoUpdateGroupBox.Controls.Add(this.CheckUpdateOnLaunchCheckbox); - this.AutoUpdateGroupBox.Controls.Add(this.InstallUpdateButton); - this.AutoUpdateGroupBox.Controls.Add(this.LatestVersionLabel); - this.AutoUpdateGroupBox.Controls.Add(this.LatestVersionLabelLabel); - this.AutoUpdateGroupBox.Controls.Add(this.LocalVersionLabel); - this.AutoUpdateGroupBox.Controls.Add(this.LocalVersionLabelLabel); - this.AutoUpdateGroupBox.Controls.Add(this.CheckForUpdatesButton); - } this.AutoUpdateGroupBox.Location = new System.Drawing.Point(12, 334); this.AutoUpdateGroupBox.Name = "AutoUpdateGroupBox"; this.AutoUpdateGroupBox.Size = new System.Drawing.Size(476, 105); @@ -230,17 +227,6 @@ private void InitializeComponent() this.AutoUpdateGroupBox.TabStop = false; this.AutoUpdateGroupBox.Text = "Auto-Updates"; // - // HideEpochsCheckbox - // - this.HideEpochsCheckbox.AutoSize = true; - this.HideEpochsCheckbox.Location = new System.Drawing.Point(6, 42); - this.HideEpochsCheckbox.Name = "HideEpochsCheckbox"; - this.HideEpochsCheckbox.Size = new System.Drawing.Size(261, 17); - this.HideEpochsCheckbox.TabIndex = 8; - this.HideEpochsCheckbox.Text = "Hide epoch numbers in mod list (Requires Restart)"; - this.HideEpochsCheckbox.UseVisualStyleBackColor = true; - this.HideEpochsCheckbox.CheckedChanged += new System.EventHandler(this.HideEpochsCheckbox_CheckedChanged); - // // RefreshOnStartupCheckbox // this.RefreshOnStartupCheckbox.AutoSize = true; @@ -322,6 +308,17 @@ private void InitializeComponent() this.CheckForUpdatesButton.UseVisualStyleBackColor = true; this.CheckForUpdatesButton.Click += new System.EventHandler(this.CheckForUpdatesButton_Click); // + // HideEpochsCheckbox + // + this.HideEpochsCheckbox.AutoSize = true; + this.HideEpochsCheckbox.Location = new System.Drawing.Point(6, 42); + this.HideEpochsCheckbox.Name = "HideEpochsCheckbox"; + this.HideEpochsCheckbox.Size = new System.Drawing.Size(261, 17); + this.HideEpochsCheckbox.TabIndex = 8; + this.HideEpochsCheckbox.Text = "Hide epoch numbers in mod list (Requires Restart)"; + this.HideEpochsCheckbox.UseVisualStyleBackColor = true; + this.HideEpochsCheckbox.CheckedChanged += new System.EventHandler(this.HideEpochsCheckbox_CheckedChanged); + // // MoreSettingsGroupBox // this.MoreSettingsGroupBox.Controls.Add(this.HideEpochsCheckbox); diff --git a/GUI/SettingsDialog.cs b/GUI/SettingsDialog.cs index 52e43213ed..248e518941 100644 --- a/GUI/SettingsDialog.cs +++ b/GUI/SettingsDialog.cs @@ -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)