Also allow to set "only in error/warning" case from validation dialog

This commit is contained in:
Klaus Basan
2019-05-08 02:49:55 +02:00
parent 336b87ce86
commit efe54443cc
6 changed files with 55 additions and 21 deletions

View File

@@ -33,7 +33,11 @@ namespace BlackGui
const CAircraftMatcherSetup setup = m_matchingSettings.get();
ui->cb_EnableStartupCheck->setChecked(setup.doVerificationAtStartup());
connect(ui->cb_EnableStartupCheck, &QCheckBox::toggled, this, &CAircraftModelValidationComponent::onCheckAtStartupChanged);
ui->cb_OnlyIfErrorsOrWarnings->setChecked(setup.onlyShowVerificationWarningsAndErrors());
connect(ui->cb_EnableStartupCheck, &QCheckBox::toggled, this, &CAircraftModelValidationComponent::onCheckAtStartupChanged);
connect(ui->cb_OnlyIfErrorsOrWarnings, &QCheckBox::toggled, this, &CAircraftModelValidationComponent::onOnlyErrorWarningChanged);
connect(ui->pb_TempDisableInvalid, &QPushButton::released, this, &CAircraftModelValidationComponent::onButtonClicked);
connect(ui->pb_TempDisableSelected, &QPushButton::released, this, &CAircraftModelValidationComponent::onButtonClicked);
connect(ui->pb_TriggerValidation, &QPushButton::released, this, &CAircraftModelValidationComponent::triggerValidation);
@@ -118,6 +122,15 @@ namespace BlackGui
Q_UNUSED(msg);
}
void CAircraftModelValidationComponent::onOnlyErrorWarningChanged(bool checked)
{
CAircraftMatcherSetup setup = m_matchingSettings.get();
if (setup.onlyShowVerificationWarningsAndErrors() == checked) { return; }
setup.setOnlyShowVerificationWarningsAndErrors(checked);
const CStatusMessage msg = m_matchingSettings.setAndSave(setup);
Q_UNUSED(msg);
}
void CAircraftModelValidationComponent::triggerValidation()
{
if (!sGui || sGui->isShuttingDown() || !sGui->supportsContexts()) { return; }