Skip to content

Commit

Permalink
[needs-docs] Update tooltips for adding features/records
Browse files Browse the repository at this point in the history
  • Loading branch information
gacarrillor committed Sep 3, 2017
1 parent e30f704 commit 68909a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11145,6 +11145,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 @@ -11248,6 +11249,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 @@ -11277,6 +11279,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 @@ -11293,6 +11296,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 @@ -11308,6 +11312,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 @@ -11319,6 +11324,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 68909a1

Please sign in to comment.