diff --git a/src/blackgui/components/flightplancomponent.cpp b/src/blackgui/components/flightplancomponent.cpp index d911d0307..65fec1900 100644 --- a/src/blackgui/components/flightplancomponent.cpp +++ b/src/blackgui/components/flightplancomponent.cpp @@ -126,7 +126,9 @@ namespace BlackGui connect(ui->pb_CopyOver, &QPushButton::pressed, this, &CFlightPlanComponent::copyRemarksConfirmed); connect(ui->pb_GetFromGenerator, &QPushButton::pressed, this, &CFlightPlanComponent::copyRemarksConfirmed); connect(ui->pb_RemarksGenerator, &QPushButton::clicked, this, &CFlightPlanComponent::currentTabGenerator); + connect(ui->tb_HelpEquipment, &QToolButton::clicked, this, &CFlightPlanComponent::showEquipmentCodesTab); + connect(ui->tb_AltitudeDialog, &QToolButton::clicked, this, &CFlightPlanComponent::altitudeDialog); connect(ui->le_AircraftType, &QLineEdit::editingFinished, this, &CFlightPlanComponent::aircraftTypeChanged); connect(ui->le_EquipmentSuffix, &QLineEdit::editingFinished, this, &CFlightPlanComponent::buildPrefixIcaoSuffix); @@ -532,7 +534,7 @@ namespace BlackGui void CFlightPlanComponent::loadFlightPlanFromNetwork() { - if (!sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected()) + if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected()) { CLogMessage(this).warning("Cannot load flight plan, network not connected"); return; @@ -786,6 +788,22 @@ namespace BlackGui CLogMessage::preformatted(saveMsg); } + void CFlightPlanComponent::altitudeDialog() + { + if (!m_altitudeDialog) + { + m_altitudeDialog = new CAltitudeDialog(this); + } + + const QDialog::DialogCode ret = static_cast(m_altitudeDialog->exec()); + if (ret != QDialog::Accepted) { return; } + + if (!m_altitudeDialog->getAltitudeString().isEmpty()) + { + ui->lep_CrusingAltitude->setText(m_altitudeDialog->getAltitudeString()); + } + } + void CFlightPlanComponent::initCompleters() { if (!sGui || !sGui->hasWebDataServices()) { return; } diff --git a/src/blackgui/components/flightplancomponent.h b/src/blackgui/components/flightplancomponent.h index 4561053cf..a4fcf3bf2 100644 --- a/src/blackgui/components/flightplancomponent.h +++ b/src/blackgui/components/flightplancomponent.h @@ -13,6 +13,7 @@ #define BLACKGUI_COMPONENTS_FLIGHTPLANCOMPONENT_H #include "blackgui/overlaymessagesframe.h" +#include "blackgui/components/altitudedialog.h" #include "blackgui/blackguiexport.h" #include "blackmisc/simulation/data/lastmodel.h" #include "blackmisc/simulation/simulatedaircraft.h" @@ -64,6 +65,7 @@ namespace BlackGui private: QScopedPointer ui; + CAltitudeDialog *m_altitudeDialog = nullptr; BlackMisc::Aviation::CFlightPlan m_sentFlightPlan; //!< My flight plan BlackMisc::Simulation::CAircraftModel m_model; //!< currently used model BlackMisc::CIdentifier m_identifier { "FlightPlanComponent", this }; //!< Flightplan identifier @@ -177,6 +179,9 @@ namespace BlackGui //! Update the diretcory settings void updateDirectorySettings(const QString &fileOrDirectory); + + //! Altitude dialog + void altitudeDialog(); }; } // ns } // ns diff --git a/src/blackgui/components/flightplancomponent.ui b/src/blackgui/components/flightplancomponent.ui index 3da39f4a2..4b6edc085 100644 --- a/src/blackgui/components/flightplancomponent.ui +++ b/src/blackgui/components/flightplancomponent.ui @@ -86,7 +86,17 @@ 4 - + + + + 9. Destination airport + + + true + + + + &Reset @@ -97,7 +107,7 @@ - + &Prefill @@ -108,17 +118,7 @@ - - - - 9. Destination airport - - - true - - - - + 12. Fuel on board @@ -128,14 +128,24 @@ - + + + + true + + + sent time will go here (read only) + + + + Sent - + pilot's name @@ -148,66 +158,7 @@ - - - - true - - - sent time will go here (read only) - - - - - - - 99:99 - - - 00:00 - - - 5 - - - hh:mm e.g. 02:30 - - - - - - - 4 - - - ICAO, e.g. EDDF - - - - - - - 4 - - - ICAO, e.g. EDDF - - - - - - - Estimated time enroute - - - 10. Est.time enroute - - - true - - - - + Qt::Vertical @@ -223,7 +174,56 @@ - + + + + 4 + + + ICAO, e.g. EDDF + + + + + + + 99:99 + + + 00:00 + + + 5 + + + hh:mm e.g. 02:30 + + + + + + + 4 + + + ICAO, e.g. EDDF + + + + + + + Estimated time enroute + + + 10. Est.time enroute + + + true + + + + true @@ -233,7 +233,7 @@ - + 13. Alternate airport @@ -243,7 +243,7 @@ - + @@ -253,7 +253,7 @@ - + true @@ -263,6 +263,13 @@ + + + + ICAO, e.g. A321 + + + @@ -273,10 +280,13 @@ - - - - ICAO, e.g. A321 + + + + 6. Departure time + + + true @@ -290,13 +300,13 @@ - - - - 6. Departure time + + + + copy from generator page - - true + + from gen. @@ -310,16 +320,6 @@ - - - - copy from generator page - - - from gen. - - - @@ -333,17 +333,7 @@ - - - - 5. Departure airport - - - true - - - - + @@ -362,6 +352,16 @@ + + + + 5. Departure airport + + + true + + + @@ -393,13 +393,10 @@ - - - - true - - - P/ICAO/S + + + + 1. Type @@ -416,36 +413,13 @@ - - - - 1. Type - - - - - - - - - - 2. Callsign - - - false - - + + + true - - - - - - 4 - - ICAO, e.g. EDDF + P/ICAO/S @@ -465,6 +439,29 @@ + + + + 4 + + + ICAO, e.g. EDDF + + + + + + + 2. Callsign + + + false + + + true + + + @@ -478,6 +475,19 @@ + + + + 99:99 + + + 00:00 + + + hh:mm e.g. 02:30 + + + @@ -526,7 +536,7 @@ - + goto generator page @@ -536,27 +546,7 @@ - - - - 99:99 - - - 00:00 - - - hh:mm e.g. 02:30 - - - - - - - 11. Remarks - - - - + @@ -569,7 +559,14 @@ - + + + + 11. Remarks + + + + Save to disk @@ -583,7 +580,7 @@ - + Load from disk @@ -597,38 +594,13 @@ - + strict &check - - - - &Validate - - - - :/diagona/icons/diagona/icons/abacus.png:/diagona/icons/diagona/icons/abacus.png - - - - - - - Load flight plan from network - - - Load - - - - :/diagona/icons/diagona/icons/network-cloud.png:/diagona/icons/diagona/icons/network-cloud.png - - - @@ -643,7 +615,32 @@ - + + + + Load flight plan from network + + + Load + + + + :/diagona/icons/diagona/icons/network-cloud.png:/diagona/icons/diagona/icons/network-cloud.png + + + + + + + &Validate + + + + :/diagona/icons/diagona/icons/abacus.png:/diagona/icons/diagona/icons/abacus.png + + + + Send flight plan to network @@ -657,6 +654,30 @@ + + + + + + + + + altitude formats + + + altitude formats + + + ... + + + + :/pastel/icons/pastel/16/help.png:/pastel/icons/pastel/16/help.png + + + + + @@ -1150,6 +1171,7 @@ p, li { white-space: pre-wrap; } le_OriginAirport le_TakeOffTimePlanned lep_CrusingAltitude + tb_AltitudeDialog pte_Route le_DestinationAirport le_EstimatedTimeEnroute