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

More verbose and accurate version displays #2382

Merged
merged 1 commit into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GUI/GUIMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public GUIMod(CkanModule mod, IRegistryQuerier registry, KspVersionCriteria curr
// KSP.
if (latest_available_for_any_ksp != null)
{
KSPCompatibility = KSPCompatibilityLong = latest_available_for_any_ksp.HighestCompatibleKSP();
KSPCompatibility = KSPCompatibilityLong = registry.LatestCompatibleKSP(mod.identifier)?.ToString() ?? "";

// If the mod we have installed is *not* the mod we have installed, or we don't know
// what we have installed, indicate that an upgrade would be needed.
Expand Down
2 changes: 1 addition & 1 deletion GUI/MainAllModVersions.Designer.cs

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

5 changes: 4 additions & 1 deletion GUI/MainAllModVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,13 @@ public GUIMod SelectedModule
bool latestCompatibleVersionAlreadyFound = false;
VersionsListView.Items.AddRange(allAvailableVersions.Select(module =>
{
ModuleVersion minMod = null, maxMod = null;
KspVersion minKsp = null, maxKsp = null;
Registry.GetMinMaxVersions(new List<CkanModule>() {module}, out minMod, out maxMod, out minKsp, out maxKsp);
ListViewItem toRet = new ListViewItem(new string[]
{
module.version.ToString(),
module.HighestCompatibleKSP()
KspVersionRange.VersionSpan(minKsp, maxKsp).ToString()
})
{
Tag = module
Expand Down
17 changes: 12 additions & 5 deletions GUI/MainInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,18 @@ private void UpdateProvidedModsDialog(TooManyModsProvideKraken tooManyProvides,

foreach (CkanModule module in tooManyProvides.modules)
{
ListViewItem item = new ListViewItem {Tag = module, Checked = false, Text = module.name};


ListViewItem.ListViewSubItem description =
new ListViewItem.ListViewSubItem {Text = module.@abstract};
ListViewItem item = new ListViewItem()
{
Tag = module,
Checked = false,
Text = CurrentInstance.Cache.IsMaybeCachedZip(module)
? $"{module.name} {module.version} (cached)"
: $"{module.name} {module.version} ({module.download.Host ?? ""}, {CkanModule.FmtSize(module.download_size)})"
};
ListViewItem.ListViewSubItem description = new ListViewItem.ListViewSubItem()
{
Text = module.@abstract
};

item.SubItems.Add(description);
ChooseProvidedModsListView.Items.Add(item);
Expand Down