Skip to content

Commit 82c5709

Browse files
author
timlinux
committed
Hide / show vector layer editing tool based on context of layer type and editing status
git-svn-id: http://svn.osgeo.org/qgis/trunk@10394 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 014692f commit 82c5709

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/app/qgisapp.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,10 +1554,13 @@ void QgisApp::createCanvas()
15541554
mMapTools.mMeasureArea->setAction( mActionMeasureArea );
15551555
mMapTools.mCapturePoint = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CapturePoint );
15561556
mMapTools.mCapturePoint->setAction( mActionCapturePoint );
1557+
mActionCapturePoint->setVisible( false );
15571558
mMapTools.mCaptureLine = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CaptureLine );
15581559
mMapTools.mCaptureLine->setAction( mActionCaptureLine );
1560+
mActionCaptureLine->setVisible( false );
15591561
mMapTools.mCapturePolygon = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CapturePolygon );
15601562
mMapTools.mCapturePolygon->setAction( mActionCapturePolygon );
1563+
mActionCapturePolygon->setVisible( false );
15611564
mMapTools.mMoveFeature = new QgsMapToolMoveFeature( mMapCanvas );
15621565
mMapTools.mMoveFeature->setAction( mActionMoveFeature );
15631566
mMapTools.mSplitFeatures = new QgsMapToolSplitFeatures( mMapCanvas );
@@ -5028,13 +5031,17 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
50285031
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
50295032
{
50305033
mActionCapturePoint->setEnabled( true );
5034+
mActionCapturePoint->setVisible( true );
50315035
}
50325036
else
50335037
{
50345038
mActionCapturePoint->setEnabled( false );
5039+
mActionCapturePoint->setVisible( false );
50355040
}
50365041
mActionCaptureLine->setEnabled( false );
50375042
mActionCapturePolygon->setEnabled( false );
5043+
mActionCaptureLine->setVisible( false );
5044+
mActionCapturePolygon->setVisible( false );
50385045
mActionAddVertex->setEnabled( false );
50395046
mActionDeleteVertex->setEnabled( false );
50405047
mActionMoveVertex->setEnabled( false );
@@ -5056,15 +5063,19 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
50565063
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
50575064
{
50585065
mActionCaptureLine->setEnabled( true );
5066+
mActionCaptureLine->setVisible( true );
50595067
mActionSplitFeatures->setEnabled( true );
50605068
}
50615069
else
50625070
{
50635071
mActionCaptureLine->setEnabled( false );
5072+
mActionCaptureLine->setVisible( false );
50645073
mActionSplitFeatures->setEnabled( false );
50655074
}
50665075
mActionCapturePoint->setEnabled( false );
50675076
mActionCapturePolygon->setEnabled( false );
5077+
mActionCapturePoint->setVisible( false );
5078+
mActionCapturePolygon->setVisible( false );
50685079
mActionAddRing->setEnabled( false );
50695080
mActionAddIsland->setEnabled( false );
50705081
}
@@ -5073,19 +5084,23 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
50735084
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
50745085
{
50755086
mActionCapturePolygon->setEnabled( true );
5087+
mActionCapturePolygon->setVisible( true );
50765088
mActionAddRing->setEnabled( true );
50775089
mActionAddIsland->setEnabled( true );
50785090
mActionSplitFeatures->setEnabled( true );
50795091
}
50805092
else
50815093
{
50825094
mActionCapturePolygon->setEnabled( false );
5095+
mActionCapturePolygon->setVisible( false );
50835096
mActionAddRing->setEnabled( false );
50845097
mActionAddIsland->setEnabled( false );
50855098
mActionSplitFeatures->setEnabled( false );
50865099
}
50875100
mActionCapturePoint->setEnabled( false );
50885101
mActionCaptureLine->setEnabled( false );
5102+
mActionCapturePoint->setVisible( false );
5103+
mActionCaptureLine->setVisible( false );
50895104
}
50905105

50915106
//are add/delete/move vertex supported?

0 commit comments

Comments
 (0)