]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Some fixes for bugs from a free testing V_2.10.1
authorvsv <vsv@opencascade.com>
Fri, 29 Dec 2017 13:03:10 +0000 (16:03 +0300)
committervsv <vsv@opencascade.com>
Fri, 29 Dec 2017 13:03:21 +0000 (16:03 +0300)
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h

index 224e1c40e50945fbce1929b54ed377c0efd2cacd..7e2aee8bb00a89c641da71e04f614058f798ea13 100644 (file)
@@ -432,9 +432,15 @@ bool XGUI_OperationMgr::canStartOperation(const QString& theId, bool& isCommitte
 
 void XGUI_OperationMgr::stopOperation(ModuleBase_Operation* theOperation, bool& isCommitted)
 {
-  if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled() && theOperation->isModified())
+  if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled() &&
+      theOperation->isModified()) {
+    ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
+    if (aPanel) {
+      XGUI_PropertyPanel* aPP = dynamic_cast<XGUI_PropertyPanel*>(aPanel);
+      aPP->onAcceptData();
+    }
     isCommitted = theOperation->commit();
-  else {
+  else {
     isCommitted = false;
     abortOperation(theOperation);
   }
index bc172e5f99a654e26c5cae7a5f0eb64d41469d31..33288b465827441990ea5b4fd9c9e87c22c753cc 100755 (executable)
@@ -226,7 +226,8 @@ void XGUI_PropertyPanel::createContentPanel(FeaturePtr theFeature)
   }
   std::shared_ptr<Config_FeatureMessage> aFeatureInfo =
     myOperationMgr->workshop()->featureInfo(theFeature->getKind().c_str());
-  findButton(PROP_PANEL_OK_PLUS)->setVisible(aFeatureInfo->isApplyContinue());
+  if (aFeatureInfo.get())
+    findButton(PROP_PANEL_OK_PLUS)->setVisible(aFeatureInfo->isApplyContinue());
 }
 
 void XGUI_PropertyPanel::activateNextWidget(ModuleBase_ModelWidget* theWidget)
@@ -564,10 +565,6 @@ void XGUI_PropertyPanel::setupActions(XGUI_ActionsMgr* theMgr)
     QAction* anAct = theMgr->operationStateAction(aActionIds.at(i));
     aBtn->setDefaultAction(anAct);
   }
-  QToolButton* aBtn = findButton(PROP_PANEL_OK);
-  connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData()));
-  aBtn = findButton(PROP_PANEL_OK_PLUS);
-  connect(aBtn->defaultAction(), SIGNAL(triggered(bool)), this, SLOT(onAcceptData()));
 }
 
 void XGUI_PropertyPanel::onAcceptData()
index 21971af119346268c031c93a49def00500f6dc46..00d5ab8d8669f5fc88d667dac7f460bf25d4ef60 100644 (file)
@@ -133,6 +133,9 @@ Q_OBJECT
   /// \param theIsNext true, if Tab(to the next widget) or false(moving to the previous)
   bool setFocusNextPrevChild(bool theIsNext);
 
+  /// The method is called on accepting of operation
+  void onAcceptData();
+
 public slots:
   /// \brief Update all widgets in property panel with values from the given feature
   /// \param theFeature a Feature to update values in widgets
@@ -160,8 +163,6 @@ public slots:
   /// \param theWidget the current widget
   void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
 
-  void onAcceptData();
-
 signals:
   /// The signal is emitted if the enter is clicked in the control of the widget
   /// \param theObject a sender of the event