Skip to content

Commit

Permalink
Close the dialog before opening error message box
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jun 7, 2021
1 parent 5729958 commit 65a50af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/qgsnewauxiliarylayerdialog.cpp
Expand Up @@ -46,17 +46,19 @@ void QgsNewAuxiliaryLayerDialog::accept()

if ( idx >= 0 )
{
QString errorMsg;
const QgsField field = mLayer->fields().field( idx );
QgsAuxiliaryLayer *alayer = QgsProject::instance()->auxiliaryStorage()->createAuxiliaryLayer( field, mLayer, &errorMsg );
QgsAuxiliaryLayer *alayer = QgsProject::instance()->auxiliaryStorage()->createAuxiliaryLayer( field, mLayer );

if ( alayer )
{
mLayer->setAuxiliaryLayer( alayer );
}
else
{
QMessageBox::critical( this, tr( "New Auxiliary Layer" ), errorMsg );
QDialog::close();
const QString errMsg = QgsProject::instance()->auxiliaryStorage()->errorString();
QMessageBox::critical( this, tr( "New Auxiliary Layer" ), errMsg );
return;
}
}

Expand Down

0 comments on commit 65a50af

Please sign in to comment.