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