Skip to content

Commit 089bb37

Browse files
author
mhugent
committedJan 7, 2008
protect editing tools if map canvas is rendering
git-svn-id: http://svn.osgeo.org/qgis/trunk@7855 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 28c5599 commit 089bb37

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3398,6 +3398,11 @@ void QgisApp::deleteSelected()
33983398

33993399
void QgisApp::capturePoint()
34003400
{
3401+
if(mMapCanvas && mMapCanvas->isDrawing())
3402+
{
3403+
return;
3404+
}
3405+
34013406
// set current map tool to select
34023407
mMapCanvas->setMapTool(mMapTools.mCapturePoint);
34033408

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

34083413
void QgisApp::captureLine()
34093414
{
3415+
if(mMapCanvas && mMapCanvas->isDrawing())
3416+
{
3417+
return;
3418+
}
3419+
34103420
mMapCanvas->setMapTool(mMapTools.mCaptureLine);
34113421
}
34123422

34133423
void QgisApp::capturePolygon()
34143424
{
3425+
if(mMapCanvas && mMapCanvas->isDrawing())
3426+
{
3427+
return;
3428+
}
34153429
mMapCanvas->setMapTool(mMapTools.mCapturePolygon);
34163430
}
34173431

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

34243438
void QgisApp::addVertex()
34253439
{
3440+
if(mMapCanvas && mMapCanvas->isDrawing())
3441+
{
3442+
return;
3443+
}
34263444
mMapCanvas->setMapTool(mMapTools.mVertexAdd);
34273445

34283446
}
34293447

34303448
void QgisApp::moveVertex()
34313449
{
3450+
if(mMapCanvas && mMapCanvas->isDrawing())
3451+
{
3452+
return;
3453+
}
34323454
mMapCanvas->setMapTool(mMapTools.mVertexMove);
34333455
}
34343456

34353457
void QgisApp::addRing()
34363458
{
3459+
if(mMapCanvas && mMapCanvas->isDrawing())
3460+
{
3461+
return;
3462+
}
34373463
mMapCanvas->setMapTool(mMapTools.mAddRing);
34383464
}
34393465

34403466
void QgisApp::addIsland()
34413467
{
3468+
if(mMapCanvas && mMapCanvas->isDrawing())
3469+
{
3470+
return;
3471+
}
34423472
mMapCanvas->setMapTool(mMapTools.mAddIsland);
34433473
}
34443474

34453475

34463476
void QgisApp::deleteVertex()
34473477
{
3478+
if(mMapCanvas && mMapCanvas->isDrawing())
3479+
{
3480+
return;
3481+
}
34483482
mMapCanvas->setMapTool(mMapTools.mVertexDelete);
34493483
}
34503484

34513485

34523486
void QgisApp::editCut(QgsMapLayer * layerContainingSelection)
34533487
{
3488+
if(mMapCanvas && mMapCanvas->isDrawing())
3489+
{
3490+
return;
3491+
}
3492+
34543493
QgsMapLayer * selectionLayer = (layerContainingSelection != 0) ?
34553494
(layerContainingSelection) :
34563495
(activeLayer());
@@ -3472,6 +3511,11 @@ void QgisApp::editCut(QgsMapLayer * layerContainingSelection)
34723511

34733512
void QgisApp::editCopy(QgsMapLayer * layerContainingSelection)
34743513
{
3514+
if(mMapCanvas && mMapCanvas->isDrawing())
3515+
{
3516+
return;
3517+
}
3518+
34753519
QgsMapLayer * selectionLayer = (layerContainingSelection != 0) ?
34763520
(layerContainingSelection) :
34773521
(activeLayer());
@@ -3492,6 +3536,11 @@ void QgisApp::editCopy(QgsMapLayer * layerContainingSelection)
34923536

34933537
void QgisApp::editPaste(QgsMapLayer * destinationLayer)
34943538
{
3539+
if(mMapCanvas && mMapCanvas->isDrawing())
3540+
{
3541+
return;
3542+
}
3543+
34953544
QgsMapLayer * pasteLayer = (destinationLayer != 0) ?
34963545
(destinationLayer) :
34973546
(activeLayer());
@@ -3529,6 +3578,12 @@ void QgisApp::refreshMapCanvas()
35293578

35303579
void QgisApp::toggleEditing()
35313580
{
3581+
if(mMapCanvas && mMapCanvas->isDrawing())
3582+
{
3583+
mActionToggleEditing->setChecked(!mActionToggleEditing->isChecked());
3584+
return;
3585+
}
3586+
35323587
QgsLegendLayerFile* currentLayerFile = mMapLegend->currentLayerFile();
35333588
if(currentLayerFile)
35343589
{

0 commit comments

Comments
 (0)
Please sign in to comment.