From 1827fbad5ae9238e6d30d271412aab7f5fd91e87 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Wed, 25 Apr 2018 00:50:16 +0000 Subject: [PATCH] Uncheck checkbox after missing dependency error --- GUI/GUIMod.cs | 4 ++++ GUI/Main.cs | 11 +++++++++++ GUI/MainModList.cs | 7 ------- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/GUI/GUIMod.cs b/GUI/GUIMod.cs index af7ce663c5..e03bcce954 100644 --- a/GUI/GUIMod.cs +++ b/GUI/GUIMod.cs @@ -251,6 +251,10 @@ public void SetInstallChecked(DataGridViewRow row, bool? set_value_to = null) if ((bool)install_cell.Value != IsInstallChecked) { install_cell.Value = IsInstallChecked; + // These calls are needed to force the UI to update, + // otherwise the checkbox will look checked when it's unchecked or vice versa + row.DataGridView.RefreshEdit(); + row.DataGridView.Refresh(); } } } diff --git a/GUI/Main.cs b/GUI/Main.cs index 9a1b657016..b2858176bf 100644 --- a/GUI/Main.cs +++ b/GUI/Main.cs @@ -606,6 +606,17 @@ private async Task UpdateChangeSetAndConflicts(IRegistryQuerier registry) // We can just rerun it as the ModInfoTabControl has been removed. too_many_provides_thrown = true; } + catch (DependencyNotSatisfiedKraken k) + { + GUI.user.RaiseError( + "{0} depends on {1}, which is not compatible with the currently installed version of KSP", + k.parent, + k.module + ); + + // Uncheck the box + MarkModForInstall(k.parent.identifier, true); + } if (too_many_provides_thrown) { diff --git a/GUI/MainModList.cs b/GUI/MainModList.cs index 07b3a6467e..22a8e21d41 100644 --- a/GUI/MainModList.cs +++ b/GUI/MainModList.cs @@ -591,13 +591,6 @@ public async Task> ComputeChangeSetFromModList( { kraken = k; } - catch (ModuleNotFoundKraken k) - { - //We shouldn't need this. However the relationship provider will throw TMPs with incompatible mods. - user.RaiseError("Module {0} has not been found. This may be because it is not compatible " + - "with the currently installed version of KSP", k.module); - return null; - } //Shouldn't get here unless there is a kraken. var mod = await too_many_provides(kraken); if (mod != null)