diff --git a/src/blackgui/components/dbownmodelsetcomponent.cpp b/src/blackgui/components/dbownmodelsetcomponent.cpp index 83e6bd41e..fd4806e8f 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.cpp +++ b/src/blackgui/components/dbownmodelsetcomponent.cpp @@ -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()); diff --git a/src/blackgui/components/dbownmodelsetcomponent.h b/src/blackgui/components/dbownmodelsetcomponent.h index e42bc268d..f8e151174 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.h +++ b/src/blackgui/components/dbownmodelsetcomponent.h @@ -152,6 +152,9 @@ namespace BlackGui //! Reduce models void reduceModels(); + //! Remove excluded models + void removeExcludedModels(); + //! Default file name void setSaveFileName(const BlackMisc::Simulation::CSimulatorInfo &simulator);