mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +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()
|
void CConfigSimulatorComponent::preselectSimulators()
|
||||||
{
|
{
|
||||||
CSimulatorInfo sims;
|
CSimulatorInfo sims = m_enabledSimulators.get();
|
||||||
if (m_enabledSimulators.isSaved())
|
if (!sims.isAnySimulator())
|
||||||
{
|
{
|
||||||
sims = CSimulatorInfo(m_enabledSimulators.get());
|
CSimulatorInfo simWithModels = m_modelSets.simulatorsWithModels();
|
||||||
}
|
sims = simWithModels;
|
||||||
else
|
|
||||||
{
|
|
||||||
// by model set
|
|
||||||
sims = m_modelSets.simulatorsWithInitializedCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 p3d = (sims.isP3D() || !CFsCommonUtil::p3dDir().isEmpty()) && CBuildConfig::isCompiledWithP3DSupport();
|
||||||
const bool fsx = (sims.isFSX() || !CFsCommonUtil::fsxDir().isEmpty()) && CBuildConfig::isCompiledWithFsxSupport();
|
const bool fsx = (sims.isFSX() || !CFsCommonUtil::fsxDir().isEmpty()) && CBuildConfig::isCompiledWithFsxSupport();
|
||||||
const bool fs9 = (sims.isFS9() || !CFsCommonUtil::fs9Dir().isEmpty()) && CBuildConfig::isCompiledWithFs9Support();
|
const bool fs9 = (sims.isFS9() || !CFsCommonUtil::fs9Dir().isEmpty()) && CBuildConfig::isCompiledWithFs9Support();
|
||||||
|
|||||||
@@ -162,6 +162,19 @@ namespace BlackMisc
|
|||||||
return withInitializedCache;
|
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)
|
CModelCaches::CModelCaches(bool synchronizeCache, QObject *parent) : IMultiSimulatorModelCaches(parent)
|
||||||
{
|
{
|
||||||
const CSimulatorInfo sim = BlackMisc::Simulation::CSimulatorInfo::guessDefaultSimulator();
|
const CSimulatorInfo sim = BlackMisc::Simulation::CSimulatorInfo::guessDefaultSimulator();
|
||||||
|
|||||||
@@ -220,6 +220,10 @@ namespace BlackMisc
|
|||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
CSimulatorInfo simulatorsWithInitializedCache() const;
|
CSimulatorInfo simulatorsWithInitializedCache() const;
|
||||||
|
|
||||||
|
//! Simulators which have models
|
||||||
|
//! \threadsafe
|
||||||
|
CSimulatorInfo simulatorsWithModels() const;
|
||||||
|
|
||||||
//! Timestamp
|
//! Timestamp
|
||||||
//! \threadsafe
|
//! \threadsafe
|
||||||
QDateTime getSynchronizedTimestamp(const CSimulatorInfo &simulator);
|
QDateTime getSynchronizedTimestamp(const CSimulatorInfo &simulator);
|
||||||
|
|||||||
Reference in New Issue
Block a user