@@ -11070,6 +11070,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11070
11070
{
11071
11071
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
11072
11072
QgsVectorDataProvider *dprovider = vlayer->dataProvider ();
11073
+ QString addFeatureText;
11073
11074
11074
11075
bool isEditable = vlayer->isEditable ();
11075
11076
bool layerHasSelection = vlayer->selectedFeatureCount () > 0 ;
@@ -11173,6 +11174,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11173
11174
if ( vlayer->geometryType () == QgsWkbTypes::PointGeometry )
11174
11175
{
11175
11176
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCapturePoint.svg" ) ) );
11177
+ addFeatureText = tr ( " Add Point Feature" );
11176
11178
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeaturePoint.svg" ) ) );
11177
11179
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopyPoint.svg" ) ) );
11178
11180
@@ -11202,6 +11204,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11202
11204
else if ( vlayer->geometryType () == QgsWkbTypes::LineGeometry )
11203
11205
{
11204
11206
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCaptureLine.svg" ) ) );
11207
+ addFeatureText = tr ( " Add Line Feature" );
11205
11208
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureLine.svg" ) ) );
11206
11209
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopyLine.svg" ) ) );
11207
11210
@@ -11218,6 +11221,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11218
11221
else if ( vlayer->geometryType () == QgsWkbTypes::PolygonGeometry )
11219
11222
{
11220
11223
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCapturePolygon.svg" ) ) );
11224
+ addFeatureText = tr ( " Add Polygon Feature" );
11221
11225
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeature.svg" ) ) );
11222
11226
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopy.svg" ) ) );
11223
11227
@@ -11233,6 +11237,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11233
11237
else if ( vlayer->geometryType () == QgsWkbTypes::NullGeometry )
11234
11238
{
11235
11239
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionNewTableRow.svg" ) ) );
11240
+ addFeatureText = tr ( " Add Record" );
11236
11241
mActionAddRing ->setEnabled ( false );
11237
11242
mActionFillRing ->setEnabled ( false );
11238
11243
mActionReshapeFeatures ->setEnabled ( false );
@@ -11244,6 +11249,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11244
11249
}
11245
11250
11246
11251
mActionOpenFieldCalc ->setEnabled ( true );
11252
+ mActionAddFeature ->setText ( addFeatureText );
11253
+ mActionAddFeature ->setToolTip ( addFeatureText );
11254
+ QgsGui::shortcutsManager ()->unregisterAction ( mActionAddFeature );
11255
+ QgsGui::shortcutsManager ()->registerAction ( mActionAddFeature , mActionAddFeature ->shortcut () );
11247
11256
}
11248
11257
else
11249
11258
{
0 commit comments