+ do not close placement dialog if an error occured when pressing OK

This commit is contained in:
wmayer 2014-06-07 20:14:00 +02:00
parent 92a565f6ac
commit 32f509cba1
2 changed files with 13 additions and 5 deletions

View File

@ -288,13 +288,18 @@ void Placement::reject()
void Placement::accept()
{
on_applyButton_clicked();
revertTransformation();
QDialog::accept();
if (onApply()) {
revertTransformation();
QDialog::accept();
}
}
void Placement::on_applyButton_clicked()
{
onApply();
}
bool Placement::onApply()
{
//only process things when we have valid inputs!
if (!hasValidInputs()) {
@ -302,7 +307,7 @@ void Placement::on_applyButton_clicked()
msg.setIcon(QMessageBox::Critical);
msg.setText(tr("There are input fields with incorrect input, please ensure valid placement values!"));
msg.exec();
return;
return false;
}
// If there are listeners to the 'placementChanged' signal we rely
@ -324,6 +329,8 @@ void Placement::on_applyButton_clicked()
(*it)->blockSignals(false);
}
}
return true;
}
void Placement::on_resetButton_clicked()

View File

@ -65,6 +65,7 @@ private Q_SLOTS:
void on_resetButton_clicked();
private:
bool onApply();
void setPlacementData(const Base::Placement&);
Base::Placement getPlacementData() const;
QString getPlacementString() const;