Skip to content
Permalink
Browse files

fix #2358

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12745 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jan 12, 2010
1 parent ab3ec7d commit ebf9c60d5ff2b996d63468bad044207d9845dd82
Showing with 56 additions and 49 deletions.
  1. +51 −43 src/app/qgisapp.cpp
  2. +5 −6 src/app/qgisapp.h
@@ -18,7 +18,6 @@
***************************************************************************/
/* $Id$ */


//
// QT4 includes make sure to use the new <CamelCase> style!
//
@@ -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;
@@ -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" ) );
@@ -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 );
@@ -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();

@@ -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 );
@@ -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" ) );
@@ -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 );
@@ -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 );
@@ -4432,8 +4436,8 @@ void QgisApp::showGpsTool()
{
mpGpsDock->toggleViewAction();
}
}
#endif
}

void QgisApp::zoomToLayerExtent()
{
@@ -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 );
@@ -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 );
@@ -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;
}
@@ -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 );
@@ -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; }
@@ -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

0 comments on commit ebf9c60

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