X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Operation.cpp;h=b3bf0b07572308f26b62a2fc2c177a4ae2eb24dc;hb=28c90c232ffe159b88edd156286a398bfa3bb73b;hp=a28d62d88e7dcc089b03b95b41beaf2412c84254;hpb=164361234cb019c478ad6f254b27a6c9cd799337;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index a28d62d88..b3bf0b075 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -221,7 +221,13 @@ bool ModuleBase_Operation::commit() disconnect(myPropertyPanel, 0, this, 0); stopOperation(); - ModelAPI_Session::get()->finishOperation(); + // check whether there are modifications performed during the current operation + // in the model + // in case if there are no modifications, do not increase the undo/redo stack + if (ModelAPI_Session::get()->isModified()) + ModelAPI_Session::get()->finishOperation(); + else + ModelAPI_Session::get()->abortOperation(); emit stopped(); @@ -248,7 +254,7 @@ bool ModuleBase_Operation::activateByPreselection() if (aWidgets.empty()) return false; - ModuleBase_ModelWidget* aWgt; + ModuleBase_ModelWidget* aWgt, *aFilledWgt = 0; ModuleBase_ViewerPrs aPrs; QList::const_iterator aWIt; QList::const_iterator aPIt; @@ -266,14 +272,23 @@ bool ModuleBase_Operation::activateByPreselection() if (!aWgt->setValue(&aValue)) { isSet = false; break; - } else + } else { isSet = true; + aFilledWgt = aWgt; + } } if (isSet && canBeCommitted()) { // if all widgets are filled with selection commit(); return true; } + else { + //activate next widget + if (aFilledWgt) { + myPropertyPanel->activateNextWidget(aFilledWgt); + return true; + } + } //ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget(); //if ((myPreSelection.size() > 0) && aActiveWgt) {