mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[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
This commit is contained in:
parent
3e2d60e712
commit
1962c54ee8
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user