Skip to content

Commit

Permalink
feedback messages
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed May 12, 2020
1 parent 9cb3c74 commit fc6829c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsvectorlayerutils.sip.in
Expand Up @@ -297,7 +297,7 @@ The following operations will be performed to convert the input features:
.. versionadded:: 3.12
%End

static bool impactsCascadeFeatures( const QgsVectorLayer *layer, const QgsFeatureIds &fids, const QgsProject *project, QgsDuplicateFeatureContext &context );
static bool impactsCascadeFeatures( const QgsVectorLayer *layer, const QgsFeatureIds &fids, const QgsProject *project, QgsDuplicateFeatureContext &context /Out/ );
%Docstring

:return: true if at least one feature of the ``fids`` on ``layer`` is connected as parent in at
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -9040,7 +9040,7 @@ void QgisApp::deleteSelected( QgsMapLayer *layer, QWidget *parent, bool checkFea
QString feedbackMessage;
for ( QgsVectorLayer *contextLayer : contextLayers )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
feedbackMessage += tr( "%1 on layer %2. " ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
deletedCount += context.handledFeatures( contextLayer ).size();
}
visibleMessageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -896,7 +896,7 @@ void QgsAttributeTableDialog::deleteFeature( const QgsFeatureId fid )
QString feedbackMessage;
for ( QgsVectorLayer *contextLayer : contextLayers )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
feedbackMessage += tr( "%1 on layer %2. " ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
deletedCount += context.handledFeatures( contextLayer ).size();
}
QgisApp::instance()->messageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayerutils.h
Expand Up @@ -327,7 +327,7 @@ class CORE_EXPORT QgsVectorLayerUtils
*
* \since QGIS 3.14
*/
static bool impactsCascadeFeatures( const QgsVectorLayer *layer, const QgsFeatureIds &fids, const QgsProject *project, QgsDuplicateFeatureContext &context );
static bool impactsCascadeFeatures( const QgsVectorLayer *layer, const QgsFeatureIds &fids, const QgsProject *project, QgsDuplicateFeatureContext &context SIP_OUT );

};

Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsrelationeditorwidget.cpp
Expand Up @@ -741,7 +741,7 @@ void QgsRelationEditorWidget::deleteFeatures( const QgsFeatureIds &featureids )
}

// for extra safety to make sure we know that the delete can have impact on children and joins
int res = QMessageBox::question( this, tr( "Delete at least %3 feature(s) on other layer(s)" ).arg( childrenCount ),
int res = QMessageBox::question( this, tr( "Delete at least %1 feature(s) on other layer(s)" ).arg( childrenCount ),
tr( "Delete %1 feature(s) on layer \"%2\" and %3as well.\nAnd all the further descendants of them.\nDelete these features?" ).arg( featureids.count() ).arg( layer->name() ).arg( childrenInfo ),
QMessageBox::Yes | QMessageBox::No );
if ( res != QMessageBox::Yes )
Expand All @@ -759,10 +759,10 @@ void QgsRelationEditorWidget::deleteFeatures( const QgsFeatureIds &featureids )
QString feedbackMessage;
for ( QgsVectorLayer *contextLayer : contextLayers )
{
feedbackMessage += tr( " %1 on layer %2." ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
feedbackMessage += tr( "%1 on layer %2. " ).arg( context.handledFeatures( contextLayer ).size() ).arg( contextLayer->name() );
deletedCount += context.handledFeatures( contextLayer ).size();
}
mEditorContext.mainMessageBar()->pushMessage( tr( "%1 features deleted:%2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
mEditorContext.mainMessageBar()->pushMessage( tr( "%1 features deleted: %2" ).arg( deletedCount ).arg( feedbackMessage ), Qgis::Success );
}

updateUi();
Expand Down

0 comments on commit fc6829c

Please sign in to comment.