diff --git a/src/blackgui/components/dbownmodelsetcomponent.cpp b/src/blackgui/components/dbownmodelsetcomponent.cpp index bd0ecd660..468b59597 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.cpp +++ b/src/blackgui/components/dbownmodelsetcomponent.cpp @@ -168,10 +168,13 @@ namespace BlackGui return CStatusMessage(this, CStatusMessage::SeverityError, "Cannot add data for " + simulator.toQString(true) + " to " + this->getModelSetSimulator().toQString(true), true); } + + const bool allowExcludedModels = this->m_modelSettings.get().getAllowExcludedModels(); CAircraftModelList updateModels(this->getModelSet()); - const int d = updateModels.replaceOrAddModelsWithString(models, Qt::CaseInsensitive); + int d = updateModels.replaceOrAddModelsWithString(models, Qt::CaseInsensitive); if (d > 0) { + if (!allowExcludedModels) { updateModels.removeIfExcluded(); } updateModels.resetOrder(); ui->tvp_OwnModelSet->updateContainerMaybeAsync(updateModels); return CStatusMessage(this, CStatusMessage::SeverityInfo, "Modified " + QString::number(d) + " entries in model set " + this->getModelSetSimulator().toQString(true), true); @@ -274,6 +277,11 @@ namespace BlackGui } } + void CDbOwnModelSetComponent::ps_modelSettingsChanged() + { + // void + } + void CDbOwnModelSetComponent::ps_viewModelChanged() { ui->pb_SaveAsSetForSimulator->setEnabled(true); diff --git a/src/blackgui/components/dbownmodelsetcomponent.h b/src/blackgui/components/dbownmodelsetcomponent.h index cc2c48f19..7dd7d3aaa 100644 --- a/src/blackgui/components/dbownmodelsetcomponent.h +++ b/src/blackgui/components/dbownmodelsetcomponent.h @@ -29,8 +29,8 @@ class QAction; class QWidget; -namespace BlackMisc { namespace Simulation { class CAircraftModel; } } namespace Ui { class CDbOwnModelSetComponent; } +namespace BlackMisc { namespace Simulation { class CAircraftModel; } } namespace BlackGui { namespace Menus { class CMenuActions; } @@ -122,6 +122,9 @@ namespace BlackGui //! Preferences changed void ps_distributorPreferencesChanged(); + //! Model settings changed + void ps_modelSettingsChanged(); + //! Model (of view) has been changed void ps_viewModelChanged(); @@ -144,7 +147,8 @@ namespace BlackGui QScopedPointer ui; QScopedPointer m_modelSetDialog; BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this }; - BlackMisc::CSetting m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged }; + BlackMisc::CSettingReadOnly m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged }; //!< distributor preferences + BlackMisc::CSettingReadOnly m_modelSettings { this, &CDbOwnModelSetComponent::ps_modelSettingsChanged }; //!< settings for models // -------------------------- custom menus -----------------------------------