@@ -188,12 +188,14 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
188
188
{
189
189
radUseGlobalProjection->setChecked ( true );
190
190
}
191
-
192
191
txtGlobalWkt->setText ( settings.value ( " /Projections/defaultProjectionString" , GEOPROJ4 ).toString () );
193
-
194
192
// on the fly CRS transformation settings
195
193
grpOtfTransform->setChecked ( settings.value ( " /Projections/otfTransformEnabled" , 0 ).toBool () );
196
- leGlobalOtfProjString->setText ( settings.value ( " /Projections/defaultOTFProjectionString" , GEOPROJ4 ).toString () );
194
+ QString myDefaultSrsString = settings.value ( " /Projections/defaultOTFProjectionString" , GEOPROJ4 ).toString ();
195
+ mDefaultCrs .createFromProj4 ( myDefaultSrsString );
196
+ // display the crs as friendly text rather than in wkt
197
+ leGlobalOtfProjString->setText ( mDefaultCrs .authid () + " - " +
198
+ mDefaultCrs .description () );
197
199
198
200
// populate combo box with ellipsoids
199
201
getEllipsoidList ();
@@ -637,7 +639,7 @@ void QgsOptions::saveOptions()
637
639
638
640
// save 'on the fly' CRS transformation settings
639
641
settings.setValue ( " /Projections/otfTransformEnabled" , grpOtfTransform->isChecked () );
640
- settings.setValue ( " /Projections/defaultOTFProjectionString" , leGlobalOtfProjString-> text () );
642
+ settings.setValue ( " /Projections/defaultOTFProjectionString" , mDefaultCrs . toProj4 () );
641
643
642
644
settings.setValue ( " /qgis/measure/ellipsoid" , getEllipsoidAcronym ( cmbEllipsoid->currentText () ) );
643
645
@@ -774,15 +776,14 @@ void QgsOptions::on_pbnSelectOtfProjection_clicked()
774
776
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector ( this );
775
777
776
778
// find out srs id of current proj4 string
777
- QgsCoordinateReferenceSystem refSys;
778
- if ( refSys.createFromProj4 ( leGlobalOtfProjString->text () ) )
779
- {
780
- mySelector->setSelectedCrsId ( refSys.srsid () );
781
- }
779
+ mySelector->setSelectedCrsId ( mDefaultCrs .srsid () );
782
780
783
781
if ( mySelector->exec () )
784
782
{
785
- leGlobalOtfProjString->setText ( mySelector->selectedProj4String () );
783
+ mDefaultCrs .createFromProj4 ( mySelector->selectedProj4String () );
784
+ QgsDebugMsg ( QString ( " Setting default project CRS to : %1" ).arg ( mySelector->selectedProj4String () ) );
785
+ leGlobalOtfProjString->setText ( mDefaultCrs .authid () + " - " +
786
+ mDefaultCrs .description () );
786
787
QgsDebugMsg ( QString ( " ------ Global OTF Projection Selection set to ----------\n %1" ).arg ( leGlobalOtfProjString->text () ) );
787
788
}
788
789
else
0 commit comments