Skip to content
Permalink
Browse files
remember and revert crs change
  • Loading branch information
roya0045 authored and nyalldawson committed Dec 23, 2021
1 parent 5ac07f5 commit 143fd16d0cd5db097bfdbebdc079f16aa32fc8df
Showing with 9 additions and 2 deletions.
  1. +7 −2 src/gui/vector/qgsvectorlayerproperties.cpp
  2. +2 −0 src/gui/vector/qgsvectorlayerproperties.h
@@ -300,6 +300,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
}
}


mCrsSelector->setCrs( mLayer->crs() );

//insert existing join info
@@ -557,7 +558,7 @@ void QgsVectorLayerProperties::syncToLayer()

// populate the general information
mLayerOrigNameLineEdit->setText( mLayer->name() );

mBackupCrs = mLayer->crs();
//see if we are dealing with a pg layer here
mSubsetGroupBox->setEnabled( true );
txtSubsetSQL->setText( mLayer->subsetString() );
@@ -691,7 +692,7 @@ void QgsVectorLayerProperties::apply()
{
labelingDialog->writeSettingsToLayer();
}

mBackupCrs = mLayer->crs();
// apply legend settings
mLegendWidget->applyToLayer();
mLegendConfigEmbeddedWidget->applyToLayer();
@@ -917,6 +918,9 @@ void QgsVectorLayerProperties::onCancel()
doc.setContent( mOldStyle.xmlData(), false, &myMessage, &errorLine, &errorColumn );
mLayer->importNamedStyle( doc, myMessage );
}

if ( mBackupCrs != mLayer->crs() )
mLayer->setCrs( mBackupCrs );
}

void QgsVectorLayerProperties::urlClicked( const QUrl &url )
@@ -979,6 +983,7 @@ QString QgsVectorLayerProperties::htmlMetadata()

void QgsVectorLayerProperties::mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs )
{

QgsDatumTransformDialog::run( crs, QgsProject::instance()->crs(), this, mCanvas, tr( "Select Transformation for the vector layer" ) );
mLayer->setCrs( crs );
mMetadataFilled = false;
@@ -251,6 +251,8 @@ class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
QgsVectorLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;

QgsProviderSourceWidget *mSourceWidget = nullptr;

QgsCoordinateReferenceSystem mBackupCrs;

private slots:
void openPanel( QgsPanelWidget *panel );

0 comments on commit 143fd16

Please sign in to comment.