Skip to content

Commit

Permalink
Uncheck checkbox after missing dependency error
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 25, 2018
1 parent 9e71f86 commit 1827fba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions GUI/GUIMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
7 changes: 0 additions & 7 deletions GUI/MainModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,13 +591,6 @@ public async Task<IEnumerable<ModChange>> 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)
Expand Down

0 comments on commit 1827fba

Please sign in to comment.