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);
}
}
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)
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()
/// \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
/// \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