diff --git a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp index 4e1f1cb6c..cce01f225 100644 --- a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -34,8 +34,10 @@ namespace BlackGui { ui->setupUi(this); ui->comp_SimulatorSelector->setMode(CSimulatorSelector::CheckBoxes); + ui->comp_SimulatorSelector->clear(); ui->tvp_AircraftModels->setAircraftModelMode(CAircraftModelListModel::OwnModelSet); connect(ui->pb_StartCopying, &QPushButton::clicked, this, &CCopyModelsFromOtherSwiftVersionsComponent::copy); + connect(ui->comp_OtherSwiftVersions, &COtherSwiftVersionsComponent::versionChanged, this, &CCopyModelsFromOtherSwiftVersionsComponent::onVersionChanged); } CCopyModelsFromOtherSwiftVersionsComponent::~CCopyModelsFromOtherSwiftVersionsComponent() @@ -159,6 +161,16 @@ namespace BlackGui return reply == QMessageBox::Yes; } + void CCopyModelsFromOtherSwiftVersionsComponent::onVersionChanged(const CApplicationInfo &otherVersion) + { + const CSimulatorInfo cacheSims = m_modelCaches.otherVersionSimulatorsWithFile(otherVersion); + const CSimulatorInfo setSims = m_modelSetCaches.otherVersionSimulatorsWithFile(otherVersion); + + ui->cb_ModelCache->setChecked(cacheSims.isAnySimulator()); + ui->cb_ModelSet->setChecked(setSims.isAnySimulator()); + ui->comp_SimulatorSelector->setValue(setSims); + } + bool CCopyModelsFromOtherSwiftVersionsWizardPage::validatePage() { Q_ASSERT_X(m_copyModels, Q_FUNC_INFO, "Missing widget"); diff --git a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.h b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.h index 8dd5ab151..c45a4f6ca 100644 --- a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.h +++ b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.h @@ -48,6 +48,9 @@ namespace BlackGui //! Confirm override bool confirmOverride(const QString &msg); + //! Init the simulators which can be copied + void onVersionChanged(const BlackMisc::CApplicationInfo &otherVersion); + QScopedPointer ui; // caches will be explicitly initialized in copy diff --git a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.ui b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.ui index 4f501cbfb..8dcfde641 100644 --- a/src/blackgui/components/copymodelsfromotherswiftversionscomponent.ui +++ b/src/blackgui/components/copymodelsfromotherswiftversionscomponent.ui @@ -7,13 +7,13 @@ 0 0 508 - 420 + 495 Copy models from other swift versions - + @@ -25,7 +25,7 @@ 0 - 50 + 125