Skip to content

Commit

Permalink
fix #2358
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12745 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 12, 2010
1 parent 31df49e commit c9d0082
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 49 deletions.
94 changes: 51 additions & 43 deletions src/app/qgisapp.cpp
Expand Up @@ -18,7 +18,6 @@
***************************************************************************/
/* $Id$ */


//
// QT4 includes make sure to use the new <CamelCase> style!
//
Expand Down Expand Up @@ -494,10 +493,13 @@ QgisApp::~QgisApp()
delete mMapTools.mReshapeFeatures;
delete mMapTools.mSplitFeatures;
delete mMapTools.mSelect;
//these three tools to be deprecated - use node tool rather
//delete mMapTools.mVertexAdd;
//delete mMapTools.mVertexMove;
//delete mMapTools.mVertexDelete;

#if 0 //these three tools to be deprecated - use node tool rather
delete mMapTools.mVertexAdd;
delete mMapTools.mVertexMove;
delete mMapTools.mVertexDelete;
#endif

delete mMapTools.mAddRing;
delete mMapTools.mSimplifyFeature;
delete mMapTools.mDeleteRing;
Expand Down Expand Up @@ -711,8 +713,7 @@ void QgisApp::createActions()
connect( mActionDeleteSelected, SIGNAL( triggered() ), this, SLOT( deleteSelected() ) );
mActionDeleteSelected->setEnabled( false );

//these three tools to be deprecated - use node tool rather
#if 0
#if 0 //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 Down Expand Up @@ -1155,15 +1156,14 @@ void QgisApp::createActionGroups()
mActionSplitFeatures->setCheckable( true );
mMapToolGroup->addAction( mActionSplitFeatures );
mMapToolGroup->addAction( mActionDeleteSelected );
//these three tools are deprecated - use node tool rather
/**
#if 0 //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 );
*/
#endif
mActionAddRing->setCheckable( true );
mMapToolGroup->addAction( mActionAddRing );
mActionAddIsland->setCheckable( true );
Expand Down Expand Up @@ -1260,10 +1260,11 @@ void QgisApp::createMenus()
mEditMenu->addAction( mActionCapturePolygon );
mEditMenu->addAction( mActionMoveFeature );
mEditMenu->addAction( mActionDeleteSelected );
//these three tools are deprecated - use node tool rather
//mEditMenu->addAction( mActionAddVertex );
//mEditMenu->addAction( mActionMoveVertex );
//mEditMenu->addAction( mActionDeleteVertex );
#if 0 //these three tools are deprecated - use node tool rather
mEditMenu->addAction( mActionAddVertex );
mEditMenu->addAction( mActionMoveVertex );
mEditMenu->addAction( mActionDeleteVertex );
#endif

mActionEditSeparator2 = mEditMenu->addSeparator();

Expand Down Expand Up @@ -1473,10 +1474,11 @@ void QgisApp::createToolBars()
mDigitizeToolBar->addAction( mActionCapturePolygon );
mDigitizeToolBar->addAction( mActionMoveFeature );
mDigitizeToolBar->addAction( mActionNodeTool );
//these three tools are deprecated - use node tool rather
//mDigitizeToolBar->addAction( mActionMoveVertex );
//mDigitizeToolBar->addAction( mActionAddVertex );
//mDigitizeToolBar->addAction( mActionDeleteVertex );
#if 0 //these three tools are deprecated - use node tool rather
mDigitizeToolBar->addAction( mActionMoveVertex );
mDigitizeToolBar->addAction( mActionAddVertex );
mDigitizeToolBar->addAction( mActionDeleteVertex );
#endif
mDigitizeToolBar->addAction( mActionDeleteSelected );
mDigitizeToolBar->addAction( mActionCutFeatures );
mDigitizeToolBar->addAction( mActionCopyFeatures );
Expand Down Expand Up @@ -1743,10 +1745,11 @@ void QgisApp::setTheme( QString theThemeName )
mActionReshapeFeatures->setIcon( getThemeIcon( "/mActionReshape.png" ) );
mActionSplitFeatures->setIcon( getThemeIcon( "/mActionSplitFeatures.png" ) );
mActionDeleteSelected->setIcon( getThemeIcon( "/mActionDeleteSelected.png" ) );
//these three icons to be deprecated
//mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
//mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
//mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
#if 0 //these three icons to be deprecated
mActionAddVertex->setIcon( getThemeIcon( "/mActionAddVertex.png" ) );
mActionMoveVertex->setIcon( getThemeIcon( "/mActionMoveVertex.png" ) );
mActionDeleteVertex->setIcon( getThemeIcon( "/mActionDeleteVertex.png" ) );
#endif
mActionNodeTool->setIcon( getThemeIcon( "/mActionNodeTool.png" ) );
mActionSimplifyFeature->setIcon( getThemeIcon( "/mActionSimplify.png" ) );
mActionUndo->setIcon( getThemeIcon( "/mActionUndo.png" ) );
Expand Down Expand Up @@ -1892,13 +1895,14 @@ void QgisApp::createCanvas()
mMapTools.mSplitFeatures->setAction( mActionSplitFeatures );
mMapTools.mSelect = new QgsMapToolSelect( mMapCanvas );
mMapTools.mSelect->setAction( mActionSelect );
//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 );
#if 0 //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 );
#endif
mMapTools.mAddRing = new QgsMapToolAddRing( mMapCanvas );
mMapTools.mAddRing->setAction( mActionAddRing );
mMapTools.mAddIsland = new QgsMapToolAddIsland( mMapCanvas );
Expand Down Expand Up @@ -4411,9 +4415,9 @@ void QgisApp::removeAllLayers()
QgsProject::instance()->dirty( true );
} //remove all layers

#ifdef HAVE_QWT
void QgisApp::showGpsTool()
{
#ifdef HAVE_QWT
if ( !mpGpsWidget )
{
mpGpsWidget = new QgsGPSInformationWidget( mMapCanvas );
Expand All @@ -4432,8 +4436,8 @@ void QgisApp::showGpsTool()
{
mpGpsDock->toggleViewAction();
}
}
#endif
}

void QgisApp::zoomToLayerExtent()
{
Expand Down Expand Up @@ -5364,7 +5368,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionCapturePolygon->setEnabled( false );
mActionCaptureLine->setVisible( false );
mActionCapturePolygon->setVisible( false );
#if 0 //these three tools to be deprecated - use node tool rather
#if 0 //these three tools to be deprecated - use node tool rather
mActionAddVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
Expand Down Expand Up @@ -5457,10 +5461,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
//are add/delete/move vertex supported?
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
{
//these three tools to be deprecated - use node tool rather
//mActionAddVertex->setEnabled( true );
//mActionMoveVertex->setEnabled( true );
//mActionDeleteVertex->setEnabled( true );
#if 0 // these three tools to be deprecated - use node tool rather
mActionAddVertex->setEnabled( true );
mActionMoveVertex->setEnabled( true );
mActionDeleteVertex->setEnabled( true );
#endif
if ( vlayer->geometryType() == QGis::Polygon )
{
mActionAddRing->setEnabled( true );
Expand All @@ -5471,9 +5476,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
}
else
{
//mActionAddVertex->setEnabled( false );
//mActionMoveVertex->setEnabled( false );
//mActionDeleteVertex->setEnabled( false );
#if 0
mActionAddVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
#endif
}
return;
}
Expand All @@ -5493,10 +5500,11 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionDeleteSelected->setEnabled( false );
mActionAddRing->setEnabled( false );
mActionAddIsland->setEnabled( false );
//these three tools to be deprecated - use node tool rather
//mActionAddVertex->setEnabled( false );
//mActionDeleteVertex->setEnabled( false );
//mActionMoveVertex->setEnabled( false );
#if 0 //these three tools to be deprecated - use node tool rather
mActionAddVertex->setEnabled( false );
mActionDeleteVertex->setEnabled( false );
mActionMoveVertex->setEnabled( false );
#endif
mActionNodeTool->setEnabled( false );
mActionMoveFeature->setEnabled( false );
mActionCopyFeatures->setEnabled( false );
Expand Down
11 changes: 5 additions & 6 deletions src/app/qgisapp.h
Expand Up @@ -231,10 +231,11 @@ class QgisApp : public QMainWindow
QAction *actionDeleteSelected() { return mActionDeleteSelected; }
QAction *actionMoveFeature() { return mActionMoveFeature; }
QAction *actionSplitFeatures() { return mActionSplitFeatures; }
//These three tools are deprecated - use node tool rather...
//QAction *actionAddVertex() { return mActionAddVertex; }
//QAction *actionDeleteVertex() { return mActionDeleteVertex; }
//QAction *actionMoveVertex() { return mActionMoveVertex; }
#if 0 //These three tools are deprecated - use node tool rather...
QAction *actionAddVertex() { return mActionAddVertex; }
QAction *actionDeleteVertex() { return mActionDeleteVertex; }
QAction *actionMoveVertex() { return mActionMoveVertex; }
#endif
QAction *actionAddRing() { return mActionAddRing; }
QAction *actionAddIsland() { return mActionAddIsland; }
QAction *actionSimplifyFeature() { return mActionSimplifyFeature; }
Expand Down Expand Up @@ -431,10 +432,8 @@ class QgisApp : public QMainWindow
void userCenter();
//! Remove a layer from the map and legend
void removeLayer();
#ifdef HAVE_QWT
//! Show GPS tool
void showGpsTool();
#endif
//! zoom to extent of layer
void zoomToLayerExtent();
//! zoom to actual size of raster layer
Expand Down

0 comments on commit c9d0082

Please sign in to comment.