Skip to content

Commit 68909a1

Browse files
committedSep 3, 2017
[needs-docs] Update tooltips for adding features/records
1 parent e30f704 commit 68909a1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11145,6 +11145,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1114511145
{
1114611146
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
1114711147
QgsVectorDataProvider *dprovider = vlayer->dataProvider();
11148+
QString addFeatureText;
1114811149

1114911150
bool isEditable = vlayer->isEditable();
1115011151
bool layerHasSelection = vlayer->selectedFeatureCount() > 0;
@@ -11248,6 +11249,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1124811249
if ( vlayer->geometryType() == QgsWkbTypes::PointGeometry )
1124911250
{
1125011251
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCapturePoint.svg" ) ) );
11252+
addFeatureText = tr( "Add Point Feature" );
1125111253
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeaturePoint.svg" ) ) );
1125211254
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopyPoint.svg" ) ) );
1125311255

@@ -11277,6 +11279,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1127711279
else if ( vlayer->geometryType() == QgsWkbTypes::LineGeometry )
1127811280
{
1127911281
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCaptureLine.svg" ) ) );
11282+
addFeatureText = tr( "Add Line Feature" );
1128011283
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureLine.svg" ) ) );
1128111284
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopyLine.svg" ) ) );
1128211285

@@ -11293,6 +11296,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1129311296
else if ( vlayer->geometryType() == QgsWkbTypes::PolygonGeometry )
1129411297
{
1129511298
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCapturePolygon.svg" ) ) );
11299+
addFeatureText = tr( "Add Polygon Feature" );
1129611300
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeature.svg" ) ) );
1129711301
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopy.svg" ) ) );
1129811302

@@ -11308,6 +11312,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1130811312
else if ( vlayer->geometryType() == QgsWkbTypes::NullGeometry )
1130911313
{
1131011314
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewTableRow.svg" ) ) );
11315+
addFeatureText = tr( "Add Record" );
1131111316
mActionAddRing->setEnabled( false );
1131211317
mActionFillRing->setEnabled( false );
1131311318
mActionReshapeFeatures->setEnabled( false );
@@ -11319,6 +11324,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1131911324
}
1132011325

1132111326
mActionOpenFieldCalc->setEnabled( true );
11327+
mActionAddFeature->setText( addFeatureText );
11328+
mActionAddFeature->setToolTip( addFeatureText );
11329+
QgsGui::shortcutsManager()->unregisterAction( mActionAddFeature );
11330+
QgsGui::shortcutsManager()->registerAction( mActionAddFeature, mActionAddFeature->shortcut() );
1132211331
}
1132311332
else
1132411333
{

0 commit comments

Comments
 (0)
Please sign in to comment.