diff --git a/src/blackgui/components/dbmappingcomponent.cpp b/src/blackgui/components/dbmappingcomponent.cpp index 01356b411..86d72f0b3 100644 --- a/src/blackgui/components/dbmappingcomponent.cpp +++ b/src/blackgui/components/dbmappingcomponent.cpp @@ -352,10 +352,17 @@ namespace BlackGui CStatusMessageList CDbMappingComponent::validateCurrentModel(bool withNestedForms) const { - CStatusMessageList msgs(ui->editor_ModelMapping->validate(!withNestedForms)); + CStatusMessageList msgs; if (withNestedForms) { - msgs.push_back(ui->editor_AircraftModel->validate(withNestedForms)); + // tests the 3 subforms and the model itself lenient + msgs.push_back(ui->editor_ModelMapping->validate(false)); + msgs.push_back(ui->editor_AircraftModel->validate(true)); + } + else + { + // model lenient + msgs.push_back(ui->editor_ModelMapping->validate(false)); } return msgs; } @@ -369,14 +376,16 @@ namespace BlackGui void CDbMappingComponent::ps_stashCurrentModel() { - CStatusMessageList msgs(this->validateCurrentModel(true)); + const bool nested = this->isStashTab(); // on stash tab, full validation, otherwise not + CStatusMessageList msgs(this->validateCurrentModel(nested)); if (!msgs.hasErrorMessages()) { const CAircraftModel editorModel(getEditorAircraftModel()); - // do not consolidate, because we want to keep data as they are from the editor + // from stash, do not consolidate, because we want to keep data as they are from the editor + const bool consolidate = !this->isStashTab(); msgs.push_back( - ui->comp_StashAircraft->stashModel(editorModel, true, false) + ui->comp_StashAircraft->stashModel(editorModel, true, consolidate) ); } if (msgs.hasErrorMessages()) diff --git a/src/blackgui/editors/modelmappingform.cpp b/src/blackgui/editors/modelmappingform.cpp index 888cec5ae..d638bd040 100644 --- a/src/blackgui/editors/modelmappingform.cpp +++ b/src/blackgui/editors/modelmappingform.cpp @@ -57,7 +57,7 @@ namespace BlackGui CStatusMessageList CModelMappingForm::validate(bool withNestedObjects) const { - CAircraftModel model(getValue()); + const CAircraftModel model(getValue()); CStatusMessageList msgs(model.validate(withNestedObjects)); ui->val_Indicator->setState(msgs); return msgs;