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
/// 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
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();
}