Skip to content

Commit

Permalink
Merge pull request #8253 from pblottiere/as_err_msg_rm_field
Browse files Browse the repository at this point in the history
Add an error message when auxiliary field deletion failed
  • Loading branch information
pblottiere committed Oct 22, 2018
2 parents 225c922 + 444a279 commit b9ff49f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1775,7 +1775,8 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
const QString msg = tr( "Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );

QMessageBox::StandardButton reply;
reply = QMessageBox::question( this, "Delete Auxiliary Field", msg, QMessageBox::Yes | QMessageBox::No );
const QString title = QObject::tr( "Delete Auxiliary Field" );
reply = QMessageBox::question( this, title, msg, QMessageBox::Yes | QMessageBox::No );

if ( reply == QMessageBox::Yes )
{
Expand Down Expand Up @@ -1822,4 +1823,12 @@ void QgsVectorLayerProperties::deleteAuxiliaryField( int index )
updateAuxiliaryStoragePage( true );
mSourceFieldsPropertiesDialog->init();
}
else
{
const QString title = QObject::tr( "Delete Auxiliary Field" );
const int timeout = QgisApp::instance()->messageTimeout();
const QString errors = mLayer->auxiliaryLayer()->commitErrors().join( QStringLiteral( "\n " ) );
const QString msg = QObject::tr( "Unable to remove auxiliary field (%1)" ).arg( errors );
QgisApp::instance()->messageBar()->pushMessage( title, msg, Qgis::Warning, timeout );
}
}

0 comments on commit b9ff49f

Please sign in to comment.