]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #6 uncheck only one aborted operation, not all nested stack
authorsbh <sergey.belash@opencascade.com>
Tue, 6 May 2014 06:35:08 +0000 (10:35 +0400)
committersbh <sergey.belash@opencascade.com>
Tue, 6 May 2014 06:35:08 +0000 (10:35 +0400)
src/ModuleBase/ModuleBase_WidgetPoint2D.cpp
src/XGUI/XGUI_ActionsMgr.cpp
src/XGUI/XGUI_ActionsMgr.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_Workshop.cpp

index 35c91813defbf7661819e59ab219276b47e62289..d0ce1b11e50e5d7266f83a467664d6049494a1a0 100644 (file)
@@ -66,7 +66,9 @@ bool ModuleBase_WidgetPoint2D::storeValue(boost::shared_ptr<ModelAPI_Feature> th
   boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
     boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(myFeatureAttributeID));
 
+  bool isBlocked = this->blockSignals(true);
   aPoint->setValue(myXSpin->value(), myYSpin->value());
+  this->blockSignals(isBlocked);
   return true;
 }
 
index 6eac9883a9ca342fa3a299b7d9d5c3d4094d2b54..46b15993acda2bb84d885ceb361dfed832cab112 100644 (file)
@@ -88,6 +88,14 @@ void XGUI_ActionsMgr::restoreCommandState()
   }
 }
 
+void XGUI_ActionsMgr::updateAction(const QString& theId)
+{
+  if(myActions.contains(theId)){
+    myActions[theId]->setEnabled(myActionsState[theId]);
+    myActions[theId]->setChecked(false);
+  }
+}
+
 void XGUI_ActionsMgr::setNestedActionsEnabled(bool isEnabled)
 {
   foreach(QString eachKey, myNestedActions) {
index 336af1a0b6a463d1f9a74e8da1577790299c7aea..fe80fa21e04bf89ea00e378f7865cd484fb49c20 100644 (file)
@@ -34,6 +34,7 @@ public:
   void saveCommandsState();
   void restoreCommandState();
 
+  void updateAction(const QString&);
   void setNestedActionsEnabled(bool);
 
 public slots:
index 4f4caf21c12df41058049b9bed3659568ee3374b..7119a8fa19cbf726c364190dd736e9d70cef6f74 100644 (file)
@@ -27,6 +27,11 @@ bool XGUI_OperationMgr::hasOperation() const
   return (myOperations.count() > 0) && (myOperations.last() != NULL);
 }
 
+int XGUI_OperationMgr::operationsCount() const
+{
+  return myOperations.count();
+}
+
 bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation)
 {
   if (!canStartOperation(theOperation))
index e3f653cca115b719d6eb138d3d4f00f320915112..fc6214d56748e7772dd6e86cf64935ee3243cab8 100644 (file)
@@ -36,6 +36,8 @@ public:
   ModuleBase_Operation* currentOperation() const;
   /// Returns true is operation manager has at least one non-null operation.
   bool hasOperation() const;
+  /// Returns number of operations in the stack
+  int operationsCount() const;
   /// Start the operation and append it to the stack of operations
   /// \param theOperation the started operation
   /// \return the state whether the current operation is started
index a956d04871e44558890fa789101dde8871002dd2..112f3bd1d41a0d8c2e9ec58f0e1897734ecf7115 100644 (file)
@@ -246,11 +246,14 @@ void XGUI_Workshop::onOperationStopped(ModuleBase_Operation* theOperation)
 {
   ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
 
-  if(aOperation->getDescription()->xmlRepresentation().isEmpty()) { //!< No need for property panel
-    updateCommandStatus();
-  } else {
-    hidePropertyPanel();
-    updateCommandStatus();
+  //!< No need for property panel
+  updateCommandStatus();
+  hidePropertyPanel();
+  if(myOperationMgr->operationsCount() > 1) {
+    myActionsMgr->updateAction(theOperation->getDescription()->operationId());
+    return;
+  }
+  if(!aOperation->getDescription()->xmlRepresentation().isEmpty()) { 
     myActionsMgr->restoreCommandState();
   }
 }