mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +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;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CAircraftIcaoCode::asHtmlSummary() const
|
||||||
|
{
|
||||||
|
return this->getCombinedIcaoStringWithKey();
|
||||||
|
}
|
||||||
|
|
||||||
bool CAircraftIcaoCode::hasDesignator() const
|
bool CAircraftIcaoCode::hasDesignator() const
|
||||||
{
|
{
|
||||||
return !this->m_designator.isEmpty();
|
return !this->m_designator.isEmpty();
|
||||||
|
|||||||
@@ -246,6 +246,9 @@ namespace BlackMisc
|
|||||||
//! Validate data
|
//! Validate data
|
||||||
BlackMisc::CStatusMessageList validate() const;
|
BlackMisc::CStatusMessageList validate() const;
|
||||||
|
|
||||||
|
//! As a brief HTML summary (e.g. used in tooltips)
|
||||||
|
QString asHtmlSummary () const;
|
||||||
|
|
||||||
//! Valid designator?
|
//! Valid designator?
|
||||||
static bool isValidDesignator(const QString &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)
|
CAirlineIcaoCode CAirlineIcaoCode::fromDatabaseJson(const QJsonObject &json, const QString &prefix)
|
||||||
{
|
{
|
||||||
if (!existsKey(json, prefix))
|
if (!existsKey(json, prefix))
|
||||||
|
|||||||
@@ -194,6 +194,9 @@ namespace BlackMisc
|
|||||||
//! Update missing parts
|
//! Update missing parts
|
||||||
void updateMissingParts(const CAirlineIcaoCode &otherIcaoCode);
|
void updateMissingParts(const CAirlineIcaoCode &otherIcaoCode);
|
||||||
|
|
||||||
|
//! As a brief HTML summary (e.g. used in tooltips)
|
||||||
|
QString asHtmlSummary () const;
|
||||||
|
|
||||||
//! Valid designator?
|
//! Valid designator?
|
||||||
static bool isValidAirlineDesignator(const QString &airline);
|
static bool isValidAirlineDesignator(const QString &airline);
|
||||||
|
|
||||||
|
|||||||
@@ -377,5 +377,10 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CLivery::asHtmlSummary() const
|
||||||
|
{
|
||||||
|
return this->getCombinedCodePlusInfo();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -164,6 +164,9 @@ namespace BlackMisc
|
|||||||
//! Update missing parts
|
//! Update missing parts
|
||||||
void updateMissingParts(const CLivery &otherLivery);
|
void updateMissingParts(const CLivery &otherLivery);
|
||||||
|
|
||||||
|
//! As a brief HTML summary (e.g. used in tooltips)
|
||||||
|
QString asHtmlSummary () const;
|
||||||
|
|
||||||
//! Object from JSON
|
//! Object from JSON
|
||||||
static CLivery fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString("liv_"));
|
static CLivery fromDatabaseJson(const QJsonObject &json, const QString &prefix = QString("liv_"));
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ namespace BlackMisc
|
|||||||
return QJsonDocument(this->toDatabaseJson()).toJson(format);
|
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
|
bool CAircraftModel::canInitializeFromFsd() const
|
||||||
{
|
{
|
||||||
const bool nw = this->getModelType() == CAircraftModel::TypeQueriedFromNetwork ||
|
const bool nw = this->getModelType() == CAircraftModel::TypeQueriedFromNetwork ||
|
||||||
|
|||||||
@@ -340,6 +340,9 @@ namespace BlackMisc
|
|||||||
//! To database JSON
|
//! To database JSON
|
||||||
QString toDatabaseJsonString(QJsonDocument::JsonFormat format = QJsonDocument::Compact) const;
|
QString toDatabaseJsonString(QJsonDocument::JsonFormat format = QJsonDocument::Compact) const;
|
||||||
|
|
||||||
|
//! As a brief HTML summary (e.g. used in tooltips)
|
||||||
|
QString asHtmlSummary () const;
|
||||||
|
|
||||||
//! Model type
|
//! Model type
|
||||||
static QString modelTypeToString(ModelType type);
|
static QString modelTypeToString(ModelType type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user