From c2773950109431ed5cbf6bfbd2bcce87329dce5c Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 3 Nov 2015 16:05:20 -0600 Subject: [PATCH] Start-paused for in-air starts --- src/GUI/LocationWidget.cxx | 22 +++++++++++++++------- src/GUI/LocationWidget.ui | 15 +++++++++++++-- src/GUI/QtLauncher.cxx | 8 +++++++- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/GUI/LocationWidget.cxx b/src/GUI/LocationWidget.cxx index ba840c1af..5be08eb9e 100644 --- a/src/GUI/LocationWidget.cxx +++ b/src/GUI/LocationWidget.cxx @@ -299,6 +299,7 @@ LocationWidget::LocationWidget(QWidget *parent) : // force various pieces of UI into sync onOffsetEnabledToggled(m_ui->offsetGroup->isChecked()); + onOffsetBearingTrueChanged(m_ui->trueBearing->isChecked()); onBackToSearch(); } @@ -323,7 +324,17 @@ void LocationWidget::restoreSettings() bool LocationWidget::shouldStartPaused() const { - qWarning() << Q_FUNC_INFO << "implement me"; + if (!m_location) { + return false; // defaults to on-ground at KSFO + } + + if (FGAirport::isAirportType(m_location.ptr())) { + return m_ui->onFinalCheckbox->isChecked(); + } else { + // navaid, start paused + return true; + } + return false; } @@ -468,11 +479,6 @@ void LocationWidget::onLocationChanged() void LocationWidget::onOffsetEnabledToggled(bool on) { m_ui->offsetDistanceLabel->setEnabled(on); -// m_ui->offsetNmSpinbox->setEnabled(on); -// m_ui->offsetBearingSpinbox->setEnabled(on); -// m_ui->trueBearing->setEnabled(on); -// m_ui->offsetBearingLabel->setEnabled(on); -// m_ui->offsetDistanceLabel->setEnabled(on); } void LocationWidget::onAirportDiagramClicked(FGRunwayRef rwy) @@ -496,6 +502,8 @@ QString LocationWidget::locationDescription() const QString ident = QString::fromStdString(m_location->ident()), name = QString::fromStdString(m_location->name()); + name = fixNavaidName(name); + if (locIsAirport) { FGAirport* apt = static_cast(m_location.ptr()); QString locationOnAirport; @@ -532,7 +540,7 @@ QString LocationWidget::locationDescription() const break; } - return QString("at %1 %2 (%3").arg(navaidType).arg(ident).arg(name); + return QString("at %1 %2 (%3)").arg(navaidType).arg(ident).arg(name); } return QString("Implement Me"); diff --git a/src/GUI/LocationWidget.ui b/src/GUI/LocationWidget.ui index ff5ce8cf0..00c0ecc84 100644 --- a/src/GUI/LocationWidget.ui +++ b/src/GUI/LocationWidget.ui @@ -105,7 +105,7 @@ - + 0 @@ -174,7 +174,6 @@ 200 - offsetGroup @@ -218,6 +217,18 @@ false + + 4 + + + 4 + + + 4 + + + 4 + diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 2c9cd0d84..1cd689d73 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -782,7 +782,13 @@ void QtLauncher::onRun() setEnableDisableOptionFromCheckbox(m_ui->fetchRealWxrCheckbox, "real-weather-fetch"); setEnableDisableOptionFromCheckbox(m_ui->rembrandtCheckbox, "rembrandt"); setEnableDisableOptionFromCheckbox(m_ui->fullScreenCheckbox, "fullscreen"); - setEnableDisableOptionFromCheckbox(m_ui->startPausedCheck, "freeze"); +// setEnableDisableOptionFromCheckbox(m_ui->startPausedCheck, "freeze"); + + bool startPaused = m_ui->startPausedCheck->isChecked() || + m_ui->location->shouldStartPaused(); + if (startPaused) { + opt->addOption("enable-freeze", ""); + } // MSAA is more complex if (!m_ui->rembrandtCheckbox->isChecked()) { -- 2.39.5