mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Avoid issues during shutdown in login component
This commit is contained in:
committed by
Roland Winklmeier
parent
4423f8503f
commit
04f99d10ac
@@ -385,6 +385,15 @@ namespace BlackGui
|
||||
ui->editor_Pilot->setUser(server.getUser(), true);
|
||||
}
|
||||
|
||||
bool CLoginComponent::hasContexts()
|
||||
{
|
||||
if (!sApp || !sApp->supportsContexts()) { return false; }
|
||||
if (!sApp->getIContextSimulator()) { return false; }
|
||||
if (!sApp->getIContextNetwork()) { return false; }
|
||||
if (!sApp->getIContextOwnAircraft()) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
CLoginComponent::CGuiAircraftValues CLoginComponent::getAircraftValuesFromGui() const
|
||||
{
|
||||
CGuiAircraftValues values;
|
||||
@@ -435,9 +444,7 @@ namespace BlackGui
|
||||
|
||||
void CLoginComponent::setOwnModelAndIcaoValues()
|
||||
{
|
||||
Q_ASSERT(sGui->getIContextOwnAircraft());
|
||||
Q_ASSERT(sGui->getIContextSimulator());
|
||||
|
||||
if (!this->hasContexts()) { return; }
|
||||
CAircraftModel model;
|
||||
const bool simulating = sGui->getIContextSimulator() &&
|
||||
(sGui->getIContextSimulator()->getSimulatorStatus() & ISimulator::Simulating);
|
||||
@@ -505,7 +512,7 @@ namespace BlackGui
|
||||
|
||||
bool CLoginComponent::validateAircraftValues()
|
||||
{
|
||||
const CGuiAircraftValues values = getAircraftValuesFromGui();
|
||||
const CGuiAircraftValues values = this->getAircraftValuesFromGui();
|
||||
|
||||
const bool validCombinedType = CAircraftIcaoCode::isValidCombinedType(values.ownAircraftCombinedType);
|
||||
ui->lblp_AircraftCombinedType->setTicked(validCombinedType);
|
||||
|
||||
@@ -201,6 +201,9 @@ namespace BlackGui
|
||||
//! Tab widget (server) changed
|
||||
void onServerTabWidgetChanged(int index);
|
||||
|
||||
//! Has contexts
|
||||
bool hasContexts();
|
||||
|
||||
static const int OverlayMessageMs = 5000;
|
||||
QScopedPointer<Ui::CLoginComponent> ui;
|
||||
QScopedPointer<CDbQuickMappingWizard> m_mappingWizard;
|
||||
|
||||
Reference in New Issue
Block a user