mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 08:55:43 +08:00
Ref T578, display level and path (not just path)
This commit is contained in:
committed by
Mat Sutcliffe
parent
6b17f847e9
commit
057031293d
@@ -93,7 +93,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
m_columns.addColumn(CColumn::standardString("ac", "aircraft ICAO", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexAircraftDesignator }));
|
m_columns.addColumn(CColumn::standardString("ac", "aircraft ICAO", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexAircraftDesignator }));
|
||||||
m_columns.addColumn(CColumn::standardString("fam.", "aircraft family", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexFamily }));
|
m_columns.addColumn(CColumn::standardString("fam.", "aircraft family", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexFamily }));
|
||||||
m_columns.addColumn(CColumn::standardString("cat.", "category", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexCategory, CAircraftCategory::IndexPath }));
|
m_columns.addColumn(CColumn::standardString("cat.", "category", { CAircraftModel::IndexAircraftIcaoCode, CAircraftIcaoCode::IndexCategory, CAircraftCategory::IndexLevelStringAndPath }));
|
||||||
m_columns.addColumn(CColumn::standardString("livery", { CAircraftModel::IndexLivery, CLivery::IndexCombinedCode}));
|
m_columns.addColumn(CColumn::standardString("livery", { CAircraftModel::IndexLivery, CLivery::IndexCombinedCode}));
|
||||||
m_columns.addColumn(CColumn::standardString("al", "airline ICAO", { CAircraftModel::IndexLivery, CLivery::IndexAirlineIcaoCode, CAirlineIcaoCode::IndexAirlineDesignator }));
|
m_columns.addColumn(CColumn::standardString("al", "airline ICAO", { CAircraftModel::IndexLivery, CLivery::IndexAirlineIcaoCode, CAirlineIcaoCode::IndexAirlineDesignator }));
|
||||||
m_columns.addColumn(CColumn("CG", CAircraftModel::IndexCG, new CPhysiqalQuantiyFormatter<CLengthUnit, CLength>(CLengthUnit::ft(), 1)));
|
m_columns.addColumn(CColumn("CG", CAircraftModel::IndexCG, new CPhysiqalQuantiyFormatter<CLengthUnit, CLength>(CLengthUnit::ft(), 1)));
|
||||||
|
|||||||
@@ -123,14 +123,22 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString CAircraftCategory::getLevelString() const
|
QString CAircraftCategory::getLevelString() const
|
||||||
{
|
{
|
||||||
|
if (this->isNull()) { return {}; }
|
||||||
return QStringLiteral("%1.%2.%3").arg(m_l1).arg(m_l2).arg(m_l3);
|
return QStringLiteral("%1.%2.%3").arg(m_l1).arg(m_l2).arg(m_l3);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAircraftCategory::getLevelAndName() const
|
QString CAircraftCategory::getLevelAndName() const
|
||||||
{
|
{
|
||||||
|
if (this->isNull()) { return {}; }
|
||||||
return QStringLiteral("%1 %2").arg(this->getLevelString(), this->getName());
|
return QStringLiteral("%1 %2").arg(this->getLevelString(), this->getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CAircraftCategory::getLevelAndPath() const
|
||||||
|
{
|
||||||
|
if (this->isNull()) { return {}; }
|
||||||
|
return QStringLiteral("%1 %2").arg(this->getLevelString(), this->getPath());
|
||||||
|
}
|
||||||
|
|
||||||
bool CAircraftCategory::matchesPath(const QString &path, Qt::CaseSensitivity cs)
|
bool CAircraftCategory::matchesPath(const QString &path, Qt::CaseSensitivity cs)
|
||||||
{
|
{
|
||||||
return stringCompare(path, this->getPath(), cs);
|
return stringCompare(path, this->getPath(), cs);
|
||||||
@@ -165,6 +173,8 @@ namespace BlackMisc
|
|||||||
case IndexAssignable: return CVariant::fromValue(m_assignable);
|
case IndexAssignable: return CVariant::fromValue(m_assignable);
|
||||||
case IndexPath: return CVariant::fromValue(m_path);
|
case IndexPath: return CVariant::fromValue(m_path);
|
||||||
case IndexLevelString: return CVariant::fromValue(this->getLevelString());
|
case IndexLevelString: return CVariant::fromValue(this->getLevelString());
|
||||||
|
case IndexLevelStringAndName: return CVariant::fromValue(this->getLevelAndName());
|
||||||
|
case IndexLevelStringAndPath: return CVariant::fromValue(this->getLevelAndPath());
|
||||||
default: return CValueObject::propertyByIndex(index);
|
default: return CValueObject::propertyByIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,6 +204,8 @@ namespace BlackMisc
|
|||||||
case IndexPath: return m_path.compare(compareValue.getPath(), Qt::CaseInsensitive);
|
case IndexPath: return m_path.compare(compareValue.getPath(), Qt::CaseInsensitive);
|
||||||
case IndexDescription: return m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive);
|
case IndexDescription: return m_description.compare(compareValue.getDescription(), Qt::CaseInsensitive);
|
||||||
case IndexAssignable: return Compare::compare(this->isAssignable(), compareValue.isAssignable());
|
case IndexAssignable: return Compare::compare(this->isAssignable(), compareValue.isAssignable());
|
||||||
|
case IndexLevelStringAndName:
|
||||||
|
case IndexLevelStringAndPath:
|
||||||
case IndexLevelString: return this->compareByLevel(compareValue);
|
case IndexLevelString: return this->compareByLevel(compareValue);
|
||||||
default: return CValueObject::comparePropertyByIndex(index, *this);
|
default: return CValueObject::comparePropertyByIndex(index, *this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ namespace BlackMisc
|
|||||||
IndexName = CPropertyIndex::GlobalIndexCAircraftCategory,
|
IndexName = CPropertyIndex::GlobalIndexCAircraftCategory,
|
||||||
IndexDescription,
|
IndexDescription,
|
||||||
IndexLevelString,
|
IndexLevelString,
|
||||||
|
IndexLevelStringAndName,
|
||||||
|
IndexLevelStringAndPath,
|
||||||
IndexPath,
|
IndexPath,
|
||||||
IndexAssignable
|
IndexAssignable
|
||||||
};
|
};
|
||||||
@@ -108,6 +110,9 @@ namespace BlackMisc
|
|||||||
//! Level and name
|
//! Level and name
|
||||||
QString getLevelAndName() const;
|
QString getLevelAndName() const;
|
||||||
|
|
||||||
|
//! Level and path
|
||||||
|
QString getLevelAndPath() const;
|
||||||
|
|
||||||
//! Matching path?
|
//! Matching path?
|
||||||
bool matchesPath(const QString &path, Qt::CaseSensitivity cs);
|
bool matchesPath(const QString &path, Qt::CaseSensitivity cs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user