]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #144 Proper update of property pannel title
authorsbh <sergey.belash@opencascade.com>
Thu, 25 Sep 2014 14:32:39 +0000 (18:32 +0400)
committersbh <sergey.belash@opencascade.com>
Thu, 25 Sep 2014 14:32:39 +0000 (18:32 +0400)
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_Workshop.cpp

index b47463fc6589dcc1ec4305c0be76f34ea72e381d..80b540a2443e5272a339af7125e1712e5747d1bb 100644 (file)
@@ -26,9 +26,16 @@ ModuleBase_Operation* XGUI_OperationMgr::currentOperation() const
   return myOperations.count() > 0 ? myOperations.last() : 0;
 }
 
+bool XGUI_OperationMgr::isCurrentOperation(ModuleBase_Operation* theOperation)
+{
+  if(!hasOperation())
+    return false;
+  return currentOperation() == theOperation;
+}
+
 bool XGUI_OperationMgr::hasOperation() const
 {
-  return (myOperations.count() > 0) && (myOperations.last() != NULL);
+  return !myOperations.isEmpty() && (myOperations.last() != NULL);
 }
 
 int XGUI_OperationMgr::operationsCount() const
index b028731a4f3319cd6d89abf311be15ee08181d06..6307ce44d6373cdce138fbf2f966ff2aa86b06d4 100644 (file)
@@ -37,6 +37,9 @@ Q_OBJECT
   /// Returns the current operation or NULL
   /// \return the current operation
   ModuleBase_Operation* currentOperation() const;
+  /// Check if the given operation is active operation.
+  /// Also, returns false is ther is no active operation.
+  bool isCurrentOperation(ModuleBase_Operation* theOperation);
   /// Returns true is operation manager has at least one non-null operation.
   bool hasOperation() const;
   /// Returns number of operations in the stack
index a44680d89d8307c1c670cd5a20c654ee37143bed..899c2322766f83d562da8bb799aa65db6fc8f6eb 100644 (file)
@@ -505,7 +505,11 @@ void XGUI_Workshop::onOperationStarted()
 
     myPropertyPanel->setModelWidgets(aWidgets);
     myPropertyPanel->onActivateNextWidget(NULL);
-    myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
+    // Widget activation (from the previous method) may commit the current operation
+    // if pre-selection is enougth for it. So we shouldn't update prop panel's title
+    if(myOperationMgr->isCurrentOperation(aOperation)) {
+      myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
+    }
   }
   updateCommandStatus();
 }