From: vsv Date: Mon, 2 Sep 2019 08:52:31 +0000 (+0300) Subject: Optimization of code for transparency change X-Git-Tag: VEDF2019Lot4~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b7dfc70623b482521b6edd9ac64e632793b04a3d;p=modules%2Fshaper.git Optimization of code for transparency change --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 520bd427c..319b9fa48 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -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(); }