Skip to content

Commit c9d0082

Browse files
author
jef
committed
fix #2358
git-svn-id: http://svn.osgeo.org/qgis/trunk@12745 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 31df49e commit c9d0082

File tree

2 files changed

+56
-49
lines changed

2 files changed

+56
-49
lines changed

src/app/qgisapp.cpp

+51-43
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
***************************************************************************/
1919
/* $Id$ */
2020

21-
2221
//
2322
// QT4 includes make sure to use the new <CamelCase> style!
2423
//
@@ -494,10 +493,13 @@ QgisApp::~QgisApp()
494493
delete mMapTools.mReshapeFeatures;
495494
delete mMapTools.mSplitFeatures;
496495
delete mMapTools.mSelect;
497-
//these three tools to be deprecated - use node tool rather
498-
//delete mMapTools.mVertexAdd;
499-
//delete mMapTools.mVertexMove;
500-
//delete mMapTools.mVertexDelete;
496+
497+
#if 0 //these three tools to be deprecated - use node tool rather
498+
delete mMapTools.mVertexAdd;
499+
delete mMapTools.mVertexMove;
500+
delete mMapTools.mVertexDelete;
501+
#endif
502+
501503
delete mMapTools.mAddRing;
502504
delete mMapTools.mSimplifyFeature;
503505
delete mMapTools.mDeleteRing;
@@ -711,8 +713,7 @@ void QgisApp::createActions()
711713
connect( mActionDeleteSelected, SIGNAL( triggered() ), this, SLOT( deleteSelected() ) );
712714
mActionDeleteSelected->setEnabled( false );
713715

714-
//these three tools to be deprecated - use node tool rather
715-
#if 0
716+
#if 0 //these three tools to be deprecated - use node tool rather
716717
mActionAddVertex = new QAction( getThemeIcon( "mActionAddVertex.png" ), tr( "Add Vertex" ), this );
717718
shortcuts->registerAction( mActionAddVertex );
718719
mActionAddVertex->setStatusTip( tr( "Add Vertex" ) );
@@ -1155,15 +1156,14 @@ void QgisApp::createActionGroups()
11551156
mActionSplitFeatures->setCheckable( true );
11561157
mMapToolGroup->addAction( mActionSplitFeatures );
11571158
mMapToolGroup->addAction( mActionDeleteSelected );
1158-
//these three tools are deprecated - use node tool rather
1159-
/**
1159+
#if 0 //these three tools are deprecated - use node tool rather
11601160
mActionAddVertex->setCheckable( true );
11611161
mMapToolGroup->addAction( mActionAddVertex );
11621162
mActionDeleteVertex->setCheckable( true );
11631163
mMapToolGroup->addAction( mActionDeleteVertex );
11641164
mActionMoveVertex->setCheckable( true );
11651165
mMapToolGroup->addAction( mActionMoveVertex );
1166-
*/
1166+
#endif
11671167
mActionAddRing->setCheckable( true );
11681168
mMapToolGroup->addAction( mActionAddRing );
11691169
mActionAddIsland->setCheckable( true );
@@ -1260,10 +1260,11 @@ void QgisApp::createMenus()
12601260
mEditMenu->addAction( mActionCapturePolygon );
12611261
mEditMenu->addAction( mActionMoveFeature );
12621262
mEditMenu->addAction( mActionDeleteSelected );
1263-
//these three tools are deprecated - use node tool rather
1264-
//mEditMenu->addAction( mActionAddVertex );
1265-
//mEditMenu->addAction( mActionMoveVertex );
1266-
//mEditMenu->addAction( mActionDeleteVertex );
1263+
#if 0 //these three tools are deprecated - use node tool rather
1264+
mEditMenu->addAction( mActionAddVertex );
1265+
mEditMenu->addAction( mActionMoveVertex );
1266+
mEditMenu->addAction( mActionDeleteVertex );
1267+
#endif
12671268

12681269
mActionEditSeparator2 = mEditMenu->addSeparator();
12691270

@@ -1473,10 +1474,11 @@ void QgisApp::createToolBars()
14731474
mDigitizeToolBar->addAction( mActionCapturePolygon );
14741475
mDigitizeToolBar->addAction( mActionMoveFeature );
14751476
mDigitizeToolBar->addAction( mActionNodeTool );
1476-
//these three tools are deprecated - use node tool rather
1477-
//mDigitizeToolBar->addAction( mActionMoveVertex );
1478-
//mDigitizeToolBar->addAction( mActionAddVertex );
1479-
//mDigitizeToolBar->addAction( mActionDeleteVertex );
1477+
#if 0 //these three tools are deprecated - use node tool rather
1478+
mDigitizeToolBar->addAction( mActionMoveVertex );
1479+
mDigitizeToolBar->addAction( mActionAddVertex );
1480+
mDigitizeToolBar->addAction( mActionDeleteVertex );
1481+
#endif
14801482
mDigitizeToolBar->addAction( mActionDeleteSelected );
14811483
mDigitizeToolBar->addAction( mActionCutFeatures );
14821484
mDigitizeToolBar->addAction( mActionCopyFeatures );
@@ -1743,10 +1745,11 @@ void QgisApp::setTheme( QString theThemeName )
17431745
mActionReshapeFeatures->setIcon( getThemeIcon( "/mActionReshape.png" ) );
17441746
mActionSplitFeatures->setIcon( getThemeIcon( "/mActionSplitFeatures.png" ) );
17451747
mActionDeleteSelected->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) );
1746-
//these three icons to be deprecated
1747-
//mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
1748-
//mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
1749-
//mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
1748+
#if 0 //these three icons to be deprecated
1749+
mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
1750+
mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
1751+
mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
1752+
#endif
17501753
mActionNodeTool->setIcon( getThemeIcon( "/mActionNodeTool.png" ) );
17511754
mActionSimplifyFeature->setIcon( getThemeIcon( "/mActionSimplify.png" ) );
17521755
mActionUndo->setIcon( getThemeIcon( "/mActionUndo.png" ) );
@@ -1892,13 +1895,14 @@ void QgisApp::createCanvas()
18921895
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
18931896
mMapTools.mSelect = new QgsMapToolSelect( mMapCanvas );
18941897
mMapTools.mSelect->setAction( mActionSelect );
1895-
//these three tools to be deprecated - use node tool rather
1896-
//mMapTools.mVertexAdd = new QgsMapToolAddVertex( mMapCanvas );
1897-
//mMapTools.mVertexAdd->setAction( mActionAddVertex );
1898-
//mMapTools.mVertexMove = new QgsMapToolMoveVertex( mMapCanvas );
1899-
//mMapTools.mVertexMove->setAction( mActionMoveVertex );
1900-
//mMapTools.mVertexDelete = new QgsMapToolDeleteVertex( mMapCanvas );
1901-
//mMapTools.mVertexDelete->setAction( mActionDeleteVertex );
1898+
#if 0 //these three tools to be deprecated - use node tool rather
1899+
mMapTools.mVertexAdd = new QgsMapToolAddVertex( mMapCanvas );
1900+
mMapTools.mVertexAdd->setAction( mActionAddVertex );
1901+
mMapTools.mVertexMove = new QgsMapToolMoveVertex( mMapCanvas );
1902+
mMapTools.mVertexMove->setAction( mActionMoveVertex );
1903+
mMapTools.mVertexDelete = new QgsMapToolDeleteVertex( mMapCanvas );
1904+
mMapTools.mVertexDelete->setAction( mActionDeleteVertex );
1905+
#endif
19021906
mMapTools.mAddRing = new QgsMapToolAddRing( mMapCanvas );
19031907
mMapTools.mAddRing->setAction( mActionAddRing );
19041908
mMapTools.mAddIsland = new QgsMapToolAddIsland( mMapCanvas );
@@ -4411,9 +4415,9 @@ void QgisApp::removeAllLayers()
44114415
QgsProject::instance()->dirty( true );
44124416
} //remove all layers
44134417

4414-
#ifdef HAVE_QWT
44154418
void QgisApp::showGpsTool()
44164419
{
4420+
#ifdef HAVE_QWT
44174421
if ( !mpGpsWidget )
44184422
{
44194423
mpGpsWidget = new QgsGPSInformationWidget( mMapCanvas );
@@ -4432,8 +4436,8 @@ void QgisApp::showGpsTool()
44324436
{
44334437
mpGpsDock->toggleViewAction();
44344438
}
4435-
}
44364439
#endif
4440+
}
44374441

44384442
void QgisApp::zoomToLayerExtent()
44394443
{
@@ -5364,7 +5368,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
53645368
mActionCapturePolygon->setEnabled( false );
53655369
mActionCaptureLine->setVisible( false );
53665370
mActionCapturePolygon->setVisible( false );
5367-
#if 0 //these three tools to be deprecated - use node tool rather
5371+
#if 0 //these three tools to be deprecated - use node tool rather
53685372
mActionAddVertex->setEnabled( false );
53695373
mActionDeleteVertex->setEnabled( false );
53705374
mActionMoveVertex->setEnabled( false );
@@ -5457,10 +5461,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
54575461
//are add/delete/move vertex supported?
54585462
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
54595463
{
5460-
//these three tools to be deprecated - use node tool rather
5461-
//mActionAddVertex->setEnabled( true );
5462-
//mActionMoveVertex->setEnabled( true );
5463-
//mActionDeleteVertex->setEnabled( true );
5464+
#if 0 // these three tools to be deprecated - use node tool rather
5465+
mActionAddVertex->setEnabled( true );
5466+
mActionMoveVertex->setEnabled( true );
5467+
mActionDeleteVertex->setEnabled( true );
5468+
#endif
54645469
if ( vlayer->geometryType() == QGis::Polygon )
54655470
{
54665471
mActionAddRing->setEnabled( true );
@@ -5471,9 +5476,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
54715476
}
54725477
else
54735478
{
5474-
//mActionAddVertex->setEnabled( false );
5475-
//mActionMoveVertex->setEnabled( false );
5476-
//mActionDeleteVertex->setEnabled( false );
5479+
#if 0
5480+
mActionAddVertex->setEnabled( false );
5481+
mActionMoveVertex->setEnabled( false );
5482+
mActionDeleteVertex->setEnabled( false );
5483+
#endif
54775484
}
54785485
return;
54795486
}
@@ -5493,10 +5500,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
54935500
mActionDeleteSelected->setEnabled( false );
54945501
mActionAddRing->setEnabled( false );
54955502
mActionAddIsland->setEnabled( false );
5496-
//these three tools to be deprecated - use node tool rather
5497-
//mActionAddVertex->setEnabled( false );
5498-
//mActionDeleteVertex->setEnabled( false );
5499-
//mActionMoveVertex->setEnabled( false );
5503+
#if 0 //these three tools to be deprecated - use node tool rather
5504+
mActionAddVertex->setEnabled( false );
5505+
mActionDeleteVertex->setEnabled( false );
5506+
mActionMoveVertex->setEnabled( false );
5507+
#endif
55005508
mActionNodeTool->setEnabled( false );
55015509
mActionMoveFeature->setEnabled( false );
55025510
mActionCopyFeatures->setEnabled( false );

src/app/qgisapp.h

+5-6
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,11 @@ class QgisApp : public QMainWindow
231231
QAction *actionDeleteSelected() { return mActionDeleteSelected; }
232232
QAction *actionMoveFeature() { return mActionMoveFeature; }
233233
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
234-
//These three tools are deprecated - use node tool rather...
235-
//QAction *actionAddVertex() { return mActionAddVertex; }
236-
//QAction *actionDeleteVertex() { return mActionDeleteVertex; }
237-
//QAction *actionMoveVertex() { return mActionMoveVertex; }
234+
#if 0 //These three tools are deprecated - use node tool rather...
235+
QAction *actionAddVertex() { return mActionAddVertex; }
236+
QAction *actionDeleteVertex() { return mActionDeleteVertex; }
237+
QAction *actionMoveVertex() { return mActionMoveVertex; }
238+
#endif
238239
QAction *actionAddRing() { return mActionAddRing; }
239240
QAction *actionAddIsland() { return mActionAddIsland; }
240241
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
@@ -431,10 +432,8 @@ class QgisApp : public QMainWindow
431432
void userCenter();
432433
//! Remove a layer from the map and legend
433434
void removeLayer();
434-
#ifdef HAVE_QWT
435435
//! Show GPS tool
436436
void showGpsTool();
437-
#endif
438437
//! zoom to extent of layer
439438
void zoomToLayerExtent();
440439
//! zoom to actual size of raster layer

0 commit comments

Comments
 (0)