diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index b091394021bb..7660561396c9 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -188,14 +188,17 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) : { radUseGlobalProjection->setChecked( true ); } - txtGlobalWkt->setText( settings.value( "/Projections/defaultProjectionString", GEOPROJ4 ).toString() ); + QString myGlobalCrsString = settings.value( "/Projections/defaultProjectionString", GEOPROJ4 ).toString(); + mGlobalCrs.createFromProj4( myGlobalCrsString ); + //display the crs as friendly text rather than in wkt + leGlobalCRS->setText( mGlobalCrs.authid() + " - " + mGlobalCrs.description() ); + //on the fly CRS transformation settings grpOtfTransform->setChecked( settings.value( "/Projections/otfTransformEnabled", 0 ).toBool() ); - QString myDefaultSrsString = settings.value( "/Projections/defaultOTFProjectionString", GEOPROJ4 ).toString(); - mDefaultCrs.createFromProj4( myDefaultSrsString ); + QString myDefaultCrsString = settings.value( "/Projections/defaultOTFProjectionString", GEOPROJ4 ).toString(); + mDefaultCrs.createFromProj4( myDefaultCrsString ); //display the crs as friendly text rather than in wkt - leGlobalOtfProjString->setText( mDefaultCrs.authid() + " - " + - mDefaultCrs.description() ); + leGlobalOtfProjString->setText( mDefaultCrs.authid() + " - " + mDefaultCrs.description() ); // populate combo box with ellipsoids getEllipsoidList(); @@ -635,7 +638,7 @@ void QgsOptions::saveOptions() settings.setValue( "/Projections/defaultBehaviour", "useGlobal" ); } - settings.setValue( "/Projections/defaultProjectionString", txtGlobalWkt->toPlainText() ); + settings.setValue( "/Projections/defaultProjectionString", mGlobalCrs.toProj4() ); // save 'on the fly' CRS transformation settings settings.setValue( "/Projections/otfTransformEnabled", grpOtfTransform->isChecked() ); @@ -748,19 +751,15 @@ void QgsOptions::on_pbnSelectProjection_clicked() { QSettings settings; QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector( this ); - - //find out srs id of current proj4 string - QgsCoordinateReferenceSystem refSys; - if ( refSys.createFromProj4( txtGlobalWkt->toPlainText() ) ) - { - mySelector->setSelectedCrsId( refSys.srsid() ); - } + mySelector->setSelectedCrsId( mGlobalCrs.srsid() ); if ( mySelector->exec() ) { - //! @todo changes this control name in gui to txtGlobalProjString - txtGlobalWkt->setText( mySelector->selectedProj4String() ); - QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( txtGlobalWkt->toPlainText() ) ); + mGlobalCrs.createFromProj4( mySelector->selectedProj4String() ); + leGlobalCRS->setText( mySelector->selectedProj4String() ); + leGlobalCRS->setText( mGlobalCrs.authid() + " - " + + mGlobalCrs.description() ); + QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( leGlobalCRS->text() ) ); } else { @@ -774,8 +773,6 @@ void QgsOptions::on_pbnSelectOtfProjection_clicked() { QSettings settings; QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector( this ); - - //find out srs id of current proj4 string mySelector->setSelectedCrsId( mDefaultCrs.srsid() ); if ( mySelector->exec() ) diff --git a/src/app/qgsoptions.h b/src/app/qgsoptions.h index 096cb33298eb..58764b6d3593 100644 --- a/src/app/qgsoptions.h +++ b/src/app/qgsoptions.h @@ -131,6 +131,7 @@ class QgsOptions : public QDialog, private Ui::QgsOptionsBase private: QStringList i18nList(); QgsCoordinateReferenceSystem mDefaultCrs; + QgsCoordinateReferenceSystem mGlobalCrs; }; #endif // #ifndef QGSOPTIONS_H diff --git a/src/ui/qgsoptionsbase.ui b/src/ui/qgsoptionsbase.ui index 25212810266c..89dd4247eb35 100644 --- a/src/ui/qgsoptionsbase.ui +++ b/src/ui/qgsoptionsbase.ui @@ -33,7 +33,7 @@ - 0 + 1 @@ -1354,87 +1354,106 @@ 0 - -59 - 746 - 516 + 0 + 762 + 457 - + Default Coordinate Reference System - - - 11 - - + + - When a new layer is created, or when a layer is loaded that has no coordinate reference system (CRS) + When a new layer is created, or when a layer is loaded that has no Coordinate Reference System (CRS) true - + Prompt for CRS - + Project wide default CRS will be used - + Global default CRS displa&yed below will be used + + + + + + true + + + + + + + Select ... + + + + + - - - - - - Select Global Default ... - - - - - Always use 'on the fly' CRS transformation for new projects + Enable 'on the fly' reprojection by defaul true - - - - + + + + + When this opton is enabled, any new project you create will have 'on the fly' projection enabled by default and the CRS below will be used for the project. + + true - - - - Select CRS for 'on the fly' transformation ... - - + + + + + + true + + + + + + + Select ... + + + + @@ -1828,7 +1847,6 @@ radPromptForProjection radUseProjectProjection radUseGlobalProjection - txtGlobalWkt pbnSelectProjection grpLocale cboLocale