Skip to content

Commit

Permalink
Merge pull request #5114 from gacarrillor/update_add_feature_tooltips
Browse files Browse the repository at this point in the history
[needs-docs] Update tooltips for adding features/records
  • Loading branch information
m-kuhn committed Sep 21, 2017
2 parents 54ea029 + 68909a1 commit 8ef28e3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -11070,6 +11070,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer *layer )
{
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
QgsVectorDataProvider *dprovider = vlayer->dataProvider();
QString addFeatureText;

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

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

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

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

mActionOpenFieldCalc->setEnabled( true );
mActionAddFeature->setText( addFeatureText );
mActionAddFeature->setToolTip( addFeatureText );
QgsGui::shortcutsManager()->unregisterAction( mActionAddFeature );
QgsGui::shortcutsManager()->registerAction( mActionAddFeature, mActionAddFeature->shortcut() );
}
else
{
Expand Down

0 comments on commit 8ef28e3

Please sign in to comment.