|
27 | 27 | #include <QMenu>
|
28 | 28 | #include <QCheckBox>
|
29 | 29 |
|
30 |
| - |
31 | 30 | QgsRasterPyramidsOptionsWidget::QgsRasterPyramidsOptionsWidget( QWidget* parent, const QString& provider )
|
32 | 31 | : QWidget( parent )
|
33 | 32 | , mProvider( provider )
|
@@ -55,11 +54,11 @@ void QgsRasterPyramidsOptionsWidget::updateUi()
|
55 | 54 | // keep it in sync with qgsrasterlayerproperties.cpp
|
56 | 55 | tmpStr = mySettings.value( prefix + "format", "external" ).toString();
|
57 | 56 | if ( tmpStr == "internal" )
|
58 |
| - cbxPyramidsFormat->setCurrentIndex( 1 ); |
| 57 | + cbxPyramidsFormat->setCurrentIndex( Format::INTERNAL ); |
59 | 58 | else if ( tmpStr == "external_erdas" )
|
60 |
| - cbxPyramidsFormat->setCurrentIndex( 2 ); |
| 59 | + cbxPyramidsFormat->setCurrentIndex( Format::ERDAS ); |
61 | 60 | else
|
62 |
| - cbxPyramidsFormat->setCurrentIndex( 0 ); |
| 61 | + cbxPyramidsFormat->setCurrentIndex( Format::GTIFF ); |
63 | 62 |
|
64 | 63 | // initialize resampling methods
|
65 | 64 | cboResamplingMethod->clear();
|
@@ -127,9 +126,9 @@ void QgsRasterPyramidsOptionsWidget::apply()
|
127 | 126 | QString tmpStr;
|
128 | 127 |
|
129 | 128 | // mySettings.setValue( prefix + "internal", cbxPyramidsInternal->isChecked() );
|
130 |
| - if ( cbxPyramidsFormat->currentIndex() == 1 ) |
| 129 | + if ( cbxPyramidsFormat->currentIndex() == Format::INTERNAL ) |
131 | 130 | tmpStr = "internal";
|
132 |
| - else if ( cbxPyramidsFormat->currentIndex() == 2 ) |
| 131 | + else if ( cbxPyramidsFormat->currentIndex() == Format::ERDAS ) |
133 | 132 | tmpStr = "external_erdas";
|
134 | 133 | else
|
135 | 134 | tmpStr = "external";
|
@@ -166,8 +165,25 @@ void QgsRasterPyramidsOptionsWidget::on_cbxPyramidsLevelsCustom_toggled( bool to
|
166 | 165 |
|
167 | 166 | void QgsRasterPyramidsOptionsWidget::on_cbxPyramidsFormat_currentIndexChanged( int index )
|
168 | 167 | {
|
169 |
| - mSaveOptionsWidget->setEnabled( index != 2 ); |
170 |
| - mSaveOptionsWidget->setPyramidsFormat(( QgsRaster::RasterPyramidsFormat ) index ); |
| 168 | + mSaveOptionsWidget->setEnabled( index != Format::ERDAS ); |
| 169 | + QgsRaster::RasterPyramidsFormat format; |
| 170 | + switch ( index ) |
| 171 | + { |
| 172 | + case Format::GTIFF: |
| 173 | + format = QgsRaster::PyramidsGTiff; |
| 174 | + break; |
| 175 | + case Format::INTERNAL: |
| 176 | + format = QgsRaster::PyramidsInternal; |
| 177 | + break; |
| 178 | + case Format::ERDAS: |
| 179 | + format = QgsRaster::PyramidsErdas; |
| 180 | + break; |
| 181 | + default: |
| 182 | + QgsDebugMsg( "Should not happen !" ); |
| 183 | + format = QgsRaster::PyramidsGTiff; |
| 184 | + break; |
| 185 | + } |
| 186 | + mSaveOptionsWidget->setPyramidsFormat( format ); |
171 | 187 | }
|
172 | 188 |
|
173 | 189 | void QgsRasterPyramidsOptionsWidget::setOverviewList()
|
|
0 commit comments