]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Message box should not be opened again after Escape key click.
authornds <nds@opencascade.com>
Wed, 4 Oct 2017 08:19:44 +0000 (11:19 +0300)
committernds <nds@opencascade.com>
Wed, 4 Oct 2017 08:19:44 +0000 (11:19 +0300)
src/XGUI/XGUI_OperationMgr.cpp

index 12a9e1bd6affdfe992e3b9e381f8186b78e9caf2..abb8d3e283795dacf2d0f9501a78cba3560edd76 100644 (file)
@@ -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) {