From: nds Date: Wed, 4 Oct 2017 08:19:44 +0000 (+0300) Subject: Message box should not be opened again after Escape key click. X-Git-Tag: V_2.9.0~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fb27d5394a828d2fa895db6a8a643593913b9dc0;p=modules%2Fshaper.git Message box should not be opened again after Escape key click. --- diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 12a9e1bd6..abb8d3e28 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -241,11 +241,9 @@ bool XGUI_OperationMgr::abortAllOperations(const XGUI_MessageKind& theMessageKin } else { if (theMessageKind == XGUI_AbortOperationMessage) { - aResult = QMessageBox::question(qApp->activeWindow(), - tr("Abort operation"), - tr("All active operations will be aborted."), - QMessageBox::Ok | QMessageBox::Cancel, - QMessageBox::Cancel) == QMessageBox::Ok; + myActiveMessageBox = createMessageBox(tr("All active operations will be aborted.")); + aResult = myActiveMessageBox->exec() == QMessageBox::Ok; + myActiveMessageBox = 0; } else if (theMessageKind == XGUI_InformationMessage) { QString aMessage = tr("Please validate all your active operations before saving."); @@ -332,11 +330,9 @@ bool XGUI_OperationMgr::canStopOperation(ModuleBase_Operation* theOperation, if (theOperation && theOperation->isModified()) { if (theMessageKind == XGUI_AbortOperationMessage) { QString aMessage = tr("%1 operation will be aborted.").arg(theOperation->id()); - int anAnswer = QMessageBox::question(qApp->activeWindow(), - tr("Abort operation"), - aMessage, - QMessageBox::Ok | QMessageBox::Cancel, - QMessageBox::Cancel); + myActiveMessageBox = createMessageBox(aMessage); + int anAnswer = myActiveMessageBox->exec() == QMessageBox::Ok; + myActiveMessageBox = 0; return anAnswer == QMessageBox::Ok; } else if (theMessageKind == XGUI_InformationMessage) {