]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
It moves the connect of the propertyPanel noWidget signal to the module instead of...
authornds <natalia.donis@opencascade.com>
Thu, 4 Dec 2014 14:49:00 +0000 (17:49 +0300)
committernds <natalia.donis@opencascade.com>
Thu, 4 Dec 2014 14:49:00 +0000 (17:49 +0300)
src/FeaturesPlugin/placement_widget.xml
src/ModuleBase/ModuleBase_Operation.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/XGUI/XGUI_Workshop.cpp

index 0e6f3488ed79e275bba215df08f93b21c30151e1..e5f67055ca4cf186eaada0a2ac0c33f760fcb76b 100644 (file)
@@ -14,6 +14,4 @@
     use_subshapes="true"
        concealment="true"
   />
-  <!-- In order to avoid automatic closing of operation -->
-  <label id="" label="" internal="1"/>
 </source>
index 892a6780b959cee35de1c40523494b53ba7c872a..5ee3daa6e6f8d88dc18427c03ed76542a05c4d52 100644 (file)
@@ -181,8 +181,6 @@ void ModuleBase_Operation::postpone()
 
 void ModuleBase_Operation::resume()
 {
-  if (myPropertyPanel)
-    connect(myPropertyPanel, SIGNAL(noMoreWidgets()), SLOT(commit()));
   //  connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)),
   //          this,            SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
   emit resumed();
@@ -358,9 +356,6 @@ void ModuleBase_Operation::setPropertyPanel(ModuleBase_IPropertyPanel* theProp)
   myPropertyPanel->setEditingMode(isEditOperation());
   //connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), this,
   //        SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
-  if (myPropertyPanel) {
-    connect(myPropertyPanel, SIGNAL(noMoreWidgets()), SLOT(commit()));
-  }
 }
 
 bool ModuleBase_Operation::isGranted(QString theId) const
index e3c2d76ab4974ee8eba932db9c41cb16c38ce1ea..3dec04e882402407fe5dc6fb4bbdc048974ebb22 100644 (file)
@@ -522,6 +522,20 @@ void PartSet_Module::onEnterReleased()
   myRestartingMode = RM_LastFeatureEmpty;
 }
 
+void PartSet_Module::onNoMoreWidgets()
+{
+  ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+  if (aOperation) {
+    /// Restart sketcher operations automatically
+    FeaturePtr aFeature = aOperation->feature();
+    std::shared_ptr<SketchPlugin_Feature> aSPFeature = 
+              std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
+    if (aSPFeature) {
+      aOperation->commit();
+    }
+  }
+}
+
 QStringList PartSet_Module::sketchOperationIdList() const
 {
   QStringList aIds;
index 36156c8ecf75e46073f152bc1c190fe32c29f2dc..2f981fd66755e93eb3b2356d158e9480282cbb4d 100644 (file)
@@ -49,6 +49,11 @@ public:
 
   QStringList sketchOperationIdList() const;
 
+public slots:
+  /// SLOT, that is called by no more widget signal emitted by property panel
+  /// Set a specific flag to restart the sketcher operation
+  void onNoMoreWidgets();
+
 protected slots:
   /// Called when previous operation is finished
   virtual void onOperationComitted(ModuleBase_Operation* theOperation);
index d127172fc9dfbe37ae0061a413fa235395c15261..31c283e5d74bb63db4ebb1f1a94c0d7fdf179a2a 100644 (file)
@@ -1038,6 +1038,9 @@ void XGUI_Workshop::createDockWidgets()
   aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock);
   myPropertyPanel = new XGUI_PropertyPanel(aDesktop);
   myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
+
+  connect(myPropertyPanel, SIGNAL(noMoreWidgets()), myModule, SLOT(onNoMoreWidgets()));
+
   aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel);
   hidePropertyPanel();  //<! Invisible by default
   hideObjectBrowser();