From: vsv Date: Fri, 29 Dec 2017 13:03:10 +0000 (+0300) Subject: Some fixes for bugs from a free testing X-Git-Tag: V_2.10.1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2fa2a9fd2804a0b4f1d386931dcc97780f496726;p=modules%2Fshaper.git Some fixes for bugs from a free testing --- diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 224e1c40e..7e2aee8bb 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -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(aPanel); + aPP->onAcceptData(); + } isCommitted = theOperation->commit(); - else { + } else { isCommitted = false; abortOperation(theOperation); } diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index bc172e5f9..33288b465 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -226,7 +226,8 @@ void XGUI_PropertyPanel::createContentPanel(FeaturePtr theFeature) } std::shared_ptr 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() diff --git a/src/XGUI/XGUI_PropertyPanel.h b/src/XGUI/XGUI_PropertyPanel.h index 21971af11..00d5ab8d8 100644 --- a/src/XGUI/XGUI_PropertyPanel.h +++ b/src/XGUI/XGUI_PropertyPanel.h @@ -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