]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Optimization of code for transparency change
authorvsv <vsv@opencascade.com>
Mon, 2 Sep 2019 08:52:31 +0000 (11:52 +0300)
committervsv <vsv@opencascade.com>
Mon, 2 Sep 2019 08:52:31 +0000 (11:52 +0300)
src/XGUI/XGUI_Workshop.cpp

index 520bd427c249f4329e1ec026a209900a196cee56..319b9fa48be8e9e4e6462a74797e6a260866e5f5 100644 (file)
@@ -2460,16 +2460,16 @@ void XGUI_Workshop::changeTransparency(const QObjectPtrList& theObjects)
   QString aDescription = contextMenuMgr()->action("TRANSPARENCY_CMD")->text();
   aMgr->startOperation(aDescription.toStdString());
 
-  if (aDlg->exec() != QDialog::Accepted) {
+  if (aDlg->exec() == QDialog::Accepted) {
+    // 4. set the value to all results
+    aCurrentValue = aTransparencyWidget->getValue();
+    setTransparency(aCurrentValue, theObjects);
+    aMgr->finishOperation();
+  } else {
     aMgr->abortOperation();
     Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
-    return;
   }
-  // 4. set the value to all results
-  aCurrentValue = aTransparencyWidget->getValue();
-  setTransparency(aCurrentValue, theObjects);
 
-  aMgr->finishOperation();
   updateCommandStatus();
 }