@@ -74,6 +74,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
74
74
connect ( buttonBox->button ( QDialogButtonBox::Apply ), SIGNAL ( clicked () ), this , SLOT ( apply () ) );
75
75
connect ( this , SIGNAL ( accepted () ), this , SLOT ( apply () ) );
76
76
connect ( projectionSelector, SIGNAL ( sridSelected ( QString ) ), this , SLOT ( setMapUnitsToCurrentProjection () ) );
77
+ connect ( projectionSelector, SIGNAL ( initialized () ), this , SLOT ( projectionSelectorInitialized () ) );
77
78
78
79
connect ( cmbEllipsoid, SIGNAL ( currentIndexChanged ( int ) ), this , SLOT ( updateEllipsoidUI ( int ) ) );
79
80
@@ -123,33 +124,10 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
123
124
cbxAbsolutePath->setCurrentIndex ( QgsProject::instance ()->readBoolEntry ( " Paths" , " /Absolute" , true ) ? 0 : 1 );
124
125
125
126
// populate combo box with ellipsoids
126
-
127
- QgsDebugMsg ( " Setting upp ellipsoid" );
128
-
127
+ // selection of the ellipsoid from settings is defferred to a later point, because it would
128
+ // be overridden in the meanwhile by the projection selector
129
129
populateEllipsoidList ();
130
130
131
- // Reading ellipsoid from setttings
132
- QStringList mySplitEllipsoid = QgsProject::instance ()->readEntry ( " Measure" , " /Ellipsoid" , GEO_NONE ).split ( ' :' );
133
-
134
- int myIndex = 0 ;
135
- for ( int i = 0 ; i < mEllipsoidList .length (); i++ )
136
- {
137
- if ( mEllipsoidList [ i ].acronym .startsWith ( mySplitEllipsoid[ 0 ] ) )
138
- {
139
- myIndex = i;
140
- break ;
141
- }
142
- }
143
-
144
- // Update paramaters if present.
145
- if ( mySplitEllipsoid.length () >= 3 )
146
- {
147
- mEllipsoidList [ myIndex ].semiMajor = mySplitEllipsoid[ 1 ].toDouble ();
148
- mEllipsoidList [ myIndex ].semiMinor = mySplitEllipsoid[ 2 ].toDouble ();
149
- }
150
-
151
- updateEllipsoidUI ( myIndex );
152
-
153
131
154
132
int dp = QgsProject::instance ()->readNumEntry ( " PositionPrecision" , " /DecimalPlaces" );
155
133
spinBoxDP->setValue ( dp );
@@ -1631,3 +1609,30 @@ void QgsProjectProperties::updateEllipsoidUI( int newIndex )
1631
1609
}
1632
1610
cmbEllipsoid->setCurrentIndex ( mEllipsoidIndex ); // Not always necessary
1633
1611
}
1612
+
1613
+ void QgsProjectProperties::projectionSelectorInitialized ()
1614
+ {
1615
+ QgsDebugMsg ( " Setting up ellipsoid" );
1616
+
1617
+ // Reading ellipsoid from setttings
1618
+ QStringList mySplitEllipsoid = QgsProject::instance ()->readEntry ( " Measure" , " /Ellipsoid" , GEO_NONE ).split ( ' :' );
1619
+
1620
+ int myIndex = 0 ;
1621
+ for ( int i = 0 ; i < mEllipsoidList .length (); i++ )
1622
+ {
1623
+ if ( mEllipsoidList [ i ].acronym .startsWith ( mySplitEllipsoid[ 0 ] ) )
1624
+ {
1625
+ myIndex = i;
1626
+ break ;
1627
+ }
1628
+ }
1629
+
1630
+ // Update paramaters if present.
1631
+ if ( mySplitEllipsoid.length () >= 3 )
1632
+ {
1633
+ mEllipsoidList [ myIndex ].semiMajor = mySplitEllipsoid[ 1 ].toDouble ();
1634
+ mEllipsoidList [ myIndex ].semiMinor = mySplitEllipsoid[ 2 ].toDouble ();
1635
+ }
1636
+
1637
+ updateEllipsoidUI ( myIndex );
1638
+ }
0 commit comments