mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
Show warning before deleting features
git-svn-id: http://svn.osgeo.org/qgis/trunk@10165 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
537a9fafc5
commit
96182a0440
@ -3749,6 +3749,14 @@ void QgisApp::deleteSelected()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//display a warning
|
||||||
|
int numberOfDeletedFeatures = vlayer->selectedFeaturesIds().size();
|
||||||
|
if(QMessageBox::warning(this, tr("Delete features"), tr("Delete %1 feature(s)?").arg(numberOfDeletedFeatures), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( !vlayer->deleteSelectedFeatures() )
|
if ( !vlayer->deleteSelectedFeatures() )
|
||||||
{
|
{
|
||||||
QMessageBox::information( this, tr( "Problem deleting features" ),
|
QMessageBox::information( this, tr( "Problem deleting features" ),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user