mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Also allow to set "only in error/warning" case from validation dialog
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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/>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user