mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T292, Ref T285 model loader and cache improvements
* multi caches also emit when values are set and synchronized * model loader detects cache changed * added CCentralMultiSimulatorModelCachesAware
This commit is contained in:
@@ -53,6 +53,7 @@ namespace BlackGui
|
||||
connect(ui->comp_SimulatorSelector, &CSimulatorSelector::changed, this, &CDbOwnModelsComponent::onSimulatorSelectorChanged);
|
||||
connect(&CMultiAircraftModelLoaderProvider::multiModelLoaderInstance(), &CMultiAircraftModelLoaderProvider::loadingFinished, this, &CDbOwnModelsComponent::onOwnModelsLoadingFinished, Qt::QueuedConnection);
|
||||
connect(&CMultiAircraftModelLoaderProvider::multiModelLoaderInstance(), &CMultiAircraftModelLoaderProvider::diskLoadingStarted, this, &CDbOwnModelsComponent::onOwnModelsDiskLoadingStarted, Qt::QueuedConnection);
|
||||
connect(&CMultiAircraftModelLoaderProvider::multiModelLoaderInstance(), &CMultiAircraftModelLoaderProvider::cacheChanged, this, &CDbOwnModelsComponent::onCacheChanged, Qt::QueuedConnection);
|
||||
|
||||
// Last selection isPinned -> no sync needed
|
||||
ui->comp_SimulatorSelector->setRememberSelectionAndSetToLastSelection();
|
||||
@@ -546,9 +547,14 @@ namespace BlackGui
|
||||
// cache loads may occur in background, do not adjust UI settings
|
||||
if (info == IAircraftModelLoader::CacheLoaded) { return; }
|
||||
|
||||
// parsed loads normally explicit
|
||||
ui->le_Simulator->setText(simulator.toQString());
|
||||
ui->comp_SimulatorSelector->setValue(simulator);
|
||||
// parsed loads normally explicit displaying this simulator
|
||||
this->setSimulator(simulator);
|
||||
}
|
||||
|
||||
void CDbOwnModelsComponent::onCacheChanged(const CSimulatorInfo &simulator)
|
||||
{
|
||||
const CAircraftModelList models(m_modelLoader->getCachedModels(simulator));
|
||||
ui->tvp_OwnAircraftModels->updateContainerMaybeAsync(models);
|
||||
}
|
||||
|
||||
void CDbOwnModelsComponent::requestSimulatorModels(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode, const QStringList &modelDirectories)
|
||||
|
||||
@@ -142,6 +142,9 @@ namespace BlackGui
|
||||
//! Model loading finished
|
||||
void onOwnModelsLoadingFinished(const BlackMisc::CStatusMessageList &statusMessages, const BlackMisc::Simulation::CSimulatorInfo &simulator, BlackMisc::Simulation::IAircraftModelLoader::LoadFinishedInfo info);
|
||||
|
||||
//! Cache has been changed
|
||||
void onCacheChanged(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Request simulator models
|
||||
void requestSimulatorModels(const BlackMisc::Simulation::CSimulatorInfo &simulator, BlackMisc::Simulation::IAircraftModelLoader::LoadMode mode, const QStringList &modelDirectories = {});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user