Skip to content
Permalink
Browse files

Merge pull request #8253 from pblottiere/as_err_msg_rm_field

Add an error message when auxiliary field deletion failed
  • Loading branch information
pblottiere committed Oct 22, 2018
2 parents 225c922 + 444a279 commit b9ff49f2c95ce30e60302676bad5be5c6d6630e9
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/app/qgsvectorlayerproperties.cpp
@@ -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 )
{
@@ -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.
You can’t perform that action at this time.