Context menu for model set to remove excluded models

This commit is contained in:
Klaus Basan
2018-12-10 10:44:23 +01:00
parent 4051e958cf
commit 0f0800f35d
2 changed files with 16 additions and 0 deletions

View File

@@ -318,6 +318,15 @@ namespace BlackGui
this->setModelSet(models, removeSimulator);
}
void CDbOwnModelSetComponent::removeExcludedModels()
{
const CSimulatorInfo simulator = this->getModelSetSimulator();
CAircraftModelList models = ui->tvp_OwnModelSet->containerOrFilteredContainer();
const int r = models.removeIfExcluded();
if (r < 1) { return; }
this->setModelSet(models, simulator);
}
void CDbOwnModelSetComponent::viewModelChanged()
{
const bool hasData = ui->tvp_OwnModelSet->rowCount() > 0;
@@ -543,6 +552,10 @@ namespace BlackGui
a = new QAction(CIcons::delete16(), "Reduce models (remove duplicates)", this);
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::reduceModels);
m_setActions.append(a);
a = new QAction(CIcons::delete16(), "Remove excluded models", this);
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::removeExcludedModels);
m_setActions.append(a);
}
menuActions.addMenuModelSet();
menuActions.addActions(m_setActions, CMenuAction::pathModelSet());