From 4e7144db089d60265b1f805a0afe1c6caf2b32ae Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 12 Jan 2017 18:12:01 +0100 Subject: [PATCH] refs #859, flight plan UI formatting and value update --- .../components/flightplancomponent.cpp | 7 + src/blackgui/components/flightplancomponent.h | 2 +- .../components/flightplancomponent.ui | 382 +++++++++--------- 3 files changed, 193 insertions(+), 198 deletions(-) diff --git a/src/blackgui/components/flightplancomponent.cpp b/src/blackgui/components/flightplancomponent.cpp index 23ecb7140..dd92dd116 100644 --- a/src/blackgui/components/flightplancomponent.cpp +++ b/src/blackgui/components/flightplancomponent.cpp @@ -128,6 +128,8 @@ namespace BlackGui void CFlightPlanComponent::prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft) { + if (this->m_flightPlan.wasSentOrLoaded()) { return; } + // only override with valid values if (CCallsign::isValidAircraftCallsign(ownAircraft.getCallsignAsString())) { @@ -145,6 +147,7 @@ namespace BlackGui void CFlightPlanComponent::prefillWithUserData(const Network::CUser &user) { + if (this->m_flightPlan.wasSentOrLoaded()) { return; } if (user.hasValidRealName()) { ui->le_PilotsName->setText(user.getRealName()); @@ -153,6 +156,10 @@ namespace BlackGui { ui->le_PilotsHomeBase->setText(user.getHomeBase().getIcaoCode()); } + if (user.hasValidCallsign()) + { + ui->le_Callsign->setText(user.getCallsign().asString()); + } } void CFlightPlanComponent::fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan) diff --git a/src/blackgui/components/flightplancomponent.h b/src/blackgui/components/flightplancomponent.h index 074090f9a..e149d4282 100644 --- a/src/blackgui/components/flightplancomponent.h +++ b/src/blackgui/components/flightplancomponent.h @@ -44,7 +44,7 @@ namespace BlackGui explicit CFlightPlanComponent(QWidget *parent = nullptr); //! Destructor - ~CFlightPlanComponent(); + virtual ~CFlightPlanComponent(); public slots: //! Login data were set diff --git a/src/blackgui/components/flightplancomponent.ui b/src/blackgui/components/flightplancomponent.ui index eeb995e19..83b20f5e5 100644 --- a/src/blackgui/components/flightplancomponent.ui +++ b/src/blackgui/components/flightplancomponent.ui @@ -6,12 +6,12 @@ 0 0 - 600 - 500 + 420 + 345 - TabWidget + Flight plan 0 @@ -64,8 +64,8 @@ 0 0 - 592 - 469 + 398 + 494 @@ -107,37 +107,6 @@ 6 - - - - Save to disk - - - Save - - - - :/pastel/icons/pastel/16/disk.png:/pastel/icons/pastel/16/disk.png - - - - - - - Validate - - - - - - - 4 - - - ICAO, e.g. EDDF - - - @@ -158,16 +127,34 @@ - - + + - 2. Callsign + Validate - - false + + + + + + Save to disk - - true + + Save + + + + :/pastel/icons/pastel/16/disk.png:/pastel/icons/pastel/16/disk.png + + + + + + + 4 + + + ICAO, e.g. EDDF @@ -184,48 +171,27 @@ - - - - + + + + 2. Callsign - + + false + + + true + + + + + + + 14. Pilots name / homebase + + true - - - 2 - - - 4 - - - 2 - - - 2 - - - 2 - - - - - VFR - - - - - - - IFR - - - true - - - - @@ -245,10 +211,17 @@ - - + + + + true + + + + + - 14. Pilots name / homebase + 7. Cruising altitude true @@ -268,17 +241,26 @@ - - - - true + + + + Qt::Vertical - + + QSizePolicy::Fixed + + + + 20 + 10 + + + - - + + - 7. Cruising altitude + 9.Destination airport true @@ -304,16 +286,6 @@ - - - - 9.Destination airport - - - true - - - @@ -334,38 +306,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - 99:99 - - - 00:00 - - - 5 - - - hh:mm e.g. 02:30 - - - @@ -376,10 +316,13 @@ - - + + - Reset + 4. True airspeed + + + true @@ -397,13 +340,26 @@ - - - - 4. True airspeed + + + + 99:99 - - true + + 00:00 + + + 5 + + + hh:mm e.g. 02:30 + + + + + + + Reset @@ -446,16 +402,13 @@ - - - - - - - 13. Alternate airport + + + + 4 - - true + + ICAO, e.g. EDDF @@ -469,20 +422,29 @@ - - - - 4 + + + + + + + 13. Alternate airport - - ICAO, e.g. EDDF + + true - - + + + + 99:99 + - 1. Type + 00:00 + + + 5 @@ -499,6 +461,13 @@ + + + + 8. Route + + + @@ -513,34 +482,8 @@ - - - - 8. Route - - - - - - - 99:99 - - - 00:00 - - - 5 - - - - - - 0 - 0 - - 16777215 @@ -549,13 +492,6 @@ - - - - ICAO, e.g. A321 - - - @@ -570,8 +506,15 @@ + + + + ICAO, e.g. A321 + + + - + Qt::Vertical @@ -586,6 +529,51 @@ + + + + 1. Type + + + + + + + + 6 + + + 4 + + + 2 + + + 2 + + + 2 + + + + + VFR + + + + + + + IFR + + + true + + + + + + @@ -630,7 +618,7 @@ 0 0 - 578 + 398 472