Default OTF modes made radio buttons

This commit is contained in:
Radim Blazek 2013-10-16 22:35:59 +02:00
parent de8a5d6210
commit 3b791086e8
2 changed files with 67 additions and 52 deletions

View File

@ -390,8 +390,19 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
leLayerGlobalCrs->setText( mLayerDefaultCrs.authid() + " - " + mLayerDefaultCrs.description() ); leLayerGlobalCrs->setText( mLayerDefaultCrs.authid() + " - " + mLayerDefaultCrs.description() );
//on the fly CRS transformation settings //on the fly CRS transformation settings
chkOtfAuto->setChecked( settings.value( "/Projections/otfTransformAutoEnable", true ).toBool() ); //it would be logical to have single settings value but originaly the radio buttons were checkboxes
chkOtfTransform->setChecked( settings.value( "/Projections/otfTransformEnabled", 0 ).toBool() ); if ( settings.value( "/Projections/otfTransformAutoEnable", true ).toBool() )
{
radOtfAuto->setChecked( true );
}
else if ( settings.value( "/Projections/otfTransformEnabled", false ).toBool() )
{
radOtfTransform->setChecked( true );
}
else
{
radOtfNone->setChecked( true ); // default
}
QString myDefaultCrs = settings.value( "/Projections/projectDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString(); QString myDefaultCrs = settings.value( "/Projections/projectDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString();
mDefaultCrs.createFromOgcWmsCrs( myDefaultCrs ); mDefaultCrs.createFromOgcWmsCrs( myDefaultCrs );
@ -1034,8 +1045,8 @@ void QgsOptions::saveOptions()
settings.setValue( "/Projections/layerDefaultCrs", mLayerDefaultCrs.authid() ); settings.setValue( "/Projections/layerDefaultCrs", mLayerDefaultCrs.authid() );
// save 'on the fly' CRS transformation settings // save 'on the fly' CRS transformation settings
settings.setValue( "/Projections/otfTransformAutoEnable", chkOtfAuto->isChecked() ); settings.setValue( "/Projections/otfTransformAutoEnable", radOtfAuto->isChecked() );
settings.setValue( "/Projections/otfTransformEnabled", chkOtfTransform->isChecked() ); settings.setValue( "/Projections/otfTransformEnabled", radOtfTransform->isChecked() );
settings.setValue( "/Projections/projectDefaultCrs", mDefaultCrs.authid() ); settings.setValue( "/Projections/projectDefaultCrs", mDefaultCrs.authid() );
if ( radFeet->isChecked() ) if ( radFeet->isChecked() )
@ -1348,8 +1359,8 @@ QStringList QgsOptions::i18nList()
{ {
QString myFileName = myIterator.next(); QString myFileName = myIterator.next();
// Ignore the 'en' translation file, already added as 'en_US'. // Ignore the 'en' translation file, already added as 'en_US'.
if (myFileName.compare( "qgis_en.qm" )==0) continue; if ( myFileName.compare( "qgis_en.qm" ) == 0 ) continue;
myList << myFileName.replace( "qgis_", "" ).replace( ".qm", "" ); myList << myFileName.replace( "qgis_", "" ).replace( ".qm", "" );
} }

View File

@ -236,7 +236,7 @@
<item> <item>
<widget class="QStackedWidget" name="mOptionsStackedWidget"> <widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="mOptionsPage_01"> <widget class="QWidget" name="mOptionsPage_01">
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
@ -266,8 +266,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>661</width> <width>687</width>
<height>674</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_28"> <layout class="QVBoxLayout" name="verticalLayout_28">
@ -912,8 +912,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>661</width> <width>670</width>
<height>803</height> <height>750</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_22"> <layout class="QVBoxLayout" name="verticalLayout_22">
@ -1248,8 +1248,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>527</width> <width>687</width>
<height>443</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_27"> <layout class="QVBoxLayout" name="verticalLayout_27">
@ -1577,8 +1577,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>611</width> <width>572</width>
<height>757</height> <height>611</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_29"> <layout class="QVBoxLayout" name="verticalLayout_29">
@ -2092,8 +2092,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>476</width> <width>441</width>
<height>353</height> <height>281</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_25"> <layout class="QVBoxLayout" name="verticalLayout_25">
@ -2395,8 +2395,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>529</width> <width>494</width>
<height>770</height> <height>619</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_30"> <layout class="QVBoxLayout" name="verticalLayout_30">
@ -2802,8 +2802,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>489</width> <width>670</width>
<height>691</height> <height>551</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_31"> <layout class="QVBoxLayout" name="verticalLayout_31">
@ -3303,8 +3303,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>462</width> <width>687</width>
<height>386</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
@ -3443,8 +3443,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>635</width> <width>687</width>
<height>422</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_15"> <layout class="QGridLayout" name="gridLayout_15">
@ -3543,18 +3543,15 @@
<string>Default CRS for new projects</string> <string>Default CRS for new projects</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_22"> <layout class="QGridLayout" name="gridLayout_22">
<item row="3" column="1"> <item row="2" column="0">
<widget class="QPushButton" name="pbnSelectOtfProjection"> <widget class="QRadioButton" name="radOtfTransform">
<property name="text"> <property name="text">
<string>Select...</string> <string>Enable 'on the &amp;fly' reprojection by default</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="1" column="0">
<widget class="QCheckBox" name="chkOtfAuto"> <widget class="QRadioButton" name="radOtfAuto">
<property name="toolTip">
<string/>
</property>
<property name="whatsThis"> <property name="whatsThis">
<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> <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>
</property> </property>
@ -3563,7 +3560,28 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="4" column="0">
<widget class="QLineEdit" name="leProjectGlobalCrs">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QRadioButton" name="radOtfNone">
<property name="text">
<string>Don't enable 'on the fly' reprojection</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pbnSelectOtfProjection">
<property name="text">
<string>Select...</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="text"> <property name="text">
<string>Always start new projects with this CRS</string> <string>Always start new projects with this CRS</string>
@ -3573,20 +3591,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkOtfTransform">
<property name="text">
<string>Enable 'on the &amp;fly' reprojection by default</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLineEdit" name="leProjectGlobalCrs">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -3624,8 +3628,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>298</width> <width>265</width>
<height>240</height> <height>197</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_32"> <layout class="QVBoxLayout" name="verticalLayout_32">
@ -3724,8 +3728,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>528</width> <width>469</width>
<height>672</height> <height>556</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_33"> <layout class="QVBoxLayout" name="verticalLayout_33">