Skip to content
Permalink
Browse files
Close the dialog before opening error message box
  • Loading branch information
pblottiere committed Jun 7, 2021
1 parent 5729958 commit 65a50af5d4cf91877e4425a3956c1e0a999c0366
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/gui/qgsnewauxiliarylayerdialog.cpp
@@ -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;
}
}

0 comments on commit 65a50af

Please sign in to comment.