Skip to content
Permalink
Browse files

[needs-docs] Update tooltips for adding features/records

  • Loading branch information
gacarrillor committed Sep 3, 2017
1 parent e30f704 commit 68909a12b6e1662d5ff3ae5d24c4f11f8657db0e
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/app/qgisapp.cpp
@@ -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;
@@ -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" ) ) );

@@ -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" ) ) );

@@ -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" ) ) );

@@ -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 );
@@ -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
{

0 comments on commit 68909a1

Please sign in to comment.
You can’t perform that action at this time.