12 #include <QFileDialog>
23 this->noDataValueEdit->setValidator(no_data_validator);
25 this->staticValueEdit->setValidator(static_value_validator);
30 this->noDataValueEdit->setEnabled(!isChecked);
35 this->rasterPathEdit->setEnabled(isChecked);
36 this->ignoreNoDataCheckbox->setEnabled(isChecked);
37 this->noDataValueEdit->setEnabled(isChecked &&
38 !this->ignoreNoDataCheckbox->isChecked());
39 this->rasterSelectButton->setEnabled(isChecked);
40 this->staticValueEdit->setEnabled(!isChecked);
46 QString filename = QFileDialog::getOpenFileName(
47 this,
"Select raster file to open",
48 settings.value(
"lastOpenedRasterFileDirectory").toString(),
49 "ASCII raster files (*.asc);;All files (* *.*)");
50 this->rasterPathEdit->setText(filename);
51 QFileInfo fi(filename);
52 settings.setValue(
"lastOpenedRasterFileDirectory", fi.absolutePath());
57 if (this->rasterValueButton->isChecked() &&
58 this->rasterPathEdit->text().isEmpty())
63 if (this->rasterValueButton->isChecked() &&
64 !this->ignoreNoDataCheckbox->isChecked() &&
65 this->noDataValueEdit->text().isEmpty())
70 if (this->staticValueButton->isChecked() &&
71 this->staticValueEdit->text().isEmpty())
76 if (this->newNameEdit->text().isEmpty())
78 OGSError::box(
"Please specify a name for the resulting mesh.");
81 if (this->noDataValueEdit->text().isEmpty())
83 this->noDataValueEdit->setText(
"0.0");
86 this->done(QDialog::Accepted);
Definition of the OGSError class.
Implementation of the StrictDoubleValidator class.
void on_rasterValueButton_toggled(bool isChecked)
void on_ignoreNoDataCheckbox_toggled(bool isChecked)
void on_rasterSelectButton_pressed()
void accept() override
Instructions if the OK-Button has been pressed.
MeshMapping2DDialog(QDialog *parent=nullptr)
static void box(const QString &e)
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow