Skip to content
Permalink
Browse files

Hide / show vector layer editing tool based on context of layer type …

…and editing status

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10394 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Mar 21, 2009
1 parent d0a7eca commit b3c54daacc616d01527034b03562cfa4d8a1f3f3
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/app/qgisapp.cpp
@@ -1554,10 +1554,13 @@ void QgisApp::createCanvas()
mMapTools.mMeasureArea->setAction( mActionMeasureArea );
mMapTools.mCapturePoint = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CapturePoint );
mMapTools.mCapturePoint->setAction( mActionCapturePoint );
mActionCapturePoint->setVisible( false );
mMapTools.mCaptureLine = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CaptureLine );
mMapTools.mCaptureLine->setAction( mActionCaptureLine );
mActionCaptureLine->setVisible( false );
mMapTools.mCapturePolygon = new QgsMapToolAddFeature( mMapCanvas, QgsMapToolCapture::CapturePolygon );
mMapTools.mCapturePolygon->setAction( mActionCapturePolygon );
mActionCapturePolygon->setVisible( false );
mMapTools.mMoveFeature = new QgsMapToolMoveFeature( mMapCanvas );
mMapTools.mMoveFeature->setAction( mActionMoveFeature );
mMapTools.mSplitFeatures = new QgsMapToolSplitFeatures( mMapCanvas );
@@ -5028,13 +5031,17 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
{
mActionCapturePoint->setEnabled( true );
mActionCapturePoint->setVisible( true );
}
else
{
mActionCapturePoint->setEnabled( false );
mActionCapturePoint->setVisible( false );
}
mActionCaptureLine->setEnabled( false );
mActionCapturePolygon->setEnabled( false );
mActionCaptureLine->setVisible( false );
mActionCapturePolygon->setVisible( false );
mActionAddVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
@@ -5056,15 +5063,19 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
{
mActionCaptureLine->setEnabled( true );
mActionCaptureLine->setVisible( true );
mActionSplitFeatures->setEnabled( true );
}
else
{
mActionCaptureLine->setEnabled( false );
mActionCaptureLine->setVisible( false );
mActionSplitFeatures->setEnabled( false );
}
mActionCapturePoint->setEnabled( false );
mActionCapturePolygon->setEnabled( false );
mActionCapturePoint->setVisible( false );
mActionCapturePolygon->setVisible( false );
mActionAddRing->setEnabled( false );
mActionAddIsland->setEnabled( false );
}
@@ -5073,19 +5084,23 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
{
mActionCapturePolygon->setEnabled( true );
mActionCapturePolygon->setVisible( true );
mActionAddRing->setEnabled( true );
mActionAddIsland->setEnabled( true );
mActionSplitFeatures->setEnabled( true );
}
else
{
mActionCapturePolygon->setEnabled( false );
mActionCapturePolygon->setVisible( false );
mActionAddRing->setEnabled( false );
mActionAddIsland->setEnabled( false );
mActionSplitFeatures->setEnabled( false );
}
mActionCapturePoint->setEnabled( false );
mActionCaptureLine->setEnabled( false );
mActionCapturePoint->setVisible( false );
mActionCaptureLine->setVisible( false );
}

//are add/delete/move vertex supported?

0 comments on commit b3c54da

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