Permalink
Browse files

Display both engine name and version in the Engine column of battlelist.

  • Loading branch information...
specing committed Aug 25, 2018
1 parent c40943b commit 7abd4fa9e1a13bc0e0824fdd504da5538b9f4497
Showing with 12 additions and 6 deletions.
  1. +12 −6 src/gui/battlelist/battledataviewmodel.cpp
@@ -103,10 +103,15 @@ void BattleDataViewModel::GetValue(wxVariant& variant,
battle->GetBattleRunningTime()).Format(_T("%H:%M"))));
break;

case ENGINE:
variant = wxVariant(wxDataViewIconText(wxString(battle->GetEngineVersion()),
SlPaths::GetCompatibleVersion(battle->GetEngineVersion()).empty() ? iconsCollection->ICON_NEXISTS : iconsCollection->ICON_EXISTS));
break;
case ENGINE: {
wxString engine(battle->GetEngineName());
engine += ' ';
engine += battle->GetEngineVersion();
if (SlPaths::GetCompatibleVersion(battle->GetEngineVersion()).empty())
variant = wxVariant(wxDataViewIconText(engine, iconsCollection->ICON_NEXISTS));
else
variant = wxVariant(wxDataViewIconText(engine, iconsCollection->ICON_EXISTS));
} break;

case DEFAULT_COLUMN:
//Do nothing
@@ -193,7 +198,9 @@ int BattleDataViewModel::Compare(const wxDataViewItem& itemA,
break;

case ENGINE:
sortingResult = battleA->GetEngineVersion().compare(battleB->GetEngineVersion());
sortingResult = battleA->GetEngineName().compare(battleB->GetEngineName());
if (0 == sortingResult)
sortingResult = battleA->GetEngineVersion().compare(battleB->GetEngineVersion());
break;

case SPECTATORS:
@@ -265,7 +272,6 @@ wxString BattleDataViewModel::GetColumnType(unsigned int column) const
colTypeString = COL_TYPE_BITMAP;
break;


case MAP:
case GAME:
case ENGINE:

0 comments on commit 7abd4fa

Please sign in to comment.