mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +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 int modelsLoaded = models.size();
|
||||
ui->tvp_OwnAircraftModels->updateContainerMaybeAsync(models);
|
||||
CStatusMessage m;
|
||||
if (modelsLoaded < 1)
|
||||
{
|
||||
// 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
|
||||
{
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace BlackGui
|
||||
|
||||
signals:
|
||||
//! Models have been successfully loaded
|
||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbOwnModelsComponent> ui;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace BlackGui
|
||||
|
||||
signals:
|
||||
//! \copydoc CDbOwnModelsComponent::successfullyLoadedModels
|
||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
void successfullyLoadedModels(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbOwnModelsDialog> ui;
|
||||
|
||||
@@ -104,8 +104,9 @@ namespace BlackGui
|
||||
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();
|
||||
if (simulator != currentSimulator) { return; } // ignore changes not for my selected simulator
|
||||
this->onSimulatorChanged(simulator);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BlackGui
|
||||
void onSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Models have been loaded
|
||||
void onModelsLoaded(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
void onModelsLoaded(const BlackMisc::Simulation::CSimulatorInfo &simulator, int count);
|
||||
|
||||
//! Asynchronously call onSettingsChanged
|
||||
void triggerSettingsChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
Reference in New Issue
Block a user