Login component style

This commit is contained in:
Klaus Basan
2018-10-15 17:03:27 +02:00
parent 4123101e34
commit fbfa014fff
2 changed files with 6 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ namespace BlackGui
if (sGui && sGui->getIContextSimulator()) if (sGui && sGui->getIContextSimulator())
{ {
connect(sGui->getIContextSimulator(), &IContextSimulator::ownAircraftModelChanged, this, &CLoginComponent::simulatorModelChanged); connect(sGui->getIContextSimulator(), &IContextSimulator::ownAircraftModelChanged, this, &CLoginComponent::onSimulatorModelChanged);
} }
// server and UI elements when in disconnect state // server and UI elements when in disconnect state
@@ -587,18 +587,19 @@ namespace BlackGui
{ {
if (!sGui->getIContextSimulator()->isSimulatorAvailable()) { return; } if (!sGui->getIContextSimulator()->isSimulatorAvailable()) { return; }
const CAircraftModel model(sGui->getIContextOwnAircraft()->getOwnAircraft().getModel()); const CAircraftModel model(sGui->getIContextOwnAircraft()->getOwnAircraft().getModel());
this->simulatorModelChanged(model); this->onSimulatorModelChanged(model);
} }
void CLoginComponent::simulatorModelChanged(const CAircraftModel &model) void CLoginComponent::onSimulatorModelChanged(const CAircraftModel &model)
{ {
Q_ASSERT_X(sGui && sGui->getIContextNetwork(), Q_FUNC_INFO, "Missing context"); if (!sGui || !sGui->getIContextNetwork() || sApp->isShuttingDown()) { return; }
const bool isNetworkConnected = sGui && sGui->getIContextNetwork()->isConnected(); const bool isNetworkConnected = sGui && sGui->getIContextNetwork()->isConnected();
if (isNetworkConnected) { return; } if (isNetworkConnected) { return; }
const QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>"); const QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
if (!model.hasModelString()) if (!model.hasModelString())
{ {
CLogMessage(this).validationInfo("Invalid lookup for '%1' successful: %2") << modelStr << model.toQString(); CLogMessage(this).validationInfo("Invalid lookup for '%1' successful: %2") << modelStr << model.toQString();
CLogMessage(this).validationInfo("Hint: Are you using the emulated driver? Set a model if so!");
return; return;
} }
this->setOwnModelAndIcaoValues(); this->setOwnModelAndIcaoValues();

View File

@@ -175,7 +175,7 @@ namespace BlackGui
void reverseLookupAircraftModel(); void reverseLookupAircraftModel();
//! Simulator model has been changed //! Simulator model has been changed
void simulatorModelChanged(const BlackMisc::Simulation::CAircraftModel &model); void onSimulatorModelChanged(const BlackMisc::Simulation::CAircraftModel &model);
//! Launch mapping wizard //! Launch mapping wizard
void mappingWizard(); void mappingWizard();