+ do not close placement dialog if an error occured when pressing OK
This commit is contained in:
parent
92a565f6ac
commit
32f509cba1
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user