23 #include <QInputDialog>
24 #include <QMessageBox>
26 #include <QMouseEvent>
32 : QWidget( parent ), mProvider( provider )
36 mSaveOptionsWidget->setProvider( provider );
51 QString prefix =
mProvider +
"/driverOptions/_pyramids/";
55 tmpStr = mySettings.value( prefix +
"format",
"gtiff" ).toString();
56 if ( tmpStr ==
"internal" )
57 cbxPyramidsFormat->setCurrentIndex( 1 );
58 else if ( tmpStr ==
"external_erdas" )
59 cbxPyramidsFormat->setCurrentIndex( 2 );
61 cbxPyramidsFormat->setCurrentIndex( 0 );
64 cboResamplingMethod->clear();
65 QPair<QString, QString> method;
68 cboResamplingMethod->addItem( method.second, method.first );
70 cboResamplingMethod->setCurrentIndex( cboResamplingMethod->findData(
71 mySettings.value( prefix +
"resampling",
"AVERAGE" ).toString() ) );
74 lePyramidsLevels->setEnabled( cbxPyramidsLevelsCustom->isChecked() );
75 lePyramidsLevels->setValidator(
new QRegExpValidator( QRegExp(
"(\\d*)(\\s\\d*)*" ), lePyramidsLevels ) );
76 connect( lePyramidsLevels, SIGNAL( textEdited(
const QString & ) ),
83 overviewList << 2 << 4 << 8 << 16 << 32 << 64;
85 foreach (
int i, overviewList )
98 tmpStr = mySettings.value( prefix +
"overviewList",
"" ).toString();
99 foreach ( QString lev, tmpStr.split(
" ", QString::SkipEmptyParts ) )
106 mSaveOptionsWidget->updateProfiles();
108 connect( cbxPyramidsFormat, SIGNAL( currentIndexChanged(
int ) ),
110 connect( cboResamplingMethod, SIGNAL( currentIndexChanged(
int ) ),
112 connect( mSaveOptionsWidget, SIGNAL( optionsChanged() ),
118 return cboResamplingMethod->itemData( cboResamplingMethod->currentIndex() ).toString();
123 QSettings mySettings;
124 QString prefix =
mProvider +
"/driverOptions/_pyramids/";
128 if ( cbxPyramidsFormat->currentIndex() == 1 )
130 else if ( cbxPyramidsFormat->currentIndex() == 2 )
131 tmpStr =
"external_erdas";
134 mySettings.setValue( prefix +
"format", tmpStr );
136 mySettings.setValue( prefix +
"overviewStr", lePyramidsLevels->text().trimmed() );
143 tmpStr += QString::number( i ) +
" ";
145 mySettings.setValue( prefix +
"overviewList", tmpStr.trimmed() );
147 mSaveOptionsWidget->apply();
159 lePyramidsLevels->setEnabled( toggled );
167 mSaveOptionsWidget->setEnabled( index != 2 );
178 if ( cbxPyramidsLevelsCustom->isChecked() )
181 foreach ( QString lev, lePyramidsLevels->text().trimmed().split(
" ", QString::SkipEmptyParts ) )
184 int tmpInt = lev.toInt();
187 QgsDebugMsg(
"tmpInt= " + QString::number( tmpInt ) );