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

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>550</height>
<width>700</width>
<height>575</height>
</rect>
</property>
<property name="minimumSize">

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; }

View File

@@ -63,6 +63,9 @@ namespace BlackGui
//! Enable/disable startup check
void onCheckAtStartupChanged(bool checked);
//! Only show ieth warnings/errors
void onOnlyErrorWarningChanged(bool checked);
//! Trigger new validation
void triggerValidation();

View File

@@ -65,10 +65,10 @@
<item>
<widget class="QWidget" name="wi_Buttons" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="4">
<widget class="QPushButton" name="pb_TempDisableInvalid">
<item row="0" column="5">
<widget class="QPushButton" name="pb_TempDisableSelected">
<property name="text">
<string>temp.disable invalid</string>
<string>temp.disable selected</string>
</property>
</widget>
</item>
@@ -88,20 +88,6 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="cb_EnableStartupCheck">
<property name="text">
<string>check at startup</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="pb_TempDisableSelected">
<property name="text">
<string>temp.disable selected</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pb_TriggerValidation">
<property name="text">
@@ -109,6 +95,13 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="pb_TempDisableInvalid">
<property name="text">
<string>temp.disable invalid</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pb_help">
<property name="text">
@@ -116,6 +109,20 @@
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="cb_EnableStartupCheck">
<property name="text">
<string>check at startup</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QCheckBox" name="cb_OnlyIfErrorsOrWarnings">
<property name="text">
<string>only if errors/warnings</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -143,11 +150,12 @@
<tabstops>
<tabstop>tw_CAircraftModelValidationComponent</tabstop>
<tabstop>tvp_InvalidModels</tabstop>
<tabstop>cb_EnableStartupCheck</tabstop>
<tabstop>pb_help</tabstop>
<tabstop>pb_TriggerValidation</tabstop>
<tabstop>pb_TempDisableInvalid</tabstop>
<tabstop>pb_TempDisableSelected</tabstop>
<tabstop>cb_EnableStartupCheck</tabstop>
<tabstop>cb_OnlyIfErrorsOrWarnings</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -51,6 +51,13 @@ namespace BlackMisc
this->setMatchingMode(m);
}
void CAircraftMatcherSetup::setOnlyShowVerificationWarningsAndErrors(bool only)
{
MatchingMode m = this->getMatchingMode();
m.setFlag(ModelVerificationOnlyWarnError, only);
this->setMatchingMode(m);
}
QString CAircraftMatcherSetup::convertToQString(bool i18n) const
{
Q_UNUSED(i18n);

View File

@@ -128,6 +128,9 @@ namespace BlackMisc
//! Set startup verification
void setVerificationAtStartup(bool verify);
//! Set the "show only errors" mode
void setOnlyShowVerificationWarningsAndErrors(bool only);
//! Matching mode as string
QString getMatchingModeAsString() const { return modeToString(this->getMatchingMode()); }