Skip to content

Commit

Permalink
More verbose and accurate version displays
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Mar 21, 2018
1 parent 5479760 commit 4b510d3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
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

0 comments on commit 4b510d3

Please sign in to comment.