[QGIS Commit] r10394 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Mar 21 18:52:07 EDT 2009
Author: timlinux
Date: 2009-03-21 18:52:06 -0400 (Sat, 21 Mar 2009)
New Revision: 10394
Modified:
trunk/qgis/src/app/qgisapp.cpp
Log:
Hide / show vector layer editing tool based on context of layer type and editing status
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2009-03-21 22:04:51 UTC (rev 10393)
+++ trunk/qgis/src/app/qgisapp.cpp 2009-03-21 22:52:06 UTC (rev 10394)
@@ -1554,10 +1554,13 @@
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 @@
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 @@
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,6 +5084,7 @@
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
{
mActionCapturePolygon->setEnabled( true );
+ mActionCapturePolygon->setVisible( true );
mActionAddRing->setEnabled( true );
mActionAddIsland->setEnabled( true );
mActionSplitFeatures->setEnabled( true );
@@ -5080,12 +5092,15 @@
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?
More information about the QGIS-commit
mailing list