]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Module.cpp
Salome HOME
1. Create->Edit->Create is realized as 2 transaction: for the first pair the setEditO...
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 16119db3758f6b2554a5c00534d00f0b2add6282..fbde087ade0045543aaa232504dbbd2b770887d3 100755 (executable)
@@ -132,7 +132,6 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   XGUI_Workshop* aWorkshop = aConnector->workshop();
 
   XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
-  connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
   connect(anOpMgr, SIGNAL(operationActivatedByPreselection()),
           this, SLOT(onOperationActivatedByPreselection()));
 
@@ -269,6 +268,9 @@ void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation)
 
 void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
 {
+  /// Restart sketcher operations automatically
+  mySketchReentrantMgr->operationStarted(theOperation);
+
   if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
     mySketchMgr->startSketch(theOperation);
   }
@@ -461,7 +463,14 @@ void PartSet_Module::clearViewer()
 
 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
 {
-  mySketchReentrantMgr->propertyPanelDefined(theOperation);
+  ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+  if (!aFOperation)
+    return;
+
+  ModuleBase_IPropertyPanel* aPanel = aFOperation->propertyPanel();
+  // we have to manually activate the sketch label in edit mode
+  if (PartSet_SketcherMgr::isSketchOperation(aFOperation) &&  (aFOperation->isEditOperation()))
+    aPanel->activateWidget(aPanel->modelWidgets().first());
 }
 
 
@@ -505,11 +514,6 @@ void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* the
   anOpMgr->onKeyReleased(theEvent);
 }
 
-void PartSet_Module::onEnterReleased()
-{
-  mySketchReentrantMgr->enterReleased();
-}
-
 void PartSet_Module::onOperationActivatedByPreselection()
 {
   if (!mySketchReentrantMgr->canBeCommittedByPreselection())
@@ -586,7 +590,7 @@ ModuleBase_ModelWidget* PartSet_Module::activeWidget() const
 {
   ModuleBase_ModelWidget* anActiveWidget = 0;
 
-  anActiveWidget = mySketchReentrantMgr->activeWidget();
+  anActiveWidget = mySketchReentrantMgr->internalActiveWidget();
   if (!anActiveWidget) {
     ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
     if (aOperation) {