mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 22:55:41 +08:00
Context menu for model set to remove excluded models
This commit is contained in:
@@ -318,6 +318,15 @@ namespace BlackGui
|
|||||||
this->setModelSet(models, removeSimulator);
|
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()
|
void CDbOwnModelSetComponent::viewModelChanged()
|
||||||
{
|
{
|
||||||
const bool hasData = ui->tvp_OwnModelSet->rowCount() > 0;
|
const bool hasData = ui->tvp_OwnModelSet->rowCount() > 0;
|
||||||
@@ -543,6 +552,10 @@ namespace BlackGui
|
|||||||
a = new QAction(CIcons::delete16(), "Reduce models (remove duplicates)", this);
|
a = new QAction(CIcons::delete16(), "Reduce models (remove duplicates)", this);
|
||||||
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::reduceModels);
|
connect(a, &QAction::triggered, ownModelSetComp, &CDbOwnModelSetComponent::reduceModels);
|
||||||
m_setActions.append(a);
|
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.addMenuModelSet();
|
||||||
menuActions.addActions(m_setActions, CMenuAction::pathModelSet());
|
menuActions.addActions(m_setActions, CMenuAction::pathModelSet());
|
||||||
|
|||||||
@@ -152,6 +152,9 @@ namespace BlackGui
|
|||||||
//! Reduce models
|
//! Reduce models
|
||||||
void reduceModels();
|
void reduceModels();
|
||||||
|
|
||||||
|
//! Remove excluded models
|
||||||
|
void removeExcludedModels();
|
||||||
|
|
||||||
//! Default file name
|
//! Default file name
|
||||||
void setSaveFileName(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
void setSaveFileName(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user