Ref T286, "version changed" in copy models

This commit is contained in:
Klaus Basan
2018-07-03 19:43:44 +02:00
parent f2820d81a4
commit 11ff5a4dbc
3 changed files with 18 additions and 3 deletions

View File

@@ -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");