]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_Workshop.cpp
Salome HOME
Issue #2353: Correct misprint and provide undo/redo by selection in Undo/Redo list
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index d93b451c6d47512d9191adcb9e3150b69a0f49de..495ecfc29005968f092e473a11e34002e99d46d3 100755 (executable)
 #include <ModuleBase_WidgetValidated.h>
 #include <ModuleBase_ModelWidget.h>
 #include <ModuleBase_ResultPrs.h>
+#include <ModuleBase_ActionIntParameter.h>
 
 #include <Config_Common.h>
 #include <Config_FeatureMessage.h>
@@ -1023,8 +1024,11 @@ bool XGUI_Workshop::onSaveAs()
 void XGUI_Workshop::onUndo(int theTimes)
 {
   ModuleBase_ModelWidget* anActiveWidget = myOperationMgr->activeWidget();
-  if (anActiveWidget && anActiveWidget->processAction(ActionUndo))
-    return;
+  if (anActiveWidget) {
+    ActionIntParamPtr aParam(new ModuleBase_ActionIntParameter(theTimes));
+    if (anActiveWidget->processAction(ActionUndo, aParam))
+      return;
+  }
 
   objectBrowser()->treeView()->setCurrentIndex(QModelIndex());
   SessionPtr aMgr = ModelAPI_Session::get();
@@ -1051,8 +1055,11 @@ void XGUI_Workshop::onUndo(int theTimes)
 void XGUI_Workshop::onRedo(int theTimes)
 {
   ModuleBase_ModelWidget* anActiveWidget = myOperationMgr->activeWidget();
-  if (anActiveWidget && anActiveWidget->processAction(ActionRedo))
-    return;
+  if (anActiveWidget) {
+    ActionIntParamPtr aParam(new ModuleBase_ActionIntParameter(theTimes));
+    if (anActiveWidget->processAction(ActionRedo, aParam))
+      return;
+  }
 
   // the viewer update should be blocked in order to avoid the features blinking. For the created
   // feature a results are created, the flush of the created signal caused the viewer redisplay for