mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
refs #526, changed to publishing multiple (instead of 1) models
This commit is contained in:
@@ -44,7 +44,6 @@ namespace BlackGui
|
||||
this->ui->tvp_OwnAircraftModels->addFilterDialog();
|
||||
|
||||
// connects
|
||||
connect(ui->editor_Model, &CModelMappingForm::requestPublish, this, &CDbMappingComponent::ps_publishSingleModelToDb);
|
||||
connect(ui->editor_Model, &CModelMappingForm::requestStash, this, &CDbMappingComponent::ps_stashCurrentModel);
|
||||
|
||||
connect(ui->tvp_OwnAircraftModels, &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
|
||||
@@ -244,7 +243,7 @@ namespace BlackGui
|
||||
return currentTabIndex() == TabStash;
|
||||
}
|
||||
|
||||
CStatusMessageList CDbMappingComponent::validate(bool withNestedForms) const
|
||||
CStatusMessageList CDbMappingComponent::validateCurrentModel(bool withNestedForms) const
|
||||
{
|
||||
CStatusMessageList msgs(this->ui->editor_Model->validate(!withNestedForms));
|
||||
if (withNestedForms)
|
||||
@@ -256,24 +255,6 @@ namespace BlackGui
|
||||
return msgs;
|
||||
}
|
||||
|
||||
void CDbMappingComponent::ps_publishSingleModelToDb()
|
||||
{
|
||||
CStatusMessageList msgs(validate(true));
|
||||
if (msgs.hasErrorMessages())
|
||||
{
|
||||
CLogMessage::preformatted(msgs);
|
||||
this->showMessages(msgs);
|
||||
return;
|
||||
}
|
||||
|
||||
const CAircraftModel model(getAircraftModel());
|
||||
msgs = this->asyncWriteModel(model);
|
||||
if (!msgs.isEmpty())
|
||||
{
|
||||
CLogMessage(this).preformatted(msgs);
|
||||
}
|
||||
}
|
||||
|
||||
void CDbMappingComponent::ps_handleStashDropRequest(const CAirlineIcaoCode &code) const
|
||||
{
|
||||
CLivery stdLivery(this->getStdLiveryForAirlineCode(code));
|
||||
@@ -284,13 +265,13 @@ namespace BlackGui
|
||||
void CDbMappingComponent::ps_stashCurrentModel()
|
||||
{
|
||||
const CAircraftModel model(getAircraftModel());
|
||||
if (!model.hasModelString())
|
||||
CStatusMessageList msgs(this->validateCurrentModel(true));
|
||||
if (msgs.hasErrorMessages())
|
||||
{
|
||||
CStatusMessage msg = CStatusMessage(CStatusMessage::SeverityError, "no model string, ignored");
|
||||
this->showMessage(msg);
|
||||
this->showMessages(msgs);
|
||||
return;
|
||||
}
|
||||
this->ui->comp_StashAircraft->stashModel(model);
|
||||
this->ui->comp_StashAircraft->stashModel(model, true);
|
||||
}
|
||||
|
||||
void CDbMappingComponent::resizeForSelect()
|
||||
|
||||
Reference in New Issue
Block a user