mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 15:45:42 +08:00
refs #768, allow more detailed tooltips
(makes it sometimes much easier to identify an entity)
This commit is contained in:
@@ -103,6 +103,11 @@ namespace BlackMisc
|
||||
return msg;
|
||||
}
|
||||
|
||||
QString CAircraftIcaoCode::asHtmlSummary() const
|
||||
{
|
||||
return this->getCombinedIcaoStringWithKey();
|
||||
}
|
||||
|
||||
bool CAircraftIcaoCode::hasDesignator() const
|
||||
{
|
||||
return !this->m_designator.isEmpty();
|
||||
|
||||
@@ -246,6 +246,9 @@ namespace BlackMisc
|
||||
//! Validate data
|
||||
BlackMisc::CStatusMessageList validate() const;
|
||||
|
||||
//! As a brief HTML summary (e.g. used in tooltips)
|
||||
QString asHtmlSummary () const;
|
||||
|
||||
//! Valid designator?
|
||||
static bool isValidDesignator(const QString &designator);
|
||||
|
||||
|
||||
@@ -385,6 +385,11 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
QString CAirlineIcaoCode::asHtmlSummary() const
|
||||
{
|
||||
return this->getCombinedStringWithKey();
|
||||
}
|
||||
|
||||
CAirlineIcaoCode CAirlineIcaoCode::fromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||
{
|
||||
if (!existsKey(json, prefix))
|
||||
|
||||
@@ -194,6 +194,9 @@ namespace BlackMisc
|
||||
//! Update missing parts
|
||||
void updateMissingParts(const CAirlineIcaoCode &otherIcaoCode);
|
||||
|
||||
//! As a brief HTML summary (e.g. used in tooltips)
|
||||
QString asHtmlSummary () const;
|
||||
|
||||
//! Valid designator?
|
||||
static bool isValidAirlineDesignator(const QString &airline);
|
||||
|
||||
|
||||
@@ -377,5 +377,10 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
QString CLivery::asHtmlSummary() const
|
||||
{
|
||||
return this->getCombinedCodePlusInfo();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -164,6 +164,9 @@ namespace BlackMisc
|
||||
//! Update missing parts
|
||||
void updateMissingParts(const CLivery &otherLivery);
|
||||
|
||||
//! As a brief HTML summary (e.g. used in tooltips)
|
||||
QString asHtmlSummary () const;
|
||||
|
||||
//! Object from JSON
|
||||
static CLivery fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString("liv_"));
|
||||
|
||||
|
||||
@@ -105,6 +105,12 @@ namespace BlackMisc
|
||||
return QJsonDocument(this->toDatabaseJson()).toJson(format);
|
||||
}
|
||||
|
||||
QString CAircraftModel::asHtmlSummary() const
|
||||
{
|
||||
const QString html = "Model: %1<br>Aircraft ICAO: %2<br>Livery: %3";
|
||||
return html.arg(this->getModelStringAndDbKey(), this->getAircraftIcaoCode().asHtmlSummary(), this->getLivery().asHtmlSummary());
|
||||
}
|
||||
|
||||
bool CAircraftModel::canInitializeFromFsd() const
|
||||
{
|
||||
const bool nw = this->getModelType() == CAircraftModel::TypeQueriedFromNetwork ||
|
||||
|
||||
@@ -340,6 +340,9 @@ namespace BlackMisc
|
||||
//! To database JSON
|
||||
QString toDatabaseJsonString(QJsonDocument::JsonFormat format = QJsonDocument::Compact) const;
|
||||
|
||||
//! As a brief HTML summary (e.g. used in tooltips)
|
||||
QString asHtmlSummary () const;
|
||||
|
||||
//! Model type
|
||||
static QString modelTypeToString(ModelType type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user