Ref T472, matching settings/setup for categories

This commit is contained in:
Klaus Basan
2019-03-01 00:04:37 +01:00
committed by Mat Sutcliffe
parent 6ca6d12851
commit 530bd38f00
6 changed files with 100 additions and 35 deletions

View File

@@ -32,14 +32,6 @@
<bool>true</bool>
</property>
<widget class="QWidget" name="qw_MatchingForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>450</height>
</rect>
</property>
<layout class="QVBoxLayout" name="vl_ScrollAreaContent">
<property name="leftMargin">
<number>0</number>
@@ -58,7 +50,7 @@
<property name="minimumSize">
<size>
<width>0</width>
<height>450</height>
<height>550</height>
</size>
</property>
</widget>

View File

@@ -27,7 +27,8 @@ namespace BlackGui
connect(ui->rb_Reduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
connect(ui->rb_ScoreAndReduction, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
connect(ui->rb_ScoreOnly, &QRadioButton::released, this, &CMatchingForm::onAlgorithmChanged, Qt::QueuedConnection);
connect(ui->pb_Reset, &QPushButton::released, this, &CMatchingForm::clear, Qt::QueuedConnection);
connect(ui->pb_ResetAlgorithm, &QPushButton::released, this, &CMatchingForm::resetByAlgorithm, Qt::QueuedConnection);
connect(ui->pb_ResetAll, &QPushButton::released, this, &CMatchingForm::resetAll, Qt::QueuedConnection);
}
CMatchingForm::~CMatchingForm()
@@ -47,6 +48,8 @@ namespace BlackGui
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetRemoveFailed, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_ModelFailedFailover, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_ModelSetVerification, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_CategoryGlider, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_CategoryMilitaryAircraft, readonly);
const bool enabled = !readonly;
ui->rb_Reduction->setEnabled(enabled);
@@ -76,6 +79,8 @@ namespace BlackGui
ui->cb_ByFamily->setChecked(mode.testFlag(CAircraftMatcherSetup::ByFamily));
ui->cb_ByForceMilitary->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceMilitary));
ui->cb_ByForceCivilian->setChecked(mode.testFlag(CAircraftMatcherSetup::ByForceCivilian));
ui->cb_CategoryGlider->setChecked(mode.testFlag(CAircraftMatcherSetup::ByCategoryGlider));
ui->cb_CategoryMilitaryAircraft->setChecked(mode.testFlag(CAircraftMatcherSetup::ByCategoryMilitary));
ui->cb_ByVtol->setChecked(mode.testFlag(CAircraftMatcherSetup::ByVtol));
ui->cb_ScoreIgnoreZeros->setChecked(mode.testFlag(CAircraftMatcherSetup::ScoreIgnoreZeros));
ui->cb_ScorePreferColorLiveries->setChecked(mode.testFlag(CAircraftMatcherSetup::ScorePreferColorLiveries));
@@ -97,7 +102,18 @@ namespace BlackGui
void CMatchingForm::clear()
{
const CAircraftMatcherSetup s(algorithm());
this->resetAll();
}
void CMatchingForm::resetByAlgorithm()
{
const CAircraftMatcherSetup s(this->algorithm());
this->setValue(s);
}
void CMatchingForm::resetAll()
{
const CAircraftMatcherSetup s;
this->setValue(s);
}
@@ -118,6 +134,8 @@ namespace BlackGui
ui->cb_ByForceMilitary->isChecked(),
ui->cb_ByForceCivilian->isChecked(),
ui->cb_ByVtol->isChecked(),
ui->cb_CategoryGlider->isChecked(),
ui->cb_CategoryMilitaryAircraft->isChecked(),
ui->cb_ScoreIgnoreZeros->isChecked(), ui->cb_ScorePreferColorLiveries->isChecked(),
ui->cb_ExclNoDbData->isChecked(), ui->cb_ExclNoExcludedModels->isChecked(),
ui->cb_ModelSetVerification->isChecked(), ui->cb_ModelSetRemoveFailed->isChecked(),
@@ -172,5 +190,6 @@ namespace BlackGui
const CAircraftMatcherSetup setup = this->value();
this->setValue(setup);
}
} // ns
} // ns

View File

@@ -66,6 +66,11 @@ namespace BlackGui
//! Algorithm has been toggled
void onAlgorithmChanged();
//! Reset @{
void resetByAlgorithm();
void resetAll();
//! }
QScopedPointer<Ui::CMatchingForm> ui;
};
} // ns

View File

@@ -2,14 +2,6 @@
<ui version="4.0">
<class>CMatchingForm</class>
<widget class="QFrame" name="CMatchingForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>293</width>
<height>465</height>
</rect>
</property>
<property name="windowTitle">
<string>Matching form</string>
</property>
@@ -26,6 +18,13 @@
<property name="bottomMargin">
<number>5</number>
</property>
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="pb_ResetAll">
<property name="text">
<string>reset (all)</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_Algorithm">
<property name="title">
@@ -54,9 +53,9 @@
</widget>
</item>
<item row="3" column="2" alignment="Qt::AlignRight">
<widget class="QPushButton" name="pb_Reset">
<widget class="QPushButton" name="pb_ResetAlgorithm">
<property name="text">
<string>reset</string>
<string>reset (by algorithm)</string>
</property>
</widget>
</item>
@@ -187,6 +186,29 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_Categories">
<property name="title">
<string>Matching by categories</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="cb_CategoryGlider">
<property name="text">
<string>Glider</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cb_CategoryMilitaryAircraft">
<property name="text">
<string>military aircraft</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_FailureHandling">
<property name="title">
@@ -278,7 +300,7 @@
<tabstop>rb_Reduction</tabstop>
<tabstop>rb_ScoreOnly</tabstop>
<tabstop>rb_ScoreAndReduction</tabstop>
<tabstop>pb_Reset</tabstop>
<tabstop>pb_ResetAlgorithm</tabstop>
<tabstop>rb_PickFirst</tabstop>
<tabstop>rb_PickRandom</tabstop>
<tabstop>rb_PickByOrder</tabstop>
@@ -291,6 +313,8 @@
<tabstop>cb_ByVtol</tabstop>
<tabstop>cb_ByForceMilitary</tabstop>
<tabstop>cb_ByForceCivilian</tabstop>
<tabstop>cb_CategoryGlider</tabstop>
<tabstop>cb_CategoryMilitaryAircraft</tabstop>
<tabstop>cb_ModelSetVerification</tabstop>
<tabstop>cb_ModelSetRemoveFailed</tabstop>
<tabstop>cb_ModelFailedFailover</tabstop>