mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T455, preselect simulator in wizard if there are models
This commit is contained in:
@@ -53,17 +53,14 @@ namespace BlackGui
|
||||
|
||||
void CConfigSimulatorComponent::preselectSimulators()
|
||||
{
|
||||
CSimulatorInfo sims;
|
||||
if (m_enabledSimulators.isSaved())
|
||||
CSimulatorInfo sims = m_enabledSimulators.get();
|
||||
if (!sims.isAnySimulator())
|
||||
{
|
||||
sims = CSimulatorInfo(m_enabledSimulators.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
// by model set
|
||||
sims = m_modelSets.simulatorsWithInitializedCache();
|
||||
CSimulatorInfo simWithModels = m_modelSets.simulatorsWithModels();
|
||||
sims = simWithModels;
|
||||
}
|
||||
|
||||
// no x64 check as we would allow to config 32bit with launcher x64 and vice versa
|
||||
const bool p3d = (sims.isP3D() || !CFsCommonUtil::p3dDir().isEmpty()) && CBuildConfig::isCompiledWithP3DSupport();
|
||||
const bool fsx = (sims.isFSX() || !CFsCommonUtil::fsxDir().isEmpty()) && CBuildConfig::isCompiledWithFsxSupport();
|
||||
const bool fs9 = (sims.isFS9() || !CFsCommonUtil::fs9Dir().isEmpty()) && CBuildConfig::isCompiledWithFs9Support();
|
||||
|
||||
@@ -162,6 +162,19 @@ namespace BlackMisc
|
||||
return withInitializedCache;
|
||||
}
|
||||
|
||||
CSimulatorInfo IMultiSimulatorModelCaches::simulatorsWithModels() const
|
||||
{
|
||||
CSimulatorInfo withModels;
|
||||
for (const CSimulatorInfo &simInfo : CSimulatorInfo::allSimulators().asSingleSimulatorSet())
|
||||
{
|
||||
if (this->getCachedModelsCount(simInfo) > 0)
|
||||
{
|
||||
withModels.add(simInfo);
|
||||
}
|
||||
}
|
||||
return withModels;
|
||||
}
|
||||
|
||||
CModelCaches::CModelCaches(bool synchronizeCache, QObject *parent) : IMultiSimulatorModelCaches(parent)
|
||||
{
|
||||
const CSimulatorInfo sim = BlackMisc::Simulation::CSimulatorInfo::guessDefaultSimulator();
|
||||
|
||||
@@ -220,6 +220,10 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
CSimulatorInfo simulatorsWithInitializedCache() const;
|
||||
|
||||
//! Simulators which have models
|
||||
//! \threadsafe
|
||||
CSimulatorInfo simulatorsWithModels() const;
|
||||
|
||||
//! Timestamp
|
||||
//! \threadsafe
|
||||
QDateTime getSynchronizedTimestamp(const CSimulatorInfo &simulator);
|
||||
|
||||
Reference in New Issue
Block a user