Skip to content

Commit

Permalink
Merge #2382 More verbose and accurate version displays
Browse files Browse the repository at this point in the history
  • Loading branch information
politas committed Mar 22, 2018
2 parents 5479760 + 4b510d3 commit 1835b2d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- [Core] Allow downloader to be used multiple times (#2365 by: HebaruSan; reviewed: politas)
- [GUI] Clean up URL Handler registration (#2366 by: HebaruSan; reviewed: politas)
- [Multiple] Deal with threading and download errors (#2374 by: HebaruSan; reviewed: politas)
- [GUI] More verbose and accurate version displays (#2382 by: HebaruSan; reviewed: politas)

### Internal

Expand Down
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 1835b2d

Please sign in to comment.