Skip to content

Commit

Permalink
protect editing tools if map canvas is rendering
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@7855 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 7, 2008
1 parent 28c5599 commit 089bb37
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3398,6 +3398,11 @@ void QgisApp::deleteSelected()

void QgisApp::capturePoint()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}

// set current map tool to select
mMapCanvas->setMapTool(mMapTools.mCapturePoint);

Expand All @@ -3407,11 +3412,20 @@ void QgisApp::capturePoint()

void QgisApp::captureLine()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}

mMapCanvas->setMapTool(mMapTools.mCaptureLine);
}

void QgisApp::capturePolygon()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mCapturePolygon);
}

Expand All @@ -3423,34 +3437,59 @@ void QgisApp::select()

void QgisApp::addVertex()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mVertexAdd);

}

void QgisApp::moveVertex()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mVertexMove);
}

void QgisApp::addRing()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mAddRing);
}

void QgisApp::addIsland()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mAddIsland);
}


void QgisApp::deleteVertex()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}
mMapCanvas->setMapTool(mMapTools.mVertexDelete);
}


void QgisApp::editCut(QgsMapLayer * layerContainingSelection)
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}

QgsMapLayer * selectionLayer = (layerContainingSelection != 0) ?
(layerContainingSelection) :
(activeLayer());
Expand All @@ -3472,6 +3511,11 @@ void QgisApp::editCut(QgsMapLayer * layerContainingSelection)

void QgisApp::editCopy(QgsMapLayer * layerContainingSelection)
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}

QgsMapLayer * selectionLayer = (layerContainingSelection != 0) ?
(layerContainingSelection) :
(activeLayer());
Expand All @@ -3492,6 +3536,11 @@ void QgisApp::editCopy(QgsMapLayer * layerContainingSelection)

void QgisApp::editPaste(QgsMapLayer * destinationLayer)
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
return;
}

QgsMapLayer * pasteLayer = (destinationLayer != 0) ?
(destinationLayer) :
(activeLayer());
Expand Down Expand Up @@ -3529,6 +3578,12 @@ void QgisApp::refreshMapCanvas()

void QgisApp::toggleEditing()
{
if(mMapCanvas && mMapCanvas->isDrawing())
{
mActionToggleEditing->setChecked(!mActionToggleEditing->isChecked());
return;
}

QgsLegendLayerFile* currentLayerFile = mMapLegend->currentLayerFile();
if(currentLayerFile)
{
Expand Down

0 comments on commit 089bb37

Please sign in to comment.