Skip to content
Permalink
Browse files
[cad] Listen out for CRS changes and enable if appropriate
Avoids having to manually switch on and off cad tools after changing
CRS from geographic->metres based
  • Loading branch information
nyalldawson committed Apr 19, 2017
1 parent 3e2d60e commit 1962c54ee8083eae830f17e845bab7c67e9760c4
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/gui/qgsadvanceddigitizingdockwidget.cpp
@@ -1210,6 +1210,7 @@ bool QgsAdvancedDigitizingDockWidget::filterKeyPress( QKeyEvent *e )

void QgsAdvancedDigitizingDockWidget::enable()
{
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsAdvancedDigitizingDockWidget::enable, Qt::UniqueConnection );
if ( mMapCanvas->mapSettings().destinationCrs().isGeographic() )
{
mErrorLabel->setText( tr( "CAD tools can not be used on geographic coordinates. Change the coordinates system in the project properties." ) );
@@ -1236,6 +1237,8 @@ void QgsAdvancedDigitizingDockWidget::enable()

void QgsAdvancedDigitizingDockWidget::disable()
{
disconnect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsAdvancedDigitizingDockWidget::enable );

mEnableAction->setEnabled( false );
mErrorLabel->setText( tr( "CAD tools are not enabled for the current map tool" ) );
mErrorLabel->show();

0 comments on commit 1962c54

Please sign in to comment.