mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 07:15:34 +08:00
refs #780, fixes login/flightplan preset
* empty airline is valid * sync with flightplan (new signal to indicate changed login values) * better preset of own model
This commit is contained in:
@@ -59,6 +59,7 @@ namespace BlackGui
|
||||
ui(new Ui::CFlightPlanComponent)
|
||||
{
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||
Q_ASSERT_X(sGui->hasWebDataServices(), Q_FUNC_INFO, "missing web services");
|
||||
|
||||
// UI
|
||||
ui->setupUi(this);
|
||||
@@ -119,7 +120,10 @@ namespace BlackGui
|
||||
{
|
||||
if (this->m_flightPlan.wasSentOrLoaded()) { return; } // when loaded or sent do not override
|
||||
if (!sGui->getIContextOwnAircraft()) { return; }
|
||||
this->prefillWithAircraftData(sGui->getIContextOwnAircraft()->getOwnAircraft());
|
||||
|
||||
const CSimulatedAircraft ownAircraft(sGui->getIContextOwnAircraft()->getOwnAircraft());
|
||||
this->prefillWithAircraftData(ownAircraft);
|
||||
this->prefillWithUserData(ownAircraft.getPilot());
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::prefillWithAircraftData(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft)
|
||||
@@ -139,6 +143,18 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::prefillWithUserData(const Network::CUser &user)
|
||||
{
|
||||
if (user.hasValidRealName())
|
||||
{
|
||||
ui->le_PilotsName->setText(user.getRealName());
|
||||
}
|
||||
if (user.hasHomeBase())
|
||||
{
|
||||
ui->le_PilotsHomeBase->setText(user.getHomeBase().getIcaoCode());
|
||||
}
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::fillWithFlightPlanData(const BlackMisc::Aviation::CFlightPlan &flightPlan)
|
||||
{
|
||||
ui->le_AlternateAirport->setText(flightPlan.getAlternateAirportIcao().asString());
|
||||
|
||||
Reference in New Issue
Block a user