1
0
Fork 0

Title label for location airport/nav pages.

This commit is contained in:
James Turner 2017-04-15 13:39:44 +01:00
parent 4259b548b0
commit f2d5f18da6
2 changed files with 100 additions and 72 deletions

View file

@ -869,6 +869,10 @@ void LocationWidget::onLocationChanged()
} // of have parkings } // of have parkings
} // of was able to create dynamics } // of was able to create dynamics
const QString airportName = QString::fromStdString(apt->name());
const QString icao = QString::fromStdString(apt->ident());
m_ui->titleLabel->setText(tr("%1 (%2)").arg(airportName).arg(icao));
} else if (m_locationIsLatLon) { } else if (m_locationIsLatLon) {
m_ui->stack->setCurrentIndex(1); m_ui->stack->setCurrentIndex(1);
m_ui->navaidDiagram->setGeod(m_geodLocation); m_ui->navaidDiagram->setGeod(m_geodLocation);
@ -876,6 +880,10 @@ void LocationWidget::onLocationChanged()
// navaid // navaid
m_ui->stack->setCurrentIndex(1); m_ui->stack->setCurrentIndex(1);
m_ui->navaidDiagram->setNavaid(m_location); m_ui->navaidDiagram->setNavaid(m_location);
const QString name = QString::fromStdString(m_location->name());
const QString ident = QString::fromStdString(m_location->ident());
m_ui->navTitleLabel->setText(tr("%1 (%2)").arg(name).arg(ident));
} }
} }

View file

@ -26,7 +26,7 @@
<item> <item>
<widget class="QStackedWidget" name="stack"> <widget class="QStackedWidget" name="stack">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="airportPage"> <widget class="QWidget" name="airportPage">
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0"> <layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0,0">
@ -42,31 +42,34 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="4" column="0"> <item row="5" column="2">
<widget class="QSpinBox" name="approachDistanceSpin">
<property name="suffix">
<string>nm</string>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QRadioButton" name="parkingRadio"> <widget class="QRadioButton" name="parkingRadio">
<property name="text"> <property name="text">
<string>Parking:</string> <string>Parking:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="4" column="0">
<widget class="QRadioButton" name="runwayRadio"> <widget class="QRadioButton" name="runwayRadio">
<property name="text"> <property name="text">
<string>Runway:</string> <string>Runway:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="6" column="1" colspan="3">
<widget class="QCheckBox" name="onFinalCheckbox">
<property name="text">
<string>On final approach at distance:</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="3">
<widget class="QComboBox" name="parkingCombo"/> <widget class="QComboBox" name="parkingCombo"/>
</item> </item>
<item row="3" column="3"> <item row="5" column="3">
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -79,10 +82,27 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="1" colspan="3"> <item row="4" column="1" colspan="3">
<widget class="QComboBox" name="runwayCombo"/> <widget class="QComboBox" name="runwayCombo"/>
</item> </item>
<item row="1" column="0" colspan="4"> <item row="5" column="1">
<widget class="QCheckBox" name="onFinalCheckbox">
<property name="text">
<string>On final approach at distance:</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="4">
<widget class="AirportDiagram" name="airportDiagram" native="true"> <widget class="AirportDiagram" name="airportDiagram" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
@ -92,20 +112,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2">
<widget class="QSpinBox" name="approachDistanceSpin">
<property name="suffix">
<string>nm</string>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="navaidPage"> <widget class="QWidget" name="navaidPage">
<layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0,0,0" columnstretch="1,0,0,1,0,1,0,0,0,0"> <layout class="QGridLayout" name="gridLayout_3" rowstretch="0,1,0,0,0,0" columnstretch="1,0,0,1,0,1,0,0,0,0">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -118,20 +128,7 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="2" column="1" colspan="2"> <item row="4" column="6" colspan="2">
<widget class="QSpinBox" name="airspeedSpinbox">
<property name="suffix">
<string>kts</string>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>120</number>
</property>
</widget>
</item>
<item row="2" column="6" colspan="2">
<widget class="QSpinBox" name="altitudeSpinbox"> <widget class="QSpinBox" name="altitudeSpinbox">
<property name="suffix"> <property name="suffix">
<string>ft</string> <string>ft</string>
@ -150,33 +147,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="5"> <item row="4" column="8" colspan="2">
<widget class="QLabel" name="altitudeLabel">
<property name="text">
<string>Altitude:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2" colspan="10">
<widget class="NavaidDiagram" name="navaidDiagram" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
</item>
<item row="2" column="8" colspan="2">
<widget class="QComboBox" name="altitudeModeCombo"> <widget class="QComboBox" name="altitudeModeCombo">
<item> <item>
<property name="text"> <property name="text">
@ -195,17 +166,17 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="4" column="5">
<widget class="QLabel" name="aispeedLabel"> <widget class="QLabel" name="altitudeLabel">
<property name="text"> <property name="text">
<string>Airspeed:</string> <string>Altitude:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="10"> <item row="5" column="0" colspan="10">
<widget class="QGroupBox" name="offsetGroup"> <widget class="QGroupBox" name="offsetGroup">
<property name="title"> <property name="title">
<string>Offset</string> <string>Offset</string>
@ -288,7 +259,17 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="4" column="0">
<widget class="QLabel" name="aispeedLabel">
<property name="text">
<string>Airspeed:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Heading:</string> <string>Heading:</string>
@ -298,7 +279,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="4"> <item row="4" column="4">
<widget class="QSpinBox" name="headingSpinbox"> <widget class="QSpinBox" name="headingSpinbox">
<property name="wrapping"> <property name="wrapping">
<bool>true</bool> <bool>true</bool>
@ -308,6 +289,45 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1" colspan="2">
<widget class="QSpinBox" name="airspeedSpinbox">
<property name="suffix">
<string>kts</string>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>120</number>
</property>
</widget>
</item>
<item row="0" column="0" colspan="10">
<widget class="QLabel" name="navTitleLabel">
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="10">
<widget class="NavaidDiagram" name="navaidDiagram" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="searchPage"> <widget class="QWidget" name="searchPage">