Skip to content

Commit 8ef28e3

Browse files
authoredSep 21, 2017
Merge pull request #5114 from gacarrillor/update_add_feature_tooltips
[needs-docs] Update tooltips for adding features/records
2 parents 54ea029 + 68909a1 commit 8ef28e3

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
@@ -11070,6 +11070,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1107011070
{
1107111071
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
1107211072
QgsVectorDataProvider *dprovider = vlayer->dataProvider();
11073+
QString addFeatureText;
1107311074

1107411075
bool isEditable = vlayer->isEditable();
1107511076
bool layerHasSelection = vlayer->selectedFeatureCount() > 0;
@@ -11173,6 +11174,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1117311174
if ( vlayer->geometryType() == QgsWkbTypes::PointGeometry )
1117411175
{
1117511176
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCapturePoint.svg" ) ) );
11177+
addFeatureText = tr( "Add Point Feature" );
1117611178
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeaturePoint.svg" ) ) );
1117711179
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopyPoint.svg" ) ) );
1117811180

@@ -11202,6 +11204,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1120211204
else if ( vlayer->geometryType() == QgsWkbTypes::LineGeometry )
1120311205
{
1120411206
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCaptureLine.svg" ) ) );
11207+
addFeatureText = tr( "Add Line Feature" );
1120511208
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureLine.svg" ) ) );
1120611209
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopyLine.svg" ) ) );
1120711210

@@ -11218,6 +11221,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1121811221
else if ( vlayer->geometryType() == QgsWkbTypes::PolygonGeometry )
1121911222
{
1122011223
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionCapturePolygon.svg" ) ) );
11224+
addFeatureText = tr( "Add Polygon Feature" );
1122111225
mActionMoveFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeature.svg" ) ) );
1122211226
mActionMoveFeatureCopy->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionMoveFeatureCopy.svg" ) ) );
1122311227

@@ -11233,6 +11237,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1123311237
else if ( vlayer->geometryType() == QgsWkbTypes::NullGeometry )
1123411238
{
1123511239
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mActionNewTableRow.svg" ) ) );
11240+
addFeatureText = tr( "Add Record" );
1123611241
mActionAddRing->setEnabled( false );
1123711242
mActionFillRing->setEnabled( false );
1123811243
mActionReshapeFeatures->setEnabled( false );
@@ -11244,6 +11249,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
1124411249
}
1124511250

1124611251
mActionOpenFieldCalc->setEnabled( true );
11252+
mActionAddFeature->setText( addFeatureText );
11253+
mActionAddFeature->setToolTip( addFeatureText );
11254+
QgsGui::shortcutsManager()->unregisterAction( mActionAddFeature );
11255+
QgsGui::shortcutsManager()->registerAction( mActionAddFeature, mActionAddFeature->shortcut() );
1124711256
}
1124811257
else
1124911258
{

0 commit comments

Comments
 (0)
Please sign in to comment.