mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
refs #212, MS review, https://dev.vatsim-germany.org/issues/212#note-6
This commit is contained in:
@@ -85,8 +85,8 @@ void MainWindow::audioIconContextMenu(const QPoint &position)
|
|||||||
this->m_contextMenuAudio->addAction("Toogle mute");
|
this->m_contextMenuAudio->addAction("Toogle mute");
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
// #if defined required? seems to be redundant
|
// QSysInfo::WindowsVersion only available on Win platforms
|
||||||
if (QSysInfo::WindowsVersion && QSysInfo::WV_NT_based)
|
if (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)
|
||||||
{
|
{
|
||||||
this->m_contextMenuAudio->addAction("Mixer");
|
this->m_contextMenuAudio->addAction("Mixer");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace BlackGui
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Constructor
|
//! \brief Constructor
|
||||||
CUserListModel(UserMode userMode, QObject *parent = nullptr);
|
explicit CUserListModel(UserMode userMode, QObject *parent = nullptr);
|
||||||
|
|
||||||
//! \brief Destructor
|
//! \brief Destructor
|
||||||
virtual ~CUserListModel() {}
|
virtual ~CUserListModel() {}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace BlackGui
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CViewBase(QWidget *parent) : QTableView(parent)
|
CViewBase(QWidget *parent, ModelClass *model = nullptr) : QTableView(parent), m_model(model)
|
||||||
{
|
{
|
||||||
this->setSortingEnabled(true);
|
this->setSortingEnabled(true);
|
||||||
this->horizontalHeader()->setStretchLastSection(true);
|
this->horizontalHeader()->setStretchLastSection(true);
|
||||||
|
|||||||
@@ -163,31 +163,29 @@ namespace BlackMisc
|
|||||||
if (v.contains("FL", Qt::CaseInsensitive))
|
if (v.contains("FL", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
v = v.replace("FL", "", Qt::CaseInsensitive).trimmed();
|
v = v.replace("FL", "", Qt::CaseInsensitive).trimmed();
|
||||||
this->m_datum = FlightLevel;
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
double dv = v.toDouble(&ok) * 100.0;
|
double dv = v.toDouble(&ok) * 100.0;
|
||||||
CLength l(ok ? dv : 0.0,
|
CAltitude a(ok ? dv : 0.0, FlightLevel,
|
||||||
ok ? CLengthUnit::ft() : CLengthUnit::nullUnit());
|
ok ? CLengthUnit::ft() : CLengthUnit::nullUnit());
|
||||||
this->set(l);
|
*this = a;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// normal altitude, AGL/MSL
|
// normal altitude, AGL/MSL
|
||||||
|
ReferenceDatum rd = MeanSeaLevel;
|
||||||
if (v.contains("MSL", Qt::CaseInsensitive))
|
if (v.contains("MSL", Qt::CaseInsensitive))
|
||||||
{
|
{
|
||||||
v = v.replace("MSL", "", Qt::CaseInsensitive).trimmed();
|
v = v.replace("MSL", "", Qt::CaseInsensitive).trimmed();
|
||||||
this->m_datum = MeanSeaLevel;
|
rd = MeanSeaLevel;
|
||||||
}
|
}
|
||||||
else if (v.contains("AGL"))
|
else if (v.contains("AGL"))
|
||||||
{
|
{
|
||||||
v = v.replace("AGL", "", Qt::CaseInsensitive).trimmed();
|
v = v.replace("AGL", "", Qt::CaseInsensitive).trimmed();
|
||||||
this->m_datum = AboveGround;
|
rd = AboveGround;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
this->m_datum = MeanSeaLevel;
|
|
||||||
|
|
||||||
CLength l = BlackMisc::PhysicalQuantities::CPqString::parse<CLength>(v);
|
CLength l = BlackMisc::PhysicalQuantities::CPqString::parse<CLength>(v);
|
||||||
this->set(l);
|
*this = CAltitude(l, rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user