mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
Minor tweaks:
* Altitude formatter for GUI * borders for CDockWidget * homebase for ATC
This commit is contained in:
committed by
Mathew Sutcliffe
parent
3c15f2ad89
commit
6570a0c966
@@ -33,10 +33,14 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
QString s = this->CLength::valueRoundedWithUnit(4, i18n);
|
||||
if (this->getUnit() != CLengthUnit::ft())
|
||||
QString s;
|
||||
if (this->getUnit() == CLengthUnit::m())
|
||||
{
|
||||
s.append(" (").append(this->valueRoundedWithUnit(CLengthUnit::ft(), 4, i18n)).append(")");
|
||||
s = this->CLength::valueRoundedWithUnit(1, i18n);
|
||||
}
|
||||
else
|
||||
{
|
||||
s = this->CLength::valueRoundedWithUnit(CLengthUnit::ft(), 0, i18n);
|
||||
}
|
||||
return s.append(this->isMeanSeaLevel() ? " MSL" : " AGL");
|
||||
}
|
||||
|
||||
@@ -25,12 +25,14 @@ namespace BlackMisc
|
||||
CUser::CUser(const QString &id, const QString &realname, const CCallsign &callsign)
|
||||
: m_id(id.trimmed()), m_realname(realname), m_callsign(callsign)
|
||||
{
|
||||
this->setRealName(realname); // extracts homebase
|
||||
this->deriveHomeBaseFromCallsign();
|
||||
this->setRealName(realname); // extracts homebase if this is included in real name
|
||||
}
|
||||
|
||||
CUser::CUser(const QString &id, const QString &realname, const QString &email, const QString &password, const CCallsign &callsign)
|
||||
: m_id(id.trimmed()), m_realname(realname), m_email(email), m_password(password), m_callsign(callsign)
|
||||
{
|
||||
this->deriveHomeBaseFromCallsign();
|
||||
this->setRealName(realname); // extracts homebase
|
||||
}
|
||||
|
||||
@@ -50,9 +52,20 @@ namespace BlackMisc
|
||||
return s;
|
||||
}
|
||||
|
||||
void CUser::deriveHomeBaseFromCallsign()
|
||||
{
|
||||
if (this->m_callsign.isEmpty()) { return; }
|
||||
if (this->m_homebase.isEmpty())
|
||||
{
|
||||
if (this->m_callsign.isAtcCallsign())
|
||||
{
|
||||
this->m_homebase = this->m_callsign.getIcaoCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CUser::setRealName(const QString &realname)
|
||||
{
|
||||
|
||||
QString rn(realname.trimmed().simplified());
|
||||
if (rn.isEmpty())
|
||||
{
|
||||
|
||||
@@ -142,6 +142,9 @@ namespace BlackMisc
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CUser)
|
||||
|
||||
//! derive homebase from callsign
|
||||
void deriveHomeBaseFromCallsign();
|
||||
|
||||
QString m_id;
|
||||
QString m_realname;
|
||||
QString m_email;
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace BlackMisc
|
||||
CLength(const QString &unitString) : CPhysicalQuantity(unitString) {}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::PhysicalQuantities::CLength)
|
||||
|
||||
|
||||
@@ -69,11 +69,9 @@ namespace BlackMisc
|
||||
//! Unit
|
||||
MU getUnit() const;
|
||||
|
||||
/*!
|
||||
* \brief Simply set unit, do no calclulate conversion
|
||||
* \sa switchUnit
|
||||
*/
|
||||
void setUnit(const MU &unit);
|
||||
//! Simply set unit, do no calclulate conversion
|
||||
//! \sa switchUnit
|
||||
void setUnit(const MU &unit) { this->m_unit = unit; }
|
||||
|
||||
//! Set unit by string
|
||||
void setUnitBySymbol(const QString &unitName);
|
||||
|
||||
Reference in New Issue
Block a user