Ref T225, some coordinate form improvements and renamings

This commit is contained in:
Klaus Basan
2018-01-18 14:40:29 +01:00
parent 8e2a1b1b6f
commit fc84bf6579
4 changed files with 30 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ namespace BlackGui
ui->lblp_LatCheck->setToolTips("ok", "wrong format");
ui->lblp_LngCheck->setToolTips("ok", "wrong format");
ui->lblp_AltCheck->setToolTips("ok", "wrong format");
ui->lblp_ElvCheck->setToolTips("ok", "wrong format");
ui->le_LatDeg->setValidator(new QIntValidator(-90, 90, ui->le_LatDeg));
ui->le_LatMin->setValidator(new QIntValidator(0, 60, ui->le_LatMin));
@@ -61,7 +61,7 @@ namespace BlackGui
connect(ui->le_LngSecFrag, &QLineEdit::editingFinished, this, &CCoordinateForm::lngCombinedEntered);
connect(ui->le_Location, &QLineEdit::returnPressed, this, &CCoordinateForm::locationEntered);
connect(ui->pb_Set, &QPushButton::pressed, this, &CCoordinateForm::changeCoordinate);
connect(ui->pb_Set, &QPushButton::pressed, this, &CCoordinateForm::changedCoordinate);
const CCoordinateGeodetic c;
this->setCoordinate(c);
@@ -129,8 +129,13 @@ namespace BlackGui
ui->le_LngMin->setReadOnly(readonly);
ui->le_LngSec->setReadOnly(readonly);
ui->le_LngSecFrag->setReadOnly(readonly);
ui->le_Location->setReadOnly(readonly);
ui->le_Longitude->setReadOnly(readonly);
ui->le_Location->setReadOnly(readonly);
ui->le_Location->setVisible(!readonly); // does not make sense to show it in ro, no reverse lookup
ui->lbl_Location->setVisible(!readonly);
CGuiUtility::forceStyleSheetUpdate(this);
}
void CCoordinateForm::setSelectOnly()
@@ -150,6 +155,14 @@ namespace BlackGui
ui->pb_Set->setVisible(visible);
}
void CCoordinateForm::showElevation(bool show)
{
ui->le_Elevation->setVisible(show);
ui->lbl_Elevation->setVisible(show);
ui->lblp_ElvCheck->setVisible(show);
m_coordinate.setGeodeticHeightToNull();
}
void CCoordinateForm::locationEntered()
{
const QString l = ui->le_Location->text().trimmed().toUpper();
@@ -248,7 +261,7 @@ namespace BlackGui
const QString e = ui->le_Elevation->text();
CAltitude a;
a.parseFromString(e);
ui->lblp_AltCheck->setTicked(!e.isNull());
ui->lblp_ElvCheck->setTicked(!e.isNull());
CCoordinateGeodetic c = m_coordinate;
c.setGeodeticHeight(a);
this->setCoordinate(c);

View File

@@ -54,9 +54,12 @@ namespace BlackGui
//! Set button visible
void showSetButton(bool visible);
//! Show elevation
void showElevation(bool show);
signals:
//! Change coordinate
void changeCoordinate();
void changedCoordinate();
private:
QScopedPointer<Ui::CCoordinateForm> ui;

View File

@@ -22,7 +22,7 @@
</widget>
</item>
<item row="3" column="2">
<widget class="BlackGui::CTickLabel" name="lblp_AltCheck">
<widget class="BlackGui::CTickLabel" name="lblp_ElvCheck">
<property name="minimumSize">
<size>
<width>20</width>
@@ -82,7 +82,11 @@
</widget>
</item>
<item row="3" column="5" colspan="4">
<widget class="QLineEdit" name="le_Location"/>
<widget class="QLineEdit" name="le_Location">
<property name="placeholderText">
<string>ICAO, city</string>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QLineEdit" name="le_LngSec">
@@ -139,7 +143,7 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lbl_Altitude">
<widget class="QLabel" name="lbl_Elevation">
<property name="text">
<string>Elevation:</string>
</property>
@@ -275,7 +279,7 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="bg_EW"/>
<buttongroup name="bg_NS"/>
<buttongroup name="bg_EW"/>
</buttongroups>
</ui>

View File

@@ -45,7 +45,7 @@ namespace BlackGui
connect(ui->tb_ResetPressure, &QToolButton::clicked, this, &CSituationForm::resetPressure);
connect(ui->pb_Set, &QPushButton::clicked, this, &CSituationForm::changeAircraftSituation);
connect(ui->pb_SetEnvironment, &QPushButton::clicked, this, &CSituationForm::changeAircraftSituation);
connect(ui->comp_Coordinate, &CCoordinateForm::changeCoordinate, this, &CSituationForm::changeAircraftSituation);
connect(ui->comp_Coordinate, &CCoordinateForm::changedCoordinate, this, &CSituationForm::changeAircraftSituation);
}
CSituationForm::~CSituationForm()