@@ -11145,6 +11145,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11145
11145
{
11146
11146
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
11147
11147
QgsVectorDataProvider *dprovider = vlayer->dataProvider ();
11148
+ QString addFeatureText;
11148
11149
11149
11150
bool isEditable = vlayer->isEditable ();
11150
11151
bool layerHasSelection = vlayer->selectedFeatureCount () > 0 ;
@@ -11248,6 +11249,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11248
11249
if ( vlayer->geometryType () == QgsWkbTypes::PointGeometry )
11249
11250
{
11250
11251
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCapturePoint.svg" ) ) );
11252
+ addFeatureText = tr ( " Add Point Feature" );
11251
11253
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeaturePoint.svg" ) ) );
11252
11254
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopyPoint.svg" ) ) );
11253
11255
@@ -11277,6 +11279,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11277
11279
else if ( vlayer->geometryType () == QgsWkbTypes::LineGeometry )
11278
11280
{
11279
11281
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCaptureLine.svg" ) ) );
11282
+ addFeatureText = tr ( " Add Line Feature" );
11280
11283
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureLine.svg" ) ) );
11281
11284
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopyLine.svg" ) ) );
11282
11285
@@ -11293,6 +11296,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11293
11296
else if ( vlayer->geometryType () == QgsWkbTypes::PolygonGeometry )
11294
11297
{
11295
11298
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionCapturePolygon.svg" ) ) );
11299
+ addFeatureText = tr ( " Add Polygon Feature" );
11296
11300
mActionMoveFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeature.svg" ) ) );
11297
11301
mActionMoveFeatureCopy ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionMoveFeatureCopy.svg" ) ) );
11298
11302
@@ -11308,6 +11312,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11308
11312
else if ( vlayer->geometryType () == QgsWkbTypes::NullGeometry )
11309
11313
{
11310
11314
mActionAddFeature ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionNewTableRow.svg" ) ) );
11315
+ addFeatureText = tr ( " Add Record" );
11311
11316
mActionAddRing ->setEnabled ( false );
11312
11317
mActionFillRing ->setEnabled ( false );
11313
11318
mActionReshapeFeatures ->setEnabled ( false );
@@ -11319,6 +11324,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
11319
11324
}
11320
11325
11321
11326
mActionOpenFieldCalc ->setEnabled ( true );
11327
+ mActionAddFeature ->setText ( addFeatureText );
11328
+ mActionAddFeature ->setToolTip ( addFeatureText );
11329
+ QgsGui::shortcutsManager ()->unregisterAction ( mActionAddFeature );
11330
+ QgsGui::shortcutsManager ()->registerAction ( mActionAddFeature , mActionAddFeature ->shortcut () );
11322
11331
}
11323
11332
else
11324
11333
{
0 commit comments