Skip to content
Permalink
Browse files

Reset digitizing tools when new project is loaded/created

  • Loading branch information
SebDieBln authored and m-kuhn committed Dec 16, 2015
1 parent b00a60d commit 479e3cb73631d29ceb54d203029f9d09d3315337
@@ -114,11 +114,6 @@ Removes the last vertex from mRubberBand and mCaptureList
:rtype: bool
%End

void stopCapturing();
%Docstring
Stop capturing
%End

int size();
%Docstring
Number of points digitized
@@ -146,6 +141,13 @@ Removes the last vertex from mRubberBand and mCaptureList
Close an open polygon
%End

protected slots:

void stopCapturing();
%Docstring
Stop capturing
%End

};

/************************************************************************
@@ -36,6 +36,8 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture *par
{
connect( mCanvas, &QgsMapCanvas::mapToolSet, this, &QgsMapToolAddCircularString::setParentTool );
}
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
}

QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapCanvas *canvas )
@@ -40,6 +40,8 @@ QgsMapToolAddFeature::QgsMapToolAddFeature( QgsMapCanvas *canvas, CaptureMode mo
, mCheckGeometryType( true )
{
mToolName = tr( "Add feature" );
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
}

QgsMapToolAddFeature::~QgsMapToolAddFeature()
@@ -31,6 +31,8 @@ QgsMapToolAddPart::QgsMapToolAddPart( QgsMapCanvas *canvas )
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget() )
{
mToolName = tr( "Add part" );
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
}

QgsMapToolAddPart::~QgsMapToolAddPart()
@@ -29,6 +29,8 @@ QgsMapToolAddRing::QgsMapToolAddRing( QgsMapCanvas *canvas )
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), QgsMapToolCapture::CapturePolygon )
{
mToolName = tr( "Add ring" );
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( stopCapturing() ) );
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( stopCapturing() ) );
}

QgsMapToolAddRing::~QgsMapToolAddRing()
@@ -147,11 +147,6 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
*/
bool isCapturing() const;

/**
* Stop capturing
*/
void stopCapturing();

/**
* Number of points digitized
*
@@ -177,6 +172,13 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
*/
void closePolygon();

protected slots:

/**
* Stop capturing
*/
void stopCapturing();

private:
//! whether tracing has been requested by the user
bool tracingEnabled();

0 comments on commit 479e3cb

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