mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Adjusted signal (added count) and overlay message if model loading succeeded
This commit is contained in:
@@ -555,13 +555,22 @@ namespace BlackGui
|
|||||||
const CAircraftModelList models(m_modelLoader->getCachedModels(simulator));
|
const CAircraftModelList models(m_modelLoader->getCachedModels(simulator));
|
||||||
const int modelsLoaded = models.size();
|
const int modelsLoaded = models.size();
|
||||||
ui->tvp_OwnAircraftModels->updateContainerMaybeAsync(models);
|
ui->tvp_OwnAircraftModels->updateContainerMaybeAsync(models);
|
||||||
|
CStatusMessage m;
|
||||||
if (modelsLoaded < 1)
|
if (modelsLoaded < 1)
|
||||||
{
|
{
|
||||||
// loading ok, but no data
|
// loading ok, but no data
|
||||||
CLogMessage(this).warning("Loading completed for simulator '%1', but no models") << simulator;
|
m = CLogMessage(this).warning("Loading completed for simulator '%1', but no models") << simulator;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m = CLogMessage(this).info("Loading completed for simulator '%1' with %2 models") << simulator << modelsLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit this->successfullyLoadedModels(simulator);
|
// overlay
|
||||||
|
if (!m.isEmpty() && info == IAircraftModelLoader::ParsedData) { this->showOverlayMessage(m, 5000); }
|
||||||
|
|
||||||
|
// signal
|
||||||
|
emit this->successfullyLoadedModels(simulator, modelsLoaded);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Models have been successfully loaded
|
//! Models have been successfully loaded
|
||||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDbOwnModelsComponent> ui;
|
QScopedPointer<Ui::CDbOwnModelsComponent> ui;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! \copydoc CDbOwnModelsComponent::successfullyLoadedModels
|
//! \copydoc CDbOwnModelsComponent::successfullyLoadedModels
|
||||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDbOwnModelsDialog> ui;
|
QScopedPointer<Ui::CDbOwnModelsDialog> ui;
|
||||||
|
|||||||
@@ -104,8 +104,9 @@ namespace BlackGui
|
|||||||
this->onSimulatorChanged(simulator);
|
this->onSimulatorChanged(simulator);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFirstModelSetComponent::onModelsLoaded(const CSimulatorInfo &simulator)
|
void CFirstModelSetComponent::onModelsLoaded(const CSimulatorInfo &simulator, int count)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(count);
|
||||||
const CSimulatorInfo currentSimulator = ui->comp_SimulatorSelector->getValue();
|
const CSimulatorInfo currentSimulator = ui->comp_SimulatorSelector->getValue();
|
||||||
if (simulator != currentSimulator) { return; } // ignore changes not for my selected simulator
|
if (simulator != currentSimulator) { return; } // ignore changes not for my selected simulator
|
||||||
this->onSimulatorChanged(simulator);
|
this->onSimulatorChanged(simulator);
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace BlackGui
|
|||||||
void onSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void onSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|
||||||
//! Models have been loaded
|
//! Models have been loaded
|
||||||
void onModelsLoaded(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void onModelsLoaded(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||||
|
|
||||||
//! Asynchronously call onSettingsChanged
|
//! Asynchronously call onSettingsChanged
|
||||||
void triggerSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void triggerSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|||||||
Reference in New Issue
Block a user