Skip to content

Commit

Permalink
ticket:4305 The Esc key should trigger "Fix error(s) manually".
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Mar 13, 2017
1 parent 385b2dd commit feadabe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion OMEdit/OMEditGUI/Editors/CompositeModelEditor.cpp
Expand Up @@ -79,8 +79,9 @@ bool CompositeModelEditor::validateText()
pMessageBox->setText(GUIMessages::getMessage(GUIMessages::ERROR_IN_TEXT).arg("Composite Model")
.append(GUIMessages::getMessage(GUIMessages::CHECK_MESSAGES_BROWSER))
.append(GUIMessages::getMessage(GUIMessages::REVERT_PREVIOUS_OR_FIX_ERRORS_MANUALLY)));
pMessageBox->addButton(Helper::fixErrorsManually, QMessageBox::AcceptRole);
QPushButton *pAcceptRoleButton = pMessageBox->addButton(Helper::fixErrorsManually, QMessageBox::AcceptRole);
pMessageBox->addButton(Helper::revertToLastCorrectVersion, QMessageBox::RejectRole);
pMessageBox->setEscapeButton(pAcceptRoleButton);
// we set focus to this widget here so when the error dialog is closed Qt gives back the focus to this widget.
mpPlainTextEdit->setFocus(Qt::ActiveWindowFocusReason);
int answer = pMessageBox->exec();
Expand Down
3 changes: 2 additions & 1 deletion OMEdit/OMEditGUI/Editors/ModelicaEditor.cpp
Expand Up @@ -138,8 +138,9 @@ bool ModelicaEditor::validateText(LibraryTreeItem **pLibraryTreeItem)
pMessageBox->setText(GUIMessages::getMessage(GUIMessages::ERROR_IN_TEXT).arg("Modelica")
.append(GUIMessages::getMessage(GUIMessages::CHECK_MESSAGES_BROWSER))
.append(GUIMessages::getMessage(GUIMessages::REVERT_PREVIOUS_OR_FIX_ERRORS_MANUALLY)));
pMessageBox->addButton(Helper::fixErrorsManually, QMessageBox::AcceptRole);
QPushButton *pAcceptRoleButton = pMessageBox->addButton(Helper::fixErrorsManually, QMessageBox::AcceptRole);
pMessageBox->addButton(Helper::revertToLastCorrectVersion, QMessageBox::RejectRole);
pMessageBox->setEscapeButton(pAcceptRoleButton);
// we set focus to this widget here so when the error dialog is closed Qt gives back the focus to this widget.
mpPlainTextEdit->setFocus(Qt::ActiveWindowFocusReason);
int answer = pMessageBox->exec();
Expand Down

0 comments on commit feadabe

Please sign in to comment.