Skip to content

Commit 3b79108

Browse files
committed
Default OTF modes made radio buttons
1 parent de8a5d6 commit 3b79108

File tree

2 files changed

+64
-49
lines changed

2 files changed

+64
-49
lines changed

src/app/qgsoptions.cpp

+17-6
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,19 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
390390
leLayerGlobalCrs->setText( mLayerDefaultCrs.authid() + " - " + mLayerDefaultCrs.description() );
391391

392392
//on the fly CRS transformation settings
393-
chkOtfAuto->setChecked( settings.value( "/Projections/otfTransformAutoEnable", true ).toBool() );
394-
chkOtfTransform->setChecked( settings.value( "/Projections/otfTransformEnabled", 0 ).toBool() );
393+
//it would be logical to have single settings value but originaly the radio buttons were checkboxes
394+
if ( settings.value( "/Projections/otfTransformAutoEnable", true ).toBool() )
395+
{
396+
radOtfAuto->setChecked( true );
397+
}
398+
else if ( settings.value( "/Projections/otfTransformEnabled", false ).toBool() )
399+
{
400+
radOtfTransform->setChecked( true );
401+
}
402+
else
403+
{
404+
radOtfNone->setChecked( true ); // default
405+
}
395406

396407
QString myDefaultCrs = settings.value( "/Projections/projectDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
397408
mDefaultCrs.createFromOgcWmsCrs( myDefaultCrs );
@@ -1034,8 +1045,8 @@ void QgsOptions::saveOptions()
10341045
settings.setValue( "/Projections/layerDefaultCrs", mLayerDefaultCrs.authid() );
10351046

10361047
// save 'on the fly' CRS transformation settings
1037-
settings.setValue( "/Projections/otfTransformAutoEnable", chkOtfAuto->isChecked() );
1038-
settings.setValue( "/Projections/otfTransformEnabled", chkOtfTransform->isChecked() );
1048+
settings.setValue( "/Projections/otfTransformAutoEnable", radOtfAuto->isChecked() );
1049+
settings.setValue( "/Projections/otfTransformEnabled", radOtfTransform->isChecked() );
10391050
settings.setValue( "/Projections/projectDefaultCrs", mDefaultCrs.authid() );
10401051

10411052
if ( radFeet->isChecked() )
@@ -1348,8 +1359,8 @@ QStringList QgsOptions::i18nList()
13481359
{
13491360
QString myFileName = myIterator.next();
13501361

1351-
// Ignore the 'en' translation file, already added as 'en_US'.
1352-
if (myFileName.compare( "qgis_en.qm" )==0) continue;
1362+
// Ignore the 'en' translation file, already added as 'en_US'.
1363+
if ( myFileName.compare( "qgis_en.qm" ) == 0 ) continue;
13531364

13541365
myList << myFileName.replace( "qgis_", "" ).replace( ".qm", "" );
13551366
}

src/ui/qgsoptionsbase.ui

+47-43
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
<item>
237237
<widget class="QStackedWidget" name="mOptionsStackedWidget">
238238
<property name="currentIndex">
239-
<number>1</number>
239+
<number>0</number>
240240
</property>
241241
<widget class="QWidget" name="mOptionsPage_01">
242242
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -266,8 +266,8 @@
266266
<rect>
267267
<x>0</x>
268268
<y>0</y>
269-
<width>661</width>
270-
<height>674</height>
269+
<width>687</width>
270+
<height>523</height>
271271
</rect>
272272
</property>
273273
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -912,8 +912,8 @@
912912
<rect>
913913
<x>0</x>
914914
<y>0</y>
915-
<width>661</width>
916-
<height>803</height>
915+
<width>670</width>
916+
<height>750</height>
917917
</rect>
918918
</property>
919919
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1248,8 +1248,8 @@
12481248
<rect>
12491249
<x>0</x>
12501250
<y>0</y>
1251-
<width>527</width>
1252-
<height>443</height>
1251+
<width>687</width>
1252+
<height>523</height>
12531253
</rect>
12541254
</property>
12551255
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -1577,8 +1577,8 @@
15771577
<rect>
15781578
<x>0</x>
15791579
<y>0</y>
1580-
<width>611</width>
1581-
<height>757</height>
1580+
<width>572</width>
1581+
<height>611</height>
15821582
</rect>
15831583
</property>
15841584
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -2092,8 +2092,8 @@
20922092
<rect>
20932093
<x>0</x>
20942094
<y>0</y>
2095-
<width>476</width>
2096-
<height>353</height>
2095+
<width>441</width>
2096+
<height>281</height>
20972097
</rect>
20982098
</property>
20992099
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2395,8 +2395,8 @@
23952395
<rect>
23962396
<x>0</x>
23972397
<y>0</y>
2398-
<width>529</width>
2399-
<height>770</height>
2398+
<width>494</width>
2399+
<height>619</height>
24002400
</rect>
24012401
</property>
24022402
<layout class="QVBoxLayout" name="verticalLayout_30">
@@ -2802,8 +2802,8 @@
28022802
<rect>
28032803
<x>0</x>
28042804
<y>0</y>
2805-
<width>489</width>
2806-
<height>691</height>
2805+
<width>670</width>
2806+
<height>551</height>
28072807
</rect>
28082808
</property>
28092809
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -3303,8 +3303,8 @@
33033303
<rect>
33043304
<x>0</x>
33053305
<y>0</y>
3306-
<width>462</width>
3307-
<height>386</height>
3306+
<width>687</width>
3307+
<height>523</height>
33083308
</rect>
33093309
</property>
33103310
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -3443,8 +3443,8 @@
34433443
<rect>
34443444
<x>0</x>
34453445
<y>0</y>
3446-
<width>635</width>
3447-
<height>422</height>
3446+
<width>687</width>
3447+
<height>523</height>
34483448
</rect>
34493449
</property>
34503450
<layout class="QGridLayout" name="gridLayout_15">
@@ -3543,18 +3543,15 @@
35433543
<string>Default CRS for new projects</string>
35443544
</property>
35453545
<layout class="QGridLayout" name="gridLayout_22">
3546-
<item row="3" column="1">
3547-
<widget class="QPushButton" name="pbnSelectOtfProjection">
3546+
<item row="2" column="0">
3547+
<widget class="QRadioButton" name="radOtfTransform">
35483548
<property name="text">
3549-
<string>Select...</string>
3549+
<string>Enable 'on the &amp;fly' reprojection by default</string>
35503550
</property>
35513551
</widget>
35523552
</item>
3553-
<item row="0" column="0">
3554-
<widget class="QCheckBox" name="chkOtfAuto">
3555-
<property name="toolTip">
3556-
<string/>
3557-
</property>
3553+
<item row="1" column="0">
3554+
<widget class="QRadioButton" name="radOtfAuto">
35583555
<property name="whatsThis">
35593556
<string>Automatically enable 'on the fly' reprojection if CRS of a new added layer differ from CRS of layer(s) already present. CRS of present layer(s) will be used.</string>
35603557
</property>
@@ -3563,27 +3560,34 @@
35633560
</property>
35643561
</widget>
35653562
</item>
3566-
<item row="2" column="0">
3567-
<widget class="QLabel" name="label_16">
3568-
<property name="text">
3569-
<string>Always start new projects with this CRS</string>
3563+
<item row="4" column="0">
3564+
<widget class="QLineEdit" name="leProjectGlobalCrs">
3565+
<property name="readOnly">
3566+
<bool>true</bool>
35703567
</property>
3571-
<property name="buddy">
3572-
<cstring>leProjectGlobalCrs</cstring>
3568+
</widget>
3569+
</item>
3570+
<item row="0" column="0">
3571+
<widget class="QRadioButton" name="radOtfNone">
3572+
<property name="text">
3573+
<string>Don't enable 'on the fly' reprojection</string>
35733574
</property>
35743575
</widget>
35753576
</item>
3576-
<item row="1" column="0">
3577-
<widget class="QCheckBox" name="chkOtfTransform">
3577+
<item row="4" column="1">
3578+
<widget class="QPushButton" name="pbnSelectOtfProjection">
35783579
<property name="text">
3579-
<string>Enable 'on the &amp;fly' reprojection by default</string>
3580+
<string>Select...</string>
35803581
</property>
35813582
</widget>
35823583
</item>
35833584
<item row="3" column="0">
3584-
<widget class="QLineEdit" name="leProjectGlobalCrs">
3585-
<property name="readOnly">
3586-
<bool>true</bool>
3585+
<widget class="QLabel" name="label_16">
3586+
<property name="text">
3587+
<string>Always start new projects with this CRS</string>
3588+
</property>
3589+
<property name="buddy">
3590+
<cstring>leProjectGlobalCrs</cstring>
35873591
</property>
35883592
</widget>
35893593
</item>
@@ -3624,8 +3628,8 @@
36243628
<rect>
36253629
<x>0</x>
36263630
<y>0</y>
3627-
<width>298</width>
3628-
<height>240</height>
3631+
<width>265</width>
3632+
<height>197</height>
36293633
</rect>
36303634
</property>
36313635
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -3724,8 +3728,8 @@
37243728
<rect>
37253729
<x>0</x>
37263730
<y>0</y>
3727-
<width>528</width>
3728-
<height>672</height>
3731+
<width>469</width>
3732+
<height>556</height>
37293733
</rect>
37303734
</property>
37313735
<layout class="QVBoxLayout" name="verticalLayout_33">

0 commit comments

Comments
 (0)