Skip to content

Commit b9ff49f

Browse files
authored
Merge pull request #8253 from pblottiere/as_err_msg_rm_field
Add an error message when auxiliary field deletion failed
2 parents 225c922 + 444a279 commit b9ff49f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/app/qgsvectorlayerproperties.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,8 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
17751775
const QString msg = tr( "Are you sure you want to delete auxiliary field %1 for %2?" ).arg( item->text( 1 ), item->text( 0 ) );
17761776

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

17801781
if ( reply == QMessageBox::Yes )
17811782
{
@@ -1822,4 +1823,12 @@ void QgsVectorLayerProperties::deleteAuxiliaryField( int index )
18221823
updateAuxiliaryStoragePage( true );
18231824
mSourceFieldsPropertiesDialog->init();
18241825
}
1826+
else
1827+
{
1828+
const QString title = QObject::tr( "Delete Auxiliary Field" );
1829+
const int timeout = QgisApp::instance()->messageTimeout();
1830+
const QString errors = mLayer->auxiliaryLayer()->commitErrors().join( QStringLiteral( "\n " ) );
1831+
const QString msg = QObject::tr( "Unable to remove auxiliary field (%1)" ).arg( errors );
1832+
QgisApp::instance()->messageBar()->pushMessage( title, msg, Qgis::Warning, timeout );
1833+
}
18251834
}

0 commit comments

Comments
 (0)