mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #745, do not consolidate with DB data when stashing editor model
(prevents that changed data are overridden by DB data again and hence reverted)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
04a9381858
commit
0d70e87d11
@@ -362,12 +362,14 @@ namespace BlackGui
|
||||
|
||||
void CDbMappingComponent::ps_stashCurrentModel()
|
||||
{
|
||||
const CAircraftModel model(getEditorAircraftModel());
|
||||
CStatusMessageList msgs(this->validateCurrentModel(true));
|
||||
if (!msgs.hasErrorMessages())
|
||||
{
|
||||
const CAircraftModel editorModel(getEditorAircraftModel());
|
||||
|
||||
// do not consolidate, because we want to keep data as they are from the editor
|
||||
msgs.push_back(
|
||||
ui->comp_StashAircraft->stashModel(model, true)
|
||||
ui->comp_StashAircraft->stashModel(editorModel, true, false)
|
||||
);
|
||||
}
|
||||
if (msgs.hasErrorMessages())
|
||||
|
||||
@@ -94,9 +94,9 @@ namespace BlackGui
|
||||
return CStatusMessage();
|
||||
}
|
||||
|
||||
CStatusMessage CDbStashComponent::stashModel(const CAircraftModel &model, bool replace)
|
||||
CStatusMessage CDbStashComponent::stashModel(const CAircraftModel &model, bool replace, bool consolidateWithDbData)
|
||||
{
|
||||
const CAircraftModel stashModel(this->consolidateModel(model));
|
||||
const CAircraftModel stashModel(consolidateWithDbData ? this->consolidateModel(model) : model);
|
||||
const CStatusMessage m(validateStashModel(stashModel, replace));
|
||||
if (!m.isWarningOrAbove())
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace BlackGui
|
||||
|
||||
public slots:
|
||||
//! Stash given model (includes validation and consolidation with DB data)
|
||||
BlackMisc::CStatusMessage stashModel(const BlackMisc::Simulation::CAircraftModel &model, bool replace = false);
|
||||
BlackMisc::CStatusMessage stashModel(const BlackMisc::Simulation::CAircraftModel &model, bool replace = false, bool consolidateWithDbData = true);
|
||||
|
||||
//! Stash given models (includes validation and consolidation with DB data)
|
||||
BlackMisc::CStatusMessageList stashModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace BlackGui
|
||||
ui->lai_Id->set(CIcons::appMappings16(), "Id:");
|
||||
connect(ui->pb_Stash, &QPushButton::clicked, this, &CModelMappingForm::requestStash);
|
||||
|
||||
// for setting mode (include/exclude)
|
||||
this->ps_userChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user