mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #535, updated aircraft model / view
* add functions to apply changes to selected objects * allow to highlight models by their model strings * Utility function to show which parts come from DB * model strings can be obtained sorted/unsorted
This commit is contained in:
@@ -92,6 +92,8 @@ namespace BlackMisc
|
||||
return m_livery.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexCallsign:
|
||||
return m_callsign.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexPartsDbStatus:
|
||||
return getPartsDbStatus();
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
@@ -179,6 +181,8 @@ namespace BlackMisc
|
||||
return Compare::compare(this->m_modelType, compareValue.getModelType());
|
||||
case IndexModelMode:
|
||||
return Compare::compare(this->m_modelMode, compareValue.getModelMode());
|
||||
case IndexPartsDbStatus:
|
||||
return getPartsDbStatus().compare(compareValue.getPartsDbStatus());
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -255,6 +259,16 @@ namespace BlackMisc
|
||||
return m_simulator.isAnySimulator();
|
||||
}
|
||||
|
||||
QString CAircraftModel::getPartsDbStatus() const
|
||||
{
|
||||
QString s(hasValidDbKey() ? "M" : "m");
|
||||
s = s.append(getDistributor().hasValidDbKey() ? 'D' : 'd');
|
||||
s = s.append(getAircraftIcaoCode().hasValidDbKey() ? 'A' : 'a');
|
||||
s = s.append(getLivery().hasValidDbKey() ? 'L' : 'l');
|
||||
s = s.append(getLivery().getAirlineIcaoCode().hasValidDbKey() ? 'A' : 'a');
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CAircraftModel::matchesModelString(const QString &modelString, Qt::CaseSensitivity sensitivity) const
|
||||
{
|
||||
if (sensitivity == Qt::CaseSensitive)
|
||||
|
||||
Reference in New Issue
Block a user