Skip to content

Commit

Permalink
Improve decision logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Dec 31, 2024
1 parent caa0fbd commit 39ab126
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qt/statementwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,17 @@ void StatementWindow::parse()
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Parse"));
msgBox.setText(tr("%1 successful tests, %2 warnings, %3 errors.").arg(infos).arg(warnings).arg(errors));
QAbstractButton* visualizeButton;
if (errors>0) {
QAbstractButton* myButton;
if (!diagram_defined) {
msgBox.setIcon(QMessageBox::Critical);
visualizeButton = msgBox.addButton(tr("Back to Editor"), QMessageBox::AcceptRole);
myButton = msgBox.addButton(tr("Back to Editor"), QMessageBox::AcceptRole);
} else {
if (warnings>0) {
msgBox.setIcon(QMessageBox::Warning);
} else {
msgBox.setIcon(QMessageBox::Information);
}
visualizeButton = msgBox.addButton(tr("Visualize"), QMessageBox::AcceptRole);
myButton = msgBox.addButton(tr("Visualize"), QMessageBox::AcceptRole);
}

msgBox.setDetailedText(details);
Expand All @@ -152,7 +152,7 @@ void StatementWindow::parse()

int ret = msgBox.exec();

if (msgBox.clickedButton() == visualizeButton && errors == 0) {
if (msgBox.clickedButton() == myButton && diagram_defined) {
showSvg();
}
#endif
Expand Down

0 comments on commit 39ab126

Please sign in to comment.