Some smaller mapping tool improvements

* allow to remove NON DB models (context menu)
* renamed radio buttons
This commit is contained in:
Klaus Basan
2019-09-04 17:54:38 +02:00
committed by Mat Sutcliffe
parent 7b8db694cc
commit decdbb4432
4 changed files with 27 additions and 5 deletions

View File

@@ -342,6 +342,15 @@ namespace BlackGui
this->setModelSet(models, simulator);
}
void CDbOwnModelSetComponent::removeNonDBModels()
{
const CSimulatorInfo simulator = this->getModelSetSimulator();
CAircraftModelList models = ui->tvp_OwnModelSet->containerOrFilteredContainer();
const int r = models.removeObjectsWithoutDbKey();
if (r < 1) { return; }
this->setModelSet(models, simulator);
}
void CDbOwnModelSetComponent::viewModelChanged()
{
const bool hasData = ui->tvp_OwnModelSet->rowCount() > 0;
@@ -596,6 +605,10 @@ namespace BlackGui
a = new QAction(CIcons::delete16(), "Remove excluded models", this);
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::removeExcludedModels, Qt::QueuedConnection);
m_setActions.append(a);
a = new QAction(CIcons::delete16(), "Remove non DB models", this);
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::removeNonDBModels, Qt::QueuedConnection);
m_setActions.append(a);
}
menuActions.addMenuModelSet();
menuActions.addActions(m_setActions, CMenuAction::pathModelSet());

View File

@@ -155,6 +155,9 @@ namespace BlackGui
//! Remove excluded models
void removeExcludedModels();
//! Remove NON DB models
void removeNonDBModels();
//! Default file name
void setSaveFileName(const BlackMisc::Simulation::CSimulatorInfo &simulator);

View File

@@ -163,8 +163,8 @@ namespace BlackGui
CDistributorList COwnModelSetForm::getDistributorsBasedOnOptions() const
{
if (ui->rb_DistributorsAll->isChecked()) { return this->getAllDistributors(); }
if (ui->rb_DistributorsSelected->isChecked()) { return this->getSelectedDistributors(); }
if (ui->rb_DistributorsAll->isChecked()) { return this->getAllDistributors(); }
if (ui->rb_DistributorsSelected->isChecked()) { return this->getSelectedDistributors(); }
if (ui->rb_DistributorsFromBelow->isChecked()) { return this->getShownDistributors(); }
Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong option");
return CDistributorList();

View File

@@ -158,8 +158,11 @@
</item>
<item row="3" column="2">
<widget class="QRadioButton" name="rb_DistributorsFromBelow">
<property name="toolTip">
<string>all distributors shown below</string>
</property>
<property name="text">
<string>all from below</string>
<string>all shown below</string>
</property>
<attribute name="buttonGroup">
<string notr="true">bg_Distributors</string>
@@ -175,6 +178,9 @@
</item>
<item row="3" column="1">
<widget class="QRadioButton" name="rb_DistributorsSelected">
<property name="toolTip">
<string>all selected distributors from below</string>
</property>
<property name="text">
<string>selected from below</string>
</property>
@@ -186,7 +192,7 @@
<item row="3" column="3">
<widget class="QRadioButton" name="rb_DistributorsAll">
<property name="text">
<string>all from below</string>
<string>all distributors</string>
</property>
<property name="checked">
<bool>true</bool>
@@ -305,9 +311,9 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="bg_Mode"/>
<buttongroup name="bg_Displayed"/>
<buttongroup name="bg_SourceSet"/>
<buttongroup name="bg_Mode"/>
<buttongroup name="bg_Distributors"/>
</buttongroups>
</ui>