Skip to content

Commit

Permalink
Fix #12984 (GUI: Misra C++ option does not work well in project dialo…
Browse files Browse the repository at this point in the history
…g) (#6659)
  • Loading branch information
danmar authored Aug 5, 2024
1 parent e9c73df commit 1a850d9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,22 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
}

mUI->mMisraCpp->setEnabled(mPremium);
mUI->mMisraCppVersion->setVisible(mPremium);
if (projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2008)) {
mUI->mMisraCpp->setChecked(true);
mUI->mMisraCppVersion->setCurrentIndex(0);
}
else if (projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2023)) {
mUI->mMisraCpp->setChecked(true);
mUI->mMisraCppVersion->setCurrentIndex(1);
} else {
mUI->mMisraCpp->setChecked(false);
mUI->mMisraCppVersion->setCurrentIndex(1);
}

mUI->mMisraCppVersion->setEnabled(mUI->mMisraCpp->isChecked());
connect(mUI->mMisraCpp, &QCheckBox::toggled, mUI->mMisraCppVersion, &QComboBox::setEnabled);

mUI->mMisraCppVersion->setVisible(mPremium);
mUI->mMisraCppVersion->setCurrentIndex(projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2023));

mUI->mCertC2016->setChecked(mPremium && projectFile->getCodingStandards().contains(CODING_STANDARD_CERT_C));
mUI->mCertCpp2016->setChecked(mPremium && projectFile->getCodingStandards().contains(CODING_STANDARD_CERT_CPP));
mUI->mAutosar->setChecked(mPremium && projectFile->getCodingStandards().contains(CODING_STANDARD_AUTOSAR));
Expand Down

0 comments on commit 1a850d9

Please sign in to comment.