Skip to content

Commit

Permalink
[FEATURE] (well its an un-feature really but doc team may want to not…
Browse files Browse the repository at this point in the history
…e this. The add, move and delete vertex buttons are now removed and the node tool is moved from the advanced editing toolbar to the standard editing toolbar. The node tool replaces the functionality of the three removed items

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12072 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 10, 2009
1 parent 9604885 commit 169c168
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 39 deletions.
80 changes: 47 additions & 33 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,10 @@ QgisApp::~QgisApp()
delete mMapTools.mReshapeFeatures;
delete mMapTools.mSplitFeatures;
delete mMapTools.mSelect;
delete mMapTools.mVertexAdd;
delete mMapTools.mVertexMove;
delete mMapTools.mVertexDelete;
//these three tools to be deprecated - use node tool rather
//delete mMapTools.mVertexAdd;
//delete mMapTools.mVertexMove;
//delete mMapTools.mVertexDelete;
delete mMapTools.mAddRing;
delete mMapTools.mSimplifyFeature;
delete mMapTools.mDeleteRing;
Expand Down Expand Up @@ -693,6 +694,8 @@ void QgisApp::createActions()
connect( mActionDeleteSelected, SIGNAL( triggered() ), this, SLOT( deleteSelected() ) );
mActionDeleteSelected->setEnabled( false );

//these three tools to be deprecated - use node tool rather
/**
mActionAddVertex = new QAction( getThemeIcon( "mActionAddVertex.png" ), tr( "Add Vertex" ), this );
shortcuts->registerAction( mActionAddVertex );
mActionAddVertex->setStatusTip( tr( "Add Vertex" ) );
Expand All @@ -710,6 +713,7 @@ void QgisApp::createActions()
mActionDeleteVertex->setStatusTip( tr( "Delete Vertex" ) );
connect( mActionDeleteVertex, SIGNAL( triggered() ), this, SLOT( deleteVertex() ) );
mActionDeleteVertex->setEnabled( false );
*/

mActionAddRing = new QAction( getThemeIcon( "mActionAddRing.png" ), tr( "Add Ring" ), this );
shortcuts->registerAction( mActionAddRing );
Expand Down Expand Up @@ -1094,12 +1098,15 @@ void QgisApp::createActionGroups()
mActionSplitFeatures->setCheckable( true );
mMapToolGroup->addAction( mActionSplitFeatures );
mMapToolGroup->addAction( mActionDeleteSelected );
//these three tools are deprecated - use node tool rather
/**
mActionAddVertex->setCheckable( true );
mMapToolGroup->addAction( mActionAddVertex );
mActionDeleteVertex->setCheckable( true );
mMapToolGroup->addAction( mActionDeleteVertex );
mActionMoveVertex->setCheckable( true );
mMapToolGroup->addAction( mActionMoveVertex );
*/
mActionAddRing->setCheckable( true );
mMapToolGroup->addAction( mActionAddRing );
mActionAddIsland->setCheckable( true );
Expand Down Expand Up @@ -1195,9 +1202,10 @@ void QgisApp::createMenus()
mEditMenu->addAction( mActionCapturePolygon );
mEditMenu->addAction( mActionMoveFeature );
mEditMenu->addAction( mActionDeleteSelected );
mEditMenu->addAction( mActionAddVertex );
mEditMenu->addAction( mActionMoveVertex );
mEditMenu->addAction( mActionDeleteVertex );
//these three tools are deprecated - use node tool rather
//mEditMenu->addAction( mActionAddVertex );
//mEditMenu->addAction( mActionMoveVertex );
//mEditMenu->addAction( mActionDeleteVertex );

mActionEditSeparator2 = mEditMenu->addSeparator();

Expand Down Expand Up @@ -1397,9 +1405,11 @@ void QgisApp::createToolBars()
mDigitizeToolBar->addAction( mActionCaptureLine );
mDigitizeToolBar->addAction( mActionCapturePolygon );
mDigitizeToolBar->addAction( mActionMoveFeature );
mDigitizeToolBar->addAction( mActionMoveVertex );
mDigitizeToolBar->addAction( mActionAddVertex );
mDigitizeToolBar->addAction( mActionDeleteVertex );
mDigitizeToolBar->addAction( mActionNodeTool );
//these three tools are deprecated - use node tool rather
//mDigitizeToolBar->addAction( mActionMoveVertex );
//mDigitizeToolBar->addAction( mActionAddVertex );
//mDigitizeToolBar->addAction( mActionDeleteVertex );
mDigitizeToolBar->addAction( mActionDeleteSelected );
mDigitizeToolBar->addAction( mActionCutFeatures );
mDigitizeToolBar->addAction( mActionCopyFeatures );
Expand All @@ -1419,7 +1429,6 @@ void QgisApp::createToolBars()
mAdvancedDigitizeToolBar->addAction( mActionReshapeFeatures );
mAdvancedDigitizeToolBar->addAction( mActionSplitFeatures );
mAdvancedDigitizeToolBar->addAction( mActionMergeFeatures );
mAdvancedDigitizeToolBar->addAction( mActionNodeTool );
mAdvancedDigitizeToolBar->addAction( mActionRotatePointSymbols );
mToolbarMenu->addAction( mAdvancedDigitizeToolBar->toggleViewAction() );

Expand Down Expand Up @@ -1664,9 +1673,11 @@ void QgisApp::setTheme( QString theThemeName )
mActionReshapeFeatures->setIcon( getThemeIcon( "/mActionReshape.png" ) );
mActionSplitFeatures->setIcon( getThemeIcon( "/mActionSplitFeatures.png" ) );
mActionDeleteSelected->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) );
mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
//these three icons to be deprecated
//mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
//mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
//mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
mActionNodeTool->setIcon( getThemeIcon( "/mActionNodeTool.png" ) );
mActionSimplifyFeature->setIcon( getThemeIcon( "/mActionSimplify.png" ) );
mActionUndo->setIcon( getThemeIcon( "/mActionUndo.png" ) );
mActionRedo->setIcon( getThemeIcon( "/mActionRedo.png" ) );
Expand All @@ -1676,7 +1687,6 @@ void QgisApp::setTheme( QString theThemeName )
mActionDeletePart->setIcon( getThemeIcon( "/mActionDeletePart.png" ) );
mActionMergeFeatures->setIcon( getThemeIcon( "/mActionMergeFeatures.png" ) );
mActionRotatePointSymbols->setIcon( getThemeIcon( "mActionRotatePointSymbols.png" ) );
mActionNodeTool->setIcon( getThemeIcon( "/mActionNodeTool.png" ) );
mActionZoomIn->setIcon( getThemeIcon( "/mActionZoomIn.png" ) );
mActionZoomOut->setIcon( getThemeIcon( "/mActionZoomOut.png" ) );
mActionZoomFullExtent->setIcon( getThemeIcon( "/mActionZoomFullExtent.png" ) );
Expand Down Expand Up @@ -1798,12 +1808,13 @@ void QgisApp::createCanvas()
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
mMapTools.mSelect = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelect->setAction( mActionSelect );
mMapTools.mVertexAdd = new QgsMapToolAddVertex( mMapCanvas );
mMapTools.mVertexAdd->setAction( mActionAddVertex );
mMapTools.mVertexMove = new QgsMapToolMoveVertex( mMapCanvas );
mMapTools.mVertexMove->setAction( mActionMoveVertex );
mMapTools.mVertexDelete = new QgsMapToolDeleteVertex( mMapCanvas );
mMapTools.mVertexDelete->setAction( mActionDeleteVertex );
//these three tools to be deprecated - use node tool rather
//mMapTools.mVertexAdd = new QgsMapToolAddVertex( mMapCanvas );
//mMapTools.mVertexAdd->setAction( mActionAddVertex );
//mMapTools.mVertexMove = new QgsMapToolMoveVertex( mMapCanvas );
//mMapTools.mVertexMove->setAction( mActionMoveVertex );
//mMapTools.mVertexDelete = new QgsMapToolDeleteVertex( mMapCanvas );
//mMapTools.mVertexDelete->setAction( mActionDeleteVertex );
mMapTools.mAddRing = new QgsMapToolAddRing( mMapCanvas );
mMapTools.mAddRing->setAction( mActionAddRing );
mMapTools.mAddIsland = new QgsMapToolAddIsland( mMapCanvas );
Expand Down Expand Up @@ -5716,9 +5727,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionCapturePolygon->setEnabled( false );
mActionCaptureLine->setVisible( false );
mActionCapturePolygon->setVisible( false );
mActionAddVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
//these three tools to be deprecated - use node tool rather
//mActionAddVertex->setEnabled( false );
//mActionDeleteVertex->setEnabled( false );
//mActionMoveVertex->setEnabled( false );
mActionAddRing->setEnabled( false );
mActionAddIsland->setEnabled( false );
mActionReshapeFeatures->setEnabled( false );
Expand Down Expand Up @@ -5804,9 +5816,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
//are add/delete/move vertex supported?
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
{
mActionAddVertex->setEnabled( true );
mActionMoveVertex->setEnabled( true );
mActionDeleteVertex->setEnabled( true );
//these three tools to be deprecated - use node tool rather
//mActionAddVertex->setEnabled( true );
//mActionMoveVertex->setEnabled( true );
//mActionDeleteVertex->setEnabled( true );
if ( vlayer->geometryType() == QGis::Polygon )
{
mActionAddRing->setEnabled( true );
Expand All @@ -5817,9 +5830,9 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
}
else
{
mActionAddVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
//mActionAddVertex->setEnabled( false );
//mActionMoveVertex->setEnabled( false );
//mActionDeleteVertex->setEnabled( false );
}
return;
}
Expand All @@ -5839,15 +5852,16 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionDeleteSelected->setEnabled( false );
mActionAddRing->setEnabled( false );
mActionAddIsland->setEnabled( false );
mActionAddVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
//these three tools to be deprecated - use node tool rather
//mActionAddVertex->setEnabled( false );
//mActionDeleteVertex->setEnabled( false );
//mActionMoveVertex->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
mActionCutFeatures->setEnabled( false );
mActionPasteFeatures->setEnabled( false );
mActionRotatePointSymbols->setEnabled( false );
mActionNodeTool->setEnabled( false );
mActionDeletePart->setEnabled( false );

//NOTE: This check does not really add any protection, as it is called on load not on layer select/activate
Expand Down
7 changes: 4 additions & 3 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ class QgisApp : public QMainWindow
QAction *actionDeleteSelected() { return mActionDeleteSelected; }
QAction *actionMoveFeature() { return mActionMoveFeature; }
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
QAction *actionAddVertex() { return mActionAddVertex; }
QAction *actionDeleteVertex() { return mActionDeleteVertex; }
QAction *actionMoveVertex() { return mActionMoveVertex; }
//These three tools are deprecated - use node tool rather...
//QAction *actionAddVertex() { return mActionAddVertex; }
//QAction *actionDeleteVertex() { return mActionDeleteVertex; }
//QAction *actionMoveVertex() { return mActionMoveVertex; }
QAction *actionAddRing() { return mActionAddRing; }
QAction *actionAddIsland() { return mActionAddIsland; }
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
Expand Down
9 changes: 6 additions & 3 deletions src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ QAction *QgisAppInterface::actionCapturePolygon() { return qgis->actionCapturePo
QAction *QgisAppInterface::actionDeleteSelected() { return qgis->actionDeleteSelected(); }
QAction *QgisAppInterface::actionMoveFeature() { return qgis->actionMoveFeature(); }
QAction *QgisAppInterface::actionSplitFeatures() { return qgis->actionSplitFeatures(); }
QAction *QgisAppInterface::actionAddVertex() { return qgis->actionAddVertex(); }
QAction *QgisAppInterface::actionDeleteVertex() { return qgis->actionDeleteVertex(); }
QAction *QgisAppInterface::actionMoveVertex() { return qgis->actionMoveVertex(); }
//these three actions are removed from the ui as of qgis v1.4
//for plugin api completeness we now return a null pointer
//but these should be removed from the plugin interface for v2
QAction *QgisAppInterface::actionAddVertex() { return 0; }
QAction *QgisAppInterface::actionDeleteVertex() { return 0; }
QAction *QgisAppInterface::actionMoveVertex() { return 0; }
QAction *QgisAppInterface::actionAddRing() { return qgis->actionAddRing(); }
QAction *QgisAppInterface::actionAddIsland() { return qgis->actionAddIsland(); }
QAction *QgisAppInterface::actionEditSeparator2() { return qgis->actionEditSeparator2(); }
Expand Down

0 comments on commit 169c168

Please sign in to comment.