Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
print question instead of warning on delete a feature when detected c…
…omposition relations and cascade joins
  • Loading branch information
signedav committed May 8, 2020
1 parent 0b64a83 commit de6aed6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -9004,9 +9004,9 @@ void QgisApp::deleteSelected( QgsMapLayer *layer, QWidget *parent, bool checkFea
if ( QgsVectorLayerUtils::impactsCascadeFeatures( vlayer, QgsProject::instance() ) )
{
// for extra safety to make sure we know that the delete can have impact on children and joins
int res = QMessageBox::warning( mMapCanvas, tr( "Possible impact on descendants of layer \"%1\"" ).arg( vlayer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
int res = QMessageBox::question( mMapCanvas, tr( "Possible impact on descendants of layer \"%1\"" ).arg( vlayer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
if ( res != QMessageBox::Yes )
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -867,9 +867,9 @@ void QgsAttributeTableDialog::deleteFeature( const QgsFeatureId fid )
if ( QgsVectorLayerUtils::impactsCascadeFeatures( mLayer, QgsProject::instance() ) )
{
// for extra safety to make sure we know that the delete can have impact on children and joins
int res = QMessageBox::warning( this, tr( "Possible impact on descendants of layer \"%1\"" ).arg( mLayer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
int res = QMessageBox::question( this, tr( "Possible impact on descendants of layer \"%1\"" ).arg( mLayer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
if ( res != QMessageBox::Yes )
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsrelationeditorwidget.cpp
Expand Up @@ -731,9 +731,9 @@ void QgsRelationEditorWidget::deleteFeatures( const QgsFeatureIds &featureids )
if ( QgsVectorLayerUtils::impactsCascadeFeatures( layer, QgsProject::instance() ) )
{
// for extra safety to make sure we know that the delete can have impact on children and joins
int res = QMessageBox::warning( this, tr( "Possible impact on descendants of layer \"%1\"" ).arg( layer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
int res = QMessageBox::question( this, tr( "Possible impact on descendants of layer \"%1\"" ).arg( layer->name() ),
tr( "A delete on this layer could have an impact on referencing or joined layers and their descendants. Would you still like to continue?" ),
QMessageBox::Yes | QMessageBox::No );
if ( res == QMessageBox::No )
deleteFeatures = false;
}
Expand Down

0 comments on commit de6aed6

Please sign in to comment.