]> git.mxchange.org Git - flightgear.git/commitdiff
Start-paused for in-air starts
authorJames Turner <zakalawe@mac.com>
Tue, 3 Nov 2015 22:05:20 +0000 (16:05 -0600)
committerJames Turner <zakalawe@mac.com>
Mon, 23 Nov 2015 00:47:01 +0000 (00:47 +0000)
src/GUI/LocationWidget.cxx
src/GUI/LocationWidget.ui
src/GUI/QtLauncher.cxx

index ba840c1af75d560ec61a9c3b48a28601ed2b51b4..5be08eb9e6fa6eaf1969bf1108fb4c72d21b0afc 100644 (file)
@@ -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<FGAirport*>(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");
index ff5ce8cf0df70d53aed09ecf6ddd11e3e66ebbd0..00c0ecc845d51bcf401f0abddb82407d5ffa2dbe 100644 (file)
       </layout>
      </widget>
      <widget class="QWidget" name="navaidPage">
-      <layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0,0,0,0">
+      <layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0,0,0">
        <property name="leftMargin">
         <number>0</number>
        </property>
            <height>200</height>
           </size>
          </property>
-         <zorder>offsetGroup</zorder>
         </widget>
        </item>
        <item row="2" column="6" colspan="2">
           <bool>false</bool>
          </property>
          <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <property name="leftMargin">
+           <number>4</number>
+          </property>
+          <property name="topMargin">
+           <number>4</number>
+          </property>
+          <property name="rightMargin">
+           <number>4</number>
+          </property>
+          <property name="bottomMargin">
+           <number>4</number>
+          </property>
           <item>
            <widget class="QLabel" name="offsetBearingLabel">
             <property name="enabled">
index 2c9cd0d84b298e0f9d575e373d120c4642c14adc..1cd689d73252aa08550cc84f007e08890506e2ee 100644 (file)
@@ -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()) {