Salome HOME
Make property panel as a GUI of an operation
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 3 Oct 2014 12:03:41 +0000 (16:03 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 3 Oct 2014 12:03:41 +0000 (16:03 +0400)
25 files changed:
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_IPropertyPanel.h [new file with mode: 0644]
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_OperationFeatureBase.cpp
src/PartSet/PartSet_OperationFeatureBase.h
src/PartSet/PartSet_OperationFeatureCreate.cpp
src/PartSet/PartSet_OperationFeatureCreate.h
src/PartSet/PartSet_OperationFeatureEdit.cpp
src/PartSet/PartSet_OperationFeatureEdit.h
src/PartSet/PartSet_OperationFeatureEditMulti.cpp
src/PartSet/PartSet_OperationFeatureEditMulti.h
src/PartSet/PartSet_OperationSketch.cpp
src/PartSet/PartSet_OperationSketch.h
src/PartSet/PartSet_OperationSketchBase.cpp
src/PartSet/PartSet_OperationSketchBase.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_Workshop.cpp

index 92a73fce80e60960a3b494f7c02e29c0acd98a04..ba568428eb6b8f6ece19747ad1f4760befcb1ba5 100644 (file)
@@ -27,6 +27,7 @@ SET(PROJECT_HEADERS
        ModuleBase_WidgetChoice.h
        ModuleBase_WidgetFileSelector.h
        ModuleBase_DoubleSpinBox.h
+       ModuleBase_IPropertyPanel.h
 )
 
 SET(PROJECT_SOURCES
index 6404849276d5534225e3a22a4b5572708913cf2e..df599f4164206b737eda23c0387b74f14cc1e11b 100644 (file)
@@ -49,4 +49,4 @@ typedef ModuleBase_IModule* (*CREATE_FUNC)(XGUI_Workshop*);
 \r
 #define CREATE_MODULE "createModule"\r
 \r
-#endif //ModuleBase_IModule\r
\ No newline at end of file
+#endif //ModuleBase_IModule\r
diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h
new file mode 100644 (file)
index 0000000..b43a3d4
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * ModuleBase_IPropertyPanel.h
+ *
+ *  Created on: Oct 01, 2014
+ *      Author: vsv
+ */
+
+#ifndef ModuleBase_PROPERTYPANEL_H_
+#define ModuleBase_PROPERTYPANEL_H_
+
+#include "ModuleBase.h"
+
+#include <QDockWidget>
+#include <QKeyEvent>
+
+class ModuleBase_ModelWidget;
+
+class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
+{
+Q_OBJECT
+public:
+  ModuleBase_IPropertyPanel(QWidget* theParent) : QDockWidget(theParent) {}
+
+  /// Returns currently active widget
+  virtual ModuleBase_ModelWidget* activeWidget() const = 0;
+
+signals:
+  /// The signal about key release on the control, that corresponds to the attribute
+  /// \param theEvent key release event
+  void keyReleased(QKeyEvent* theEvent);
+  /// The signal about the widget activation
+  /// \param theWidget the activated widget
+  void widgetActivated(ModuleBase_ModelWidget* theWidget);
+
+public slots:
+  /// Activate the next widget in the property panel
+  /// \param theWidget a widget. The next widget should be activated
+  virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget) = 0;
+
+  /// Activate the next from current widget in the property panel
+  virtual void activateNextWidget() = 0;
+};
+
+#endif
\ No newline at end of file
index ec6c0e1e680ca86147122b361047136981795d44..718ded61a83a8b56f2667c16d895507ac81540d0 100644 (file)
@@ -9,6 +9,9 @@
 
 #include "ModuleBase_OperationDescription.h"
 #include "ModuleBase_ModelWidget.h"
+#include "ModuleBase_WidgetValueFeature.h"
+#include "ModuleBase_ViewerPrs.h"
+#include "ModuleBase_IPropertyPanel.h"
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Document.h>
@@ -19,6 +22,8 @@
 #include <ModelAPI_Result.h>
 #include <ModelAPI_Validator.h>
 
+#include <GeomAPI_Pnt2d.h>
+
 #include <Events_Loop.h>
 
 #ifdef _DEBUG
@@ -28,7 +33,8 @@
 ModuleBase_Operation::ModuleBase_Operation(const QString& theId, QObject* theParent)
     : QObject(theParent),
       myIsEditing(false),
-      myIsModified(false)
+      myIsModified(false),
+      myPropertyPanel(NULL)
 {
   myDescription = new ModuleBase_OperationDescription(theId);
 }
@@ -78,16 +84,10 @@ void ModuleBase_Operation::storeCustomValue()
     aCustom->storeValue();
 }
 
-void ModuleBase_Operation::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
-{
-}
-
 void ModuleBase_Operation::startOperation()
 {
   if (!myIsEditing)
     createFeature();
-  //emit callSlot();
-  //commit();
 }
 
 void ModuleBase_Operation::stopOperation()
@@ -145,11 +145,6 @@ FeaturePtr ModuleBase_Operation::createFeature(const bool theFlushMessage)
 void ModuleBase_Operation::setFeature(FeaturePtr theFeature)
 {
   myFeature = theFeature;
-}
-
-void ModuleBase_Operation::setEditingFeature(FeaturePtr theFeature)
-{
-  setFeature(theFeature);
   myIsEditing = true;
 }
 
@@ -186,6 +181,9 @@ void ModuleBase_Operation::start()
 
 void ModuleBase_Operation::resume()
 {
+  if (myPropertyPanel)
+    connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), this,
+            SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
   emit resumed();
 }
 
@@ -193,6 +191,8 @@ void ModuleBase_Operation::abort()
 {
   abortOperation();
   emit aborted();
+  if (myPropertyPanel)
+    disconnect(myPropertyPanel, 0, this, 0);
 
   stopOperation();
 
@@ -206,6 +206,9 @@ bool ModuleBase_Operation::commit()
     commitOperation();
     emit committed();
 
+  if (myPropertyPanel)
+    disconnect(myPropertyPanel, 0, this, 0);
+
     stopOperation();
 
     ModelAPI_Session::get()->finishOperation();
@@ -223,3 +226,65 @@ void ModuleBase_Operation::setRunning(bool theState)
     abort();
   }
 }
+
+void ModuleBase_Operation::activateByPreselection()
+{
+  if (!myPropertyPanel)
+    return;
+  ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+  if ((myPreSelection.size() > 0) && aActiveWgt) {
+    const ModuleBase_ViewerPrs& aPrs = myPreSelection.front();
+    ModuleBase_WidgetValueFeature aValue;
+    aValue.setObject(aPrs.object());
+    if (aActiveWgt->setValue(&aValue)) {
+      myPreSelection.remove(aPrs);
+      if(isValid()) {
+        //myActiveWidget = NULL;
+        commit();
+      } else {
+        myPropertyPanel->activateNextWidget();
+        //emit activateNextWidget(myActiveWidget);
+      }
+    }
+    // If preselection is enough to make a valid feature - apply it immediately
+  }
+}
+
+void ModuleBase_Operation::initSelection(
+    const std::list<ModuleBase_ViewerPrs>& theSelected,
+    const std::list<ModuleBase_ViewerPrs>& /*theHighlighted*/)
+{
+  myPreSelection = theSelected;
+}
+
+void ModuleBase_Operation::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+{
+  activateByPreselection();
+  //if (theWidget && myPropertyPanel) {
+  //  myPropertyPanel->activateNextWidget();
+  ////  //emit activateNextWidget(myActiveWidget);
+  //}
+}
+
+bool ModuleBase_Operation::setWidgetValue(ObjectPtr theFeature, double theX, double theY)
+{
+  ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+  if (!aActiveWgt)
+    return false;
+  ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature();
+  aValue->setObject(theFeature);
+  aValue->setPoint(boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY)));
+  bool isApplyed = aActiveWgt->setValue(aValue);
+
+  delete aValue;
+  myIsModified = (myIsModified || isApplyed);
+  return isApplyed;
+}
+
+
+void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) 
+{ 
+  myPropertyPanel = theProp; 
+  connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), this,
+          SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
+}
index b73ba4726c19f8cc50f4ef4f4cffb14bae817595..910bd6eaed26dfdee57c11bfbbeb69bfd20c40af 100644 (file)
@@ -9,18 +9,18 @@
 #define ModuleBase_Operation_H
 
 #include <ModuleBase.h>
+#include <ModuleBase_ViewerPrs.h>
 
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_Document.h>
 
 #include <QObject>
 #include <QString>
 #include <QStringList>
 
-#include <boost/shared_ptr.hpp>
-
-class ModelAPI_Document;
 class ModuleBase_ModelWidget;
 class ModuleBase_OperationDescription;
+class ModuleBase_IPropertyPanel;
 
 class QKeyEvent;
 
@@ -102,19 +102,27 @@ Q_OBJECT
   virtual bool isNestedOperationsEnabled() const;
 
   /// Sets the operation feature
-  void setEditingFeature(FeaturePtr theFeature);
+  void setFeature(FeaturePtr theFeature);
 
   /// Returns True if the current operation works with the given object (feature or result)
   virtual bool hasObject(ObjectPtr theObj) const;
 
   virtual void keyReleased(const int theKey) {};
 
-  virtual void activateNextToCurrentWidget() {};
-
   /// If operation needs to redisplay its result during operation
   /// then this method has to return True
   virtual bool hasPreview() const { return false; }
 
+  /// Initialisation of operation with preliminary selection
+  /// \param theSelected the list of selected presentations
+  /// \param theHighlighted the list of highlighted presentations
+  virtual void initSelection(const std::list<ModuleBase_ViewerPrs>& theSelected,
+                             const std::list<ModuleBase_ViewerPrs>& theHighlighted);
+
+  virtual void setPropertyPanel(ModuleBase_IPropertyPanel* theProp);
+
+  ModuleBase_IPropertyPanel* propertyPanel() const { return myPropertyPanel; }
+
 signals:
   void started();  /// the operation is started
   void aborted();  /// the operation is aborted
@@ -122,10 +130,6 @@ signals:
   void stopped();  /// the operation is aborted or committed
   void resumed();  /// the operation is resumed
 
-  /// Signals about the activating of the next widget
-  /// \param theWidget the previous active widget
-  void activateNextWidget(ModuleBase_ModelWidget* theWidget);
-
  public slots:
   /// Starts operation
   /// Public slot. Verifies whether operation can be started and starts operation.
@@ -191,9 +195,6 @@ signals:
   /// \returns the created feature
   virtual FeaturePtr createFeature(const bool theFlushMessage = true);
 
-  /// Sets the operation feature
-  void setFeature(FeaturePtr theFeature);
-
   /// Verifies whether this operator can be commited.
   /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
   virtual bool canBeCommitted() const;
@@ -201,6 +202,15 @@ signals:
   /// Returns pointer to the root document.
   boost::shared_ptr<ModelAPI_Document> document() const;
 
+  ///
+  virtual void activateByPreselection();
+
+  /// Set value to the active widget
+  /// \param theFeature the feature
+  /// \param theX the horizontal coordinate
+  /// \param theY the vertical coordinate
+  /// \return true if the point is set
+  virtual bool setWidgetValue(ObjectPtr theFeature, double theX, double theY);
 
  protected:
   FeaturePtr myFeature;  /// the operation feature to be handled
@@ -217,6 +227,11 @@ signals:
   /// List of nested operations IDs
   QStringList myNestedFeatures;
 
+  /// List of pre-selected object 
+  std::list<ModuleBase_ViewerPrs> myPreSelection;
+
+  /// Access to property panel
+  ModuleBase_IPropertyPanel* myPropertyPanel;
 };
 
 #endif
index fcd287c550aa76f95be3b69a00ddccffd1374d3e..36c1efd1a6db36668c5a789ae95eb3bf8e640b72 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "ModuleBase_WidgetShapeSelector.h"
 #include "ModuleBase_IWorkshop.h"
+#include "ModuleBase_WidgetValue.h"
+#include "ModuleBase_WidgetValueFeature.h"
 
 #include <Events_Loop.h>
 #include <ModelAPI_Events.h>
@@ -72,6 +74,7 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen
   myTextLine = new QLineEdit(myContainer);
   myTextLine->setReadOnly(true);
   myTextLine->setToolTip(aToolTip);
+  myTextLine->installEventFilter(this);
 
   myBasePalet = myTextLine->palette();
   myInactivePalet = myBasePalet;
@@ -146,22 +149,28 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged()
     if (!isAccepted(aObject))
       return;
 
-    mySelectedObject = aObject;
-    if (mySelectedObject) {
-      updateSelectionName();
-      raisePanel();
-      static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TOHIDE);
-      ModelAPI_EventCreator::get()->sendUpdated(mySelectedObject, anEvent);
-      Events_Loop::loop()->flush(anEvent);
-    } else {
-      myTextLine->setText("");
-    }
-    activateSelection(false);
-    emit valuesChanged();
-    emit focusOutWidget(this);
+    setObject(aObject);
   }
 }
 
+//********************************************************************
+void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObj)
+{
+  if (mySelectedObject == theObj)
+    return;
+  mySelectedObject = theObj;
+  if (mySelectedObject) {
+    raisePanel();
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_TOHIDE);
+    ModelAPI_EventCreator::get()->sendUpdated(mySelectedObject, anEvent);
+    Events_Loop::loop()->flush(anEvent);
+  } 
+  updateSelectionName();
+  activateSelection(false);
+  emit valuesChanged();
+  emit focusOutWidget(this);
+}
+
 //********************************************************************
 bool ModuleBase_WidgetShapeSelector::isAccepted(const ObjectPtr theResult) const
 {
@@ -235,9 +244,6 @@ void ModuleBase_WidgetShapeSelector::activateSelection(bool toActivate)
     connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
   else
     disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
-
-//  if (myWorkshop->selectedObjects().size() > 0)
-//    onSelectionChanged();
 }
 
 //********************************************************************
@@ -273,3 +279,21 @@ bool ModuleBase_WidgetShapeSelector::eventFilter(QObject* theObj, QEvent* theEve
   }
   return ModuleBase_ModelWidget::eventFilter(theObj, theEvent);
 }
+
+//********************************************************************
+bool ModuleBase_WidgetShapeSelector::setValue(ModuleBase_WidgetValue* theValue)
+{
+  if (theValue) {
+    ModuleBase_WidgetValueFeature* aFeatureValue =
+        dynamic_cast<ModuleBase_WidgetValueFeature*>(theValue);
+    if (aFeatureValue && aFeatureValue->object()) {
+      ObjectPtr aObject = aFeatureValue->object();
+      if (isAccepted(aObject)) {
+        setObject(aObject);
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
index 5defe3a2e492b6ef677d894515d8eee4433204c4..c1decfa56450fdf6eb19c3aa2d1b6362a131ecbe 100644 (file)
@@ -55,7 +55,12 @@ Q_OBJECT
     return mySelectedObject;
   }
 
- public slots:
+  /// Set the given wrapped value to the current widget
+  /// This value should be processed in the widget according to the needs
+  /// \param theValue the wrapped widget value
+  virtual bool setValue(ModuleBase_WidgetValue* theValue);
+
+public slots:
 
   /// Activate or deactivate selection
   void activateSelection(bool toActivate);
@@ -71,6 +76,9 @@ private:
   void raisePanel() const;
   bool isAccepted(const ObjectPtr theObject) const;
 
+  // Set the given object as a value of the widget
+  void setObject(ObjectPtr theObj);
+
   static TopAbs_ShapeEnum shapeType(const QString& theType);
 
   QWidget* myContainer;
index b2387c238bdcc42db0e62fee2e657e99ef6fd42b..bc23a468b2f1f2537c9ca2ee6c0a70b9525dffef 100644 (file)
@@ -152,25 +152,27 @@ void PartSet_Module::onFeatureTriggered()
 void PartSet_Module::launchOperation(const QString& theCmdId)
 {
   ModuleBase_Operation* anOperation = createOperation(theCmdId.toStdString());
-  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
-  if (aPreviewOp) {
+  //PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
+  //if (aPreviewOp) {
     XGUI_Selection* aSelection = myWorkshop->selector()->selection();
     // Initialise operation with preliminary selection
     std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
     std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
-    aPreviewOp->initSelection(aSelected, aHighlighted);
-  }
+    anOperation->initSelection(aSelected, aHighlighted);
+  //}
   sendOperation(anOperation);
 }
 
 void PartSet_Module::onOperationStarted()
 {
-  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
-      ->operationMgr()->currentOperation());
+  ModuleBase_Operation* aOperation = myWorkshop->operationMgr()->currentOperation();
+
+  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(aOperation);
   if (aPreviewOp) {
     XGUI_PropertyPanel* aPropPanel = myWorkshop->propertyPanel();
     connect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)), this,
             SLOT(onStorePoint2D(ObjectPtr, const std::string&)), Qt::UniqueConnection);
+
     XGUI_Displayer* aDisplayer = myWorkshop->displayer();
     aDisplayer->openLocalContext();
     aDisplayer->deactivateObjectsOutOfContext();
@@ -210,6 +212,7 @@ void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked)
 
 void PartSet_Module::onMousePressed(QMouseEvent* theEvent)
 {
+
   PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
       ->operationMgr()->currentOperation());
   Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
@@ -296,10 +299,17 @@ void PartSet_Module::onRestartOperation(std::string theName, ObjectPtr theObject
     // Initialise operation with preliminary selection
     std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
     std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
-    aSketchOp->initFeature(aFeature);
     aSketchOp->initSelection(aSelected, aHighlighted);
+    PartSet_OperationFeatureCreate* aCreateOp = dynamic_cast<PartSet_OperationFeatureCreate*>(anOperation);
+    if (aCreateOp)
+      aCreateOp->initFeature(aFeature);
+    else {
+      PartSet_OperationFeatureEdit* aEditOp = dynamic_cast<PartSet_OperationFeatureEdit*>(anOperation);
+      if (aEditOp) 
+        anOperation->setFeature(aFeature);
+    }
   } else if (aFeature) {
-    anOperation->setEditingFeature(aFeature);
+    anOperation->setFeature(aFeature);
     //Deactivate result of current feature in order to avoid its selection
     XGUI_Displayer* aDisplayer = myWorkshop->displayer();
     std::list<ResultPtr> aResults = aFeature->results();
index c1da278fa020868570d496073c97f06c748d4924..a3eacd02428ade5b6b93262e7098461eb7eda936 100644 (file)
@@ -24,7 +24,7 @@
 #include <ModuleBase_OperationDescription.h>
 #include <ModuleBase_WidgetPoint2D.h>
 #include <ModuleBase_WidgetValueFeature.h>
-#include <ModuleBase_ViewerPrs.h>
+#include "ModuleBase_IPropertyPanel.h"
 
 #include <XGUI_Constants.h>
 
@@ -46,8 +46,7 @@ PartSet_OperationFeatureBase::PartSet_OperationFeatureBase(const QString& theId,
                                                                QObject* theParent,
                                                                FeaturePtr theFeature)
     : PartSet_OperationSketchBase(theId, theParent),
-      mySketch(theFeature),
-      myActiveWidget(NULL)
+      mySketch(theFeature)
 {
 }
 
@@ -55,18 +54,6 @@ PartSet_OperationFeatureBase::~PartSet_OperationFeatureBase()
 {
 }
 
-void PartSet_OperationFeatureBase::initSelection(
-    const std::list<ModuleBase_ViewerPrs>& theSelected,
-    const std::list<ModuleBase_ViewerPrs>& /*theHighlighted*/)
-{
-  myPreSelection = theSelected;
-}
-
-void PartSet_OperationFeatureBase::initFeature(FeaturePtr theFeature)
-{
-  myInitFeature = theFeature;
-}
-
 FeaturePtr PartSet_OperationFeatureBase::sketch() const
 {
   return mySketch;
@@ -90,7 +77,8 @@ void PartSet_OperationFeatureBase::mouseReleased(QMouseEvent* theEvent, Handle(V
         if (!aVertex.IsNull()) {
           aPoint = BRep_Tool::Pnt(aVertex);
           PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
-          PartSet_Tools::setConstraints(sketch(), feature(), myActiveWidget->attributeID(), aX, anY);
+          ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+          PartSet_Tools::setConstraints(sketch(), feature(), aActiveWgt->attributeID(), aX, anY);
         }
       } else if (aShape.ShapeType() == TopAbs_EDGE) { // a line is selected
         PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
@@ -108,53 +96,24 @@ void PartSet_OperationFeatureBase::mouseReleased(QMouseEvent* theEvent, Handle(V
   bool isApplyed = setWidgetValue(aFeature, aX, anY);
   if (isApplyed) {
     flushUpdated();
-    emit activateNextWidget(myActiveWidget);
+    myPropertyPanel->activateNextWidget();
   }
   commit();
 }
 
-void PartSet_OperationFeatureBase::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
-{
-  myActiveWidget = theWidget;
-  activateByPreselection();
-  if (myInitFeature && myActiveWidget) {
-    ModuleBase_WidgetPoint2D* aWgt = dynamic_cast<ModuleBase_WidgetPoint2D*>(myActiveWidget);
-    if (aWgt && aWgt->initFromPrevious(myInitFeature)) {
-      myInitFeature = FeaturePtr();
-      emit activateNextWidget(myActiveWidget);
-    }
-  }
-}
 
-void PartSet_OperationFeatureBase::activateByPreselection()
-{
-  if ((myPreSelection.size() > 0) && myActiveWidget) {
-    const ModuleBase_ViewerPrs& aPrs = myPreSelection.front();
-    ModuleBase_WidgetValueFeature aValue;
-    aValue.setObject(aPrs.object());
-    if (myActiveWidget->setValue(&aValue)) {
-      myPreSelection.remove(aPrs);
-      if(isValid()) {
-        myActiveWidget = NULL;
-        commit();
-      } else {
-        emit activateNextWidget(myActiveWidget);
-      }
-    }
-    // If preselection is enough to make a valid feature - apply it immediately
-  }
-}
 
-bool PartSet_OperationFeatureBase::setWidgetValue(ObjectPtr theFeature, double theX, double theY)
+/*bool PartSet_OperationFeatureBase::setWidgetValue(ObjectPtr theFeature, double theX, double theY)
 {
-  if (!myActiveWidget)
+  ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+  if (!aActiveWgt)
     return false;
   ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature();
   aValue->setObject(theFeature);
   aValue->setPoint(boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY)));
-  bool isApplyed = myActiveWidget->setValue(aValue);
+  bool isApplyed = aActiveWgt->setValue(aValue);
 
   delete aValue;
   myIsModified = (myIsModified || isApplyed);
   return isApplyed;
-}
+}*/
index 5a0c66bf0fbcd6e22d0f3d47666c61c41c3c31f9..baef75f9f53101d2fe6455937479f5afda8bea63 100644 (file)
@@ -33,15 +33,6 @@ Q_OBJECT
   /// Destructor
   virtual ~PartSet_OperationFeatureBase();
 
-  /// Initialisation of operation with preliminary selection
-  /// \param theSelected the list of selected presentations
-  /// \param theHighlighted the list of highlighted presentations
-  virtual void initSelection(const std::list<ModuleBase_ViewerPrs>& theSelected,
-                             const std::list<ModuleBase_ViewerPrs>& theHighlighted);
-
-  /// Initializes the operation with previously created feature. It is used in sequental operations
-  virtual void initFeature(FeaturePtr theFeature);
-
   /// Returns the operation sketch feature
   /// \returns the sketch instance
   virtual FeaturePtr sketch() const;
@@ -56,28 +47,16 @@ Q_OBJECT
                              const std::list<ModuleBase_ViewerPrs>& theHighlighted);
 
 
- public slots:
-  /// Slots which listen the mode widget activation
-  /// \param theWidget the model widget
-  virtual void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
-
  protected:
-  ///
- void activateByPreselection();
   /// Set value to the active widget
   /// \param theFeature the feature
   /// \param theX the horizontal coordinate
   /// \param theY the vertical coordinate
   /// \return true if the point is set
-  bool setWidgetValue(ObjectPtr theFeature, double theX, double theY);
+  //bool setWidgetValue(ObjectPtr theFeature, double theX, double theY);
 
  protected:
-  FeaturePtr myInitFeature;  ///< the initial feature
   FeaturePtr mySketch;  ///< the sketch of the feature
-  
-  ModuleBase_ModelWidget* myActiveWidget;  ///< the active widget
-
-  std::list<ModuleBase_ViewerPrs> myPreSelection;
 };
 
 #endif
index b9c2326eede96207ef4e6dc9b360acd5a17808af..2be41c48376eb721122e947e789c666bac755d30 100644 (file)
@@ -25,6 +25,7 @@
 #include <ModuleBase_WidgetPoint2D.h>
 #include <ModuleBase_WidgetValueFeature.h>
 #include <ModuleBase_ViewerPrs.h>
+#include <ModuleBase_IPropertyPanel.h>
 
 #include <XGUI_Constants.h>
 
@@ -125,7 +126,8 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle
         if (!aVertex.IsNull()) {
           aPoint = BRep_Tool::Pnt(aVertex);
           PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
-          PartSet_Tools::setConstraints(sketch(), feature(), myActiveWidget->attributeID(), aX, anY);
+          ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+          PartSet_Tools::setConstraints(sketch(), feature(), aActiveWgt->attributeID(), aX, anY);
           isClosedContour = true;
         }
       } else if (aShape.ShapeType() == TopAbs_EDGE) { // a line is selected
@@ -144,10 +146,10 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle
   bool isApplyed = setWidgetValue(aFeature, aX, anY);
   if (isApplyed) {
     flushUpdated();
-    emit activateNextWidget(myActiveWidget);
+    myPropertyPanel->activateNextWidget();
   }
 
-  if (myActiveWidget == NULL) {
+  if (!myPropertyPanel->activeWidget()) {
     if(commit() && !isClosedContour) {
       // if the point creation is finished, the next mouse release should commit the modification
       // the next release can happens by double click in the viewer
@@ -156,11 +158,6 @@ void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle
   }
 }
 
-void PartSet_OperationFeatureCreate::activateNextToCurrentWidget()
-{
-  emit activateNextWidget(myActiveWidget);
-}
-
 void PartSet_OperationFeatureCreate::startOperation()
 {
   PartSet_OperationSketchBase::startOperation();
@@ -194,11 +191,22 @@ FeaturePtr PartSet_OperationFeatureCreate::createFeature(const bool theFlushMess
 
     aFeature->addSub(aNewFeature);
   }
-  //myFeaturePrs->init(aNewFeature);
-  //myFeaturePrs->setFeature(myInitFeature, SM_FirstPoint);
 
-//TODO  emit featureConstructed(aNewFeature, FM_Activation);
   if (theFlushMessage)
     flushCreated();
   return aNewFeature;
 }
+
+
+void PartSet_OperationFeatureCreate::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+{
+  PartSet_OperationFeatureBase::onWidgetActivated(theWidget);
+  if (myInitFeature && theWidget) {
+    ModuleBase_WidgetPoint2D* aWgt = dynamic_cast<ModuleBase_WidgetPoint2D*>(theWidget);
+    if (aWgt && aWgt->initFromPrevious(myInitFeature)) {
+      myInitFeature = FeaturePtr();
+      if (myPropertyPanel)
+        myPropertyPanel->activateNextWidget();
+    }
+  }
+}
index f254b713a0f7c21ee5ab0f5bfc6a0b2e1c680235..fcd92be95f000acdbf4cb17ef4cd5c9fd1d5609d 100644 (file)
@@ -60,8 +60,13 @@ Q_OBJECT
   /// \param theKey a key value
   virtual void keyReleased(const int theKey);
 
-  /// alias for activateNextWidget(myActiveWidget);
-  virtual void activateNextToCurrentWidget();
+  /// Initializes the operation with previously created feature. It is used in sequental operations
+  void initFeature(FeaturePtr theFeature) { myInitFeature = theFeature; }
+
+ public slots:
+  /// Slots which listen the mode widget activation
+  /// \param theWidget the model widget
+  virtual void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
 
  protected:
   /// \brief Virtual method called when operation is started
@@ -90,6 +95,10 @@ Q_OBJECT
   /// Verifies whether this operator can be commited.
   /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
   virtual bool canBeCommitted() const;
+
+protected:
+  /// Feature of previous operation (for sequintal operations)
+  FeaturePtr myInitFeature;
 };
 
 #endif
index 2036d55760d69e3bf540dd47eef848aafea8f1a8..1e0932280931eaf2fd2e1ee83163e555cf1ac6c3 100644 (file)
@@ -11,6 +11,7 @@
 #include <ModuleBase_OperationDescription.h>
 #include <ModuleBase_WidgetEditor.h>
 #include <ModuleBase_ViewerPrs.h>
+#include <ModuleBase_IPropertyPanel.h>
 
 #include <ModelAPI_Events.h>
 
@@ -43,22 +44,20 @@ PartSet_OperationFeatureEdit::PartSet_OperationFeatureEdit(const QString& theId,
     : PartSet_OperationFeatureBase(theId, theParent, theFeature),
       myIsBlockedSelection(false)
 {
+  myIsEditing = true;
 }
 
 PartSet_OperationFeatureEdit::~PartSet_OperationFeatureEdit()
 {
 }
 
-void PartSet_OperationFeatureEdit::initFeature(FeaturePtr theFeature)
-{
-  setEditingFeature(theFeature);
-}
 
 void PartSet_OperationFeatureEdit::mousePressed(QMouseEvent* theEvent, Handle(V3d_View) theView,
                                                 const std::list<ModuleBase_ViewerPrs>& theSelected,
                                                 const std::list<ModuleBase_ViewerPrs>& theHighlighted)
 {
-  if(myActiveWidget && myActiveWidget->isViewerSelector()) {
+  ModuleBase_ModelWidget* aActiveWgt = myPropertyPanel->activeWidget();
+  if(aActiveWgt && aActiveWgt->isViewerSelector()) {
     // Almost do nothing, all stuff in on PartSet_OperationFeatureBase::mouseReleased
     PartSet_OperationFeatureBase::mousePressed(theEvent, theView, theSelected, theHighlighted);
     return;
@@ -128,7 +127,10 @@ void PartSet_OperationFeatureEdit::mouseReleased(
     const std::list<ModuleBase_ViewerPrs>& theSelected,
     const std::list<ModuleBase_ViewerPrs>& theHighlighted)
 {
-  if(myActiveWidget && myActiveWidget->isViewerSelector()) {
+  ModuleBase_ModelWidget* aActiveWgt = 0;
+  if (myPropertyPanel)
+    aActiveWgt = myPropertyPanel->activeWidget();
+  if(aActiveWgt && aActiveWgt->isViewerSelector()) {
     // Almost do nothing, all stuff in on PartSet_OperationFeatureBase::mouseReleased
     PartSet_OperationFeatureBase::mouseReleased(theEvent, theView, theSelected, theHighlighted);
   } else {
index 2082258b0257000b6c3d867f7bbf7d861ca00445..67223fce62fa0b756da56fae9c00c33cda84ca0c 100644 (file)
@@ -70,9 +70,6 @@ Q_OBJECT
   /// Destructor
   virtual ~PartSet_OperationFeatureEdit();
 
-  /// Initializes the operation with previously created feature. It is used in sequental operations
-  virtual void initFeature(FeaturePtr theFeature);
-
   /// Processes the mouse pressed in the point
   /// \param theEvent the mouse event
   /// \param theView a viewer to have the viewer the eye position
index cd0de892541cc01ab7374816c9431d9f165cf55a..ceef096f90ba38cc1bee062cd962322142e1afe9 100644 (file)
@@ -39,6 +39,7 @@ PartSet_OperationFeatureEditMulti::PartSet_OperationFeatureEditMulti(const QStri
       mySketch(theFeature),
       myIsBlockedSelection(false)
 {
+  myIsEditing = true;
 }
 
 PartSet_OperationFeatureEditMulti::~PartSet_OperationFeatureEditMulti()
@@ -69,11 +70,6 @@ void PartSet_OperationFeatureEditMulti::initSelection(
     myFeatures = theSelected;
 }
 
-void PartSet_OperationFeatureEditMulti::initFeature(FeaturePtr theFeature)
-{
-  setEditingFeature(theFeature);
-}
-
 FeaturePtr PartSet_OperationFeatureEditMulti::sketch() const
 {
   return mySketch;
@@ -93,7 +89,7 @@ void PartSet_OperationFeatureEditMulti::mouseMoved(QMouseEvent* theEvent, Handle
 
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView);
 
-  blockSelection(true);
+/*  blockSelection(true);
   if (myCurPoint.myIsInitialized) {
     double aCurX, aCurY;
     PartSet_Tools::convertTo2D(myCurPoint.myPoint, sketch(), theView, aCurX, aCurY);
@@ -105,7 +101,7 @@ void PartSet_OperationFeatureEditMulti::mouseMoved(QMouseEvent* theEvent, Handle
     double aDeltaY = anY - aCurY;
 
     boost::shared_ptr<SketchPlugin_Feature> aSketchFeature = boost::dynamic_pointer_cast<
-        SketchPlugin_Feature>(feature());
+        SketchPlugin_Feature>(sketch());
     aSketchFeature->move(aDeltaX, aDeltaY);
 
     std::list<ModuleBase_ViewerPrs>::const_iterator anIt = myFeatures.begin(), aLast = myFeatures
@@ -125,6 +121,7 @@ void PartSet_OperationFeatureEditMulti::mouseMoved(QMouseEvent* theEvent, Handle
   sendFeatures();
 
   myCurPoint.setPoint(aPoint);
+  */
 }
 
 void PartSet_OperationFeatureEditMulti::mouseReleased(
index 0f21f34ab0dd099c7b432dde41526778fc3919b8..b34b638ad498cd5c113e9472fc76dcb77981da38 100644 (file)
@@ -70,9 +70,6 @@ Q_OBJECT
   /// Destructor
   virtual ~PartSet_OperationFeatureEditMulti();
 
-  /// Initializes the operation with previously created feature. It is used in sequental operations
-  virtual void initFeature(FeaturePtr theFeature);
-
   /// Initialisation of operation with preliminary selection
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
index 2a320bc69d4e517ccfaae95670e807216d24a134..fdb56312b0aa0462f86fa5f147e7ca7bb8f349b4 100644 (file)
@@ -59,13 +59,6 @@ std::list<int> PartSet_OperationSketch::getSelectionModes(ObjectPtr theFeature)
   return aModes;
 }
 
-/// Initializes the operation with previously created feature. It is used in sequental operations
-void PartSet_OperationSketch::initFeature(FeaturePtr theFeature)
-{
-  if (theFeature)
-    setEditingFeature(theFeature);
-}
-
 FeaturePtr PartSet_OperationSketch::sketch() const
 {
   return feature();
index 3e99e86fa89ef629181034c9bfefc1c4751c0347..94ddf02d91e173e034c2eedb3edc0354be737454 100644 (file)
@@ -46,9 +46,6 @@ Q_OBJECT
   /// \return the selection mode
   virtual std::list<int> getSelectionModes(ObjectPtr theFeature) const;
 
-  /// Initializes the operation with previously created feature. It is used in sequental operations
-  virtual void initFeature(FeaturePtr theFeature);
-
   /// Returns the operation sketch feature
   /// \returns the sketch instance
   virtual FeaturePtr sketch() const;
index 9dd3141eb50135b8836616dde205871b20884857..e8f081e4d581d19beab5a3cf4f46dc48dd91e42d 100644 (file)
@@ -98,9 +98,7 @@ void PartSet_OperationSketchBase::restartOperation(const std::string& theType, O
   if (aFeature) {
     QStringList aNested = this->nestedFeatures();
     if (!aNested.isEmpty()) {
-      if (aNested.contains(QString(aFeature->getKind().c_str()))) 
-        emit restartRequired(theType, theFeature);
-      else
+      if (!aNested.contains(QString(aFeature->getKind().c_str())))
         return;
     }
   }
index 9b43039eaeff0754ec8f71daee153722f56a92f8..c92be1da37e727036cc8260690790e70e3174685 100644 (file)
@@ -65,11 +65,6 @@ Q_OBJECT
   /// \return the selection mode
   virtual std::list<int> getSelectionModes(ObjectPtr theFeature) const;
 
-  /// Initializes the operation with previously created feature. It is used in sequental operations
-  virtual void initFeature(FeaturePtr theFeature)
-  {
-  }
-
   /// Initialisation of operation with preliminary selection
   /// \param theSelected the list of selected presentations
   /// \param theHighlighted the list of highlighted presentations
index 88d5f89dea17ccbf7c669de34b6a0cb9c423a60a..6f014ad8a55bd2ac51e6c7eb2dfbd7303016f83b 100644 (file)
@@ -85,8 +85,6 @@ bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation)
   connect(theOperation, SIGNAL(stopped()), this, SLOT(onOperationStopped()));
   connect(theOperation, SIGNAL(started()), this, SIGNAL(operationStarted()));
   connect(theOperation, SIGNAL(resumed()), this, SIGNAL(operationResumed()));
-  connect(theOperation, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)), this,
-          SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)));
 
   theOperation->start();
   onValidateOperation();
@@ -241,9 +239,3 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
   return isAccepted;
 }
 
-void XGUI_OperationMgr::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
-{
-  ModuleBase_Operation* anOperation = currentOperation();
-  if (anOperation)
-    anOperation->onWidgetActivated(theWidget);
-}
index ee8ff1f938643e9284d52e5e26c3aba0d87d8005..95d5affb1ae7482a4c7e7303577c84cc1075aa51 100644 (file)
@@ -78,9 +78,6 @@ signals:
   void operationResumed();
   /// Signal is emitted after the validate methods calls.
   void operationValidated(bool);
-  /// Signal about the necessety of the next widget activating
-  /// \param theWidget the model widget
-  void activateNextWidget(ModuleBase_ModelWidget* theWidget);
 
  protected:
 
@@ -108,10 +105,6 @@ signals:
   /// \param theEvent the mouse event
   bool onKeyReleased(QKeyEvent* theEvent);
 
-  /// SLOT, that reacts to the widget activation
-  /// \param theWidget an activated widget
-  void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
-
   protected slots:
   /// Slot that is called by an operation stop. Removes the stopped operation form the stack.
   /// If there is a suspended operation, restart it.
index 14ae5b6d94d49a51a78f5681ca56715da59bfffb..93a35bdc99599051253912b42ee3b206a441962c 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 
 XGUI_PropertyPanel::XGUI_PropertyPanel(QWidget* theParent)
-    : QDockWidget(theParent)
+    : ModuleBase_IPropertyPanel(theParent), myActiveWidget(0)
 {
   this->setWindowTitle(tr("Property Panel"));
   QAction* aViewAct = this->toggleViewAction();
@@ -76,6 +76,7 @@ void XGUI_PropertyPanel::cleanContent()
 void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets)
 {
   myWidgets = theWidgets;
+  int aS = myWidgets.size();
   if (theWidgets.empty()) return;
 
   QList<ModuleBase_ModelWidget*>::const_iterator anIt = theWidgets.begin(), aLast =
@@ -84,7 +85,7 @@ void XGUI_PropertyPanel::setModelWidgets(const QList<ModuleBase_ModelWidget*>& t
     connect(*anIt, SIGNAL(keyReleased(QKeyEvent*)), this, SIGNAL(keyReleased(QKeyEvent*)));
 
     connect(*anIt, SIGNAL(focusOutWidget(ModuleBase_ModelWidget*)), this,
-            SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
+            SLOT(activateNextWidget(ModuleBase_ModelWidget*)));
     connect(*anIt, SIGNAL(focusInWidget(ModuleBase_ModelWidget*)),
             this, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)));
 
@@ -120,6 +121,7 @@ QWidget* XGUI_PropertyPanel::contentWidget()
 
 void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature)
 {
+  int aS = myWidgets.size();
   foreach(ModuleBase_ModelWidget* eachWidget, myWidgets)
   {
     eachWidget->setFeature(theFeature);
@@ -129,7 +131,8 @@ void XGUI_PropertyPanel::updateContentWidget(FeaturePtr theFeature)
   repaint();
 }
 
-void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
+
+void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget)
 {
   QObject* aSender = sender();
   ModuleBase_ModelWidget* aNextWidget = 0;
@@ -143,7 +146,13 @@ void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
     }
     isFoundWidget = (*anIt) == theWidget;
   }
-  emit widgetActivated(aNextWidget);
+  myActiveWidget = aNextWidget;
+  emit widgetActivated(myActiveWidget);
+}
+
+void XGUI_PropertyPanel::activateNextWidget()
+{
+  activateNextWidget(myActiveWidget);
 }
 
 void XGUI_PropertyPanel::setAcceptEnabled(bool isEnabled)
index a660b5484bf27c4a1bff6301da766f4f4ed39ced..b29d51579e9c1a238a8bfc365baae90eb11343e0 100644 (file)
 #include "XGUI.h"
 
 #include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_IPropertyPanel.h>
 
-#include <QDockWidget>
 #include <QList>
 
 class QKeyEvent;
 class QVBoxLayout;
 
-class XGUI_EXPORT XGUI_PropertyPanel : public QDockWidget
+class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
 {
 Q_OBJECT
  public:
@@ -36,22 +36,22 @@ Q_OBJECT
   /// Removes all widgets in the widget area of the property panel
   void cleanContent();
 
+  /// Returns currently active widget
+  virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }
+
+  /// Activate the next widget in the property panel
+  /// \param theWidget a widget. The next widget should be activated
+  virtual void activateNextWidget(ModuleBase_ModelWidget* theWidget);
+
+  /// Activate the next from current widget in the property panel
+  virtual void activateNextWidget();
+
  public slots:
   void updateContentWidget(FeaturePtr theFeature);
-  /// slot to activate the next widget in the property panel
-  /// \param theWidget a widget. The next widget should be activated
-  void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
   // Enables / disables "ok" ("accept") button
   void setAcceptEnabled(bool);
 
 signals:
-  /// The signal about key release on the control, that corresponds to the attribute
-  /// \param theEvent key release event
-  void keyReleased(QKeyEvent* theEvent);
-  /// The signal about the widget activation
-  /// \param theWidget the activated widget
-  void widgetActivated(ModuleBase_ModelWidget* theWidget);
-
   /// Signal about the point 2d set to the feature
   /// \param the feature
   /// \param the attribute of the feature
@@ -61,6 +61,7 @@ signals:
   QWidget* myCustomWidget;
   QList<ModuleBase_ModelWidget*> myWidgets;
   QVBoxLayout* myMainLayout;
+  ModuleBase_ModelWidget* myActiveWidget;
 };
 
 #endif /* XGUI_PROPERTYPANEL_H_ */
index 8c76c2fd11cf18d84788e79300b9b76ea9b50242..9ee12eea2d9d8daf99be34525a398603093f2e0c 100644 (file)
@@ -513,8 +513,9 @@ void XGUI_Workshop::onOperationStarted()
       }
     }
 
+    aOperation->setPropertyPanel(myPropertyPanel);
     myPropertyPanel->setModelWidgets(aWidgets);
-    myPropertyPanel->onActivateNextWidget(NULL);
+    myPropertyPanel->activateNextWidget(NULL);
     // 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)) {
@@ -1001,10 +1002,10 @@ void XGUI_Workshop::createDockWidgets()
   connect(aCancelBtn, SIGNAL(clicked()), myOperationMgr, SLOT(onAbortOperation()));
   connect(myPropertyPanel, SIGNAL(keyReleased(QKeyEvent*)), myOperationMgr,
           SLOT(onKeyReleased(QKeyEvent*)));
-  connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), myOperationMgr,
-          SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
-  connect(myOperationMgr, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)), myPropertyPanel,
-          SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
+  //connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), myOperationMgr,
+  //        SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
+  //connect(myOperationMgr, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)), myPropertyPanel,
+  //        SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
   connect(myOperationMgr, SIGNAL(operationValidated(bool)), myPropertyPanel,
           SLOT(setAcceptEnabled(bool)));