mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T77, tooltip for models (HTML Summary)
This commit is contained in:
@@ -67,14 +67,22 @@ namespace BlackMisc
|
||||
|
||||
QString CLivery::getCombinedCodePlusInfo() const
|
||||
{
|
||||
QString s(getCombinedCode());
|
||||
QString s = this->getCombinedCode();
|
||||
if (!this->getDescription().isEmpty())
|
||||
{
|
||||
s += QLatin1String(" (") % this->getDescription() % QLatin1String(")");
|
||||
s += " ";
|
||||
s += this->getDescription();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
QString CLivery::getCombinedCodePlusInfoAndId() const
|
||||
{
|
||||
QString s = this->getCombinedCodePlusInfo();
|
||||
s += this->getDbKeyAsStringInParentheses(" ");
|
||||
return s;
|
||||
}
|
||||
|
||||
bool CLivery::isContainedInSimplifiedAirlineName(const QString &candidate) const
|
||||
{
|
||||
return this->getAirlineIcaoCode().isContainedInSimplifiedName(candidate);
|
||||
@@ -383,9 +391,13 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
QString CLivery::asHtmlSummary() const
|
||||
QString CLivery::asHtmlSummary(const QString &separator) const
|
||||
{
|
||||
return this->getCombinedCodePlusInfo();
|
||||
static const QString html = "%1%2Airline: %3";
|
||||
return html.arg(
|
||||
this->getCombinedCodePlusInfoAndId(), separator,
|
||||
this->getAirlineIcaoCode().getDesignator().isEmpty() ? "No airline" : this->getAirlineIcaoCode().getCombinedStringWithKey()
|
||||
).replace(" ", " ");
|
||||
}
|
||||
|
||||
int CLivery::calculateScore(const CLivery &otherLivery, bool preferColorLiveries) const
|
||||
|
||||
@@ -74,9 +74,12 @@ namespace BlackMisc
|
||||
//! Combined code
|
||||
const QString &getCombinedCode() const { return m_combinedCode; }
|
||||
|
||||
//! Combined code
|
||||
//! Combined code plus info
|
||||
QString getCombinedCodePlusInfo() const;
|
||||
|
||||
//! Combined code, info, plus id
|
||||
QString getCombinedCodePlusInfoAndId() const;
|
||||
|
||||
//! Get description.
|
||||
const QString &getDescription() const { return m_description; }
|
||||
|
||||
@@ -171,7 +174,7 @@ namespace BlackMisc
|
||||
void updateMissingParts(const CLivery &otherLivery);
|
||||
|
||||
//! As a brief HTML summary (e.g. used in tooltips)
|
||||
QString asHtmlSummary() const;
|
||||
QString asHtmlSummary(const QString &separator) const;
|
||||
|
||||
//! Score by comparison to another livery 0..100
|
||||
//! \remark normally used with liveries preselect by airline ICAO code
|
||||
|
||||
Reference in New Issue
Block a user