mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 16:25:54 +08:00
@@ -168,10 +168,13 @@ namespace BlackGui
|
|||||||
return CStatusMessage(this, CStatusMessage::SeverityError,
|
return CStatusMessage(this, CStatusMessage::SeverityError,
|
||||||
"Cannot add data for " + simulator.toQString(true) + " to " + this->getModelSetSimulator().toQString(true), true);
|
"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());
|
CAircraftModelList updateModels(this->getModelSet());
|
||||||
const int d = updateModels.replaceOrAddModelsWithString(models, Qt::CaseInsensitive);
|
int d = updateModels.replaceOrAddModelsWithString(models, Qt::CaseInsensitive);
|
||||||
if (d > 0)
|
if (d > 0)
|
||||||
{
|
{
|
||||||
|
if (!allowExcludedModels) { updateModels.removeIfExcluded(); }
|
||||||
updateModels.resetOrder();
|
updateModels.resetOrder();
|
||||||
ui->tvp_OwnModelSet->updateContainerMaybeAsync(updateModels);
|
ui->tvp_OwnModelSet->updateContainerMaybeAsync(updateModels);
|
||||||
return CStatusMessage(this, CStatusMessage::SeverityInfo, "Modified " + QString::number(d) + " entries in model set " + this->getModelSetSimulator().toQString(true), true);
|
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()
|
void CDbOwnModelSetComponent::ps_viewModelChanged()
|
||||||
{
|
{
|
||||||
ui->pb_SaveAsSetForSimulator->setEnabled(true);
|
ui->pb_SaveAsSetForSimulator->setEnabled(true);
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
class QAction;
|
class QAction;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
namespace BlackMisc { namespace Simulation { class CAircraftModel; } }
|
|
||||||
namespace Ui { class CDbOwnModelSetComponent; }
|
namespace Ui { class CDbOwnModelSetComponent; }
|
||||||
|
namespace BlackMisc { namespace Simulation { class CAircraftModel; } }
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Menus { class CMenuActions; }
|
namespace Menus { class CMenuActions; }
|
||||||
@@ -122,6 +122,9 @@ namespace BlackGui
|
|||||||
//! Preferences changed
|
//! Preferences changed
|
||||||
void ps_distributorPreferencesChanged();
|
void ps_distributorPreferencesChanged();
|
||||||
|
|
||||||
|
//! Model settings changed
|
||||||
|
void ps_modelSettingsChanged();
|
||||||
|
|
||||||
//! Model (of view) has been changed
|
//! Model (of view) has been changed
|
||||||
void ps_viewModelChanged();
|
void ps_viewModelChanged();
|
||||||
|
|
||||||
@@ -144,7 +147,8 @@ namespace BlackGui
|
|||||||
QScopedPointer<Ui::CDbOwnModelSetComponent> ui;
|
QScopedPointer<Ui::CDbOwnModelSetComponent> ui;
|
||||||
QScopedPointer<CDbOwnModelSetDialog> m_modelSetDialog;
|
QScopedPointer<CDbOwnModelSetDialog> m_modelSetDialog;
|
||||||
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this };
|
BlackMisc::Simulation::CAircraftModelSetLoader m_modelSetLoader { this };
|
||||||
BlackMisc::CSetting<BlackMisc::Simulation::TDistributorListPreferences> m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged };
|
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::TDistributorListPreferences> m_distributorPreferences { this, &CDbOwnModelSetComponent::ps_distributorPreferencesChanged }; //!< distributor preferences
|
||||||
|
BlackMisc::CSettingReadOnly<BlackMisc::Simulation::TModel> m_modelSettings { this, &CDbOwnModelSetComponent::ps_modelSettingsChanged }; //!< settings for models
|
||||||
|
|
||||||
// -------------------------- custom menus -----------------------------------
|
// -------------------------- custom menus -----------------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user