Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncheck checkbox after missing dependency error #2425

Merged
merged 1 commit into from
Apr 25, 2018

Conversation

HebaruSan
Copy link
Member

Background

It's possible for a mod with an incompatible dependency to be presented as compatible in GUI, as long as this dependency is more than one step away (i.e., a dependency of a dependency). For example, in KSP 1.4.2 currently, AJE Extended depends on AJE, which depends on FAR, which isn't compatible. So FAR and AJE are properly marked as incompatible, but AJE Extended is treated as compatible. This is covered by #2231 and not fixed here.

Problem

After you check such an incompatible checkbox, you'll get the error popup about it every time you click any other checkbox, until you uncheck the incompatible one.

Cause

The only action we took in response to this condition was to raise an error message. This may partly be because we were catching ModuleNotFoundKraken, which doesn't indicate the depending module.

Changes

Now we catch DependencyNotSatisfiedKraken (which inherits from ModuleNotFoundKraken and is the actual type of the exception already being thrown) and use its parent property to find the mod with the incompatible dependency, and uncheck it with MarkModForInstall. This unchecks the problematic module, so further selections may be made without seeing the same error message over and over.

Note that this only covers missing dependencies, and not any other sort of conflict. Unlike a mod-to-mod conflict, a mod with a missing dependency can never be installed, so there is no value in keeping it selected because there is no other way to solve the problem other than deselecting it.

Simply setting the Value property of the right cell resulted in a glitchy UI; the checkbox still appeared to be checked until the user took another action on the grid, such as clicking anywhere within it, at which time the checkbox's true unchecked state was drawn. We now call RefreshEdit and Refresh on the grid after setting a cell value to work around this.

Fixes #2419.

@HebaruSan HebaruSan added GUI Issues affecting the interactive GUI Pull request labels Apr 25, 2018
@politas politas merged commit 1827fba into KSP-CKAN:master Apr 25, 2018
@HebaruSan HebaruSan deleted the fix/uncheck-missing-dep branch April 25, 2018 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CKAN GUI throws "module not found"-error again and again
2 participants