return anAnswer == QMessageBox::Ok;
}
+void XGUI_OperationMgr::onCommitOperation()
+{
+ ModuleBase_Operation* anOperation = currentOperation();
+ if (anOperation)
+ anOperation->commit();
+}
+
+void XGUI_OperationMgr::onAbortOperation()
+{
+ ModuleBase_Operation* anOperation = currentOperation();
+ if (anOperation)
+ anOperation->abort();
+}
+
void XGUI_OperationMgr::onOperationStopped()
{
ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
bool canStopOperation();
protected slots:
+ /// Slot that commits the current operation.
+ void onCommitOperation();
+ /// Slot that aborts the current operation.
+ void onAbortOperation();
+
/// Slot that is called by an operation stop. Removes the stopped operation form the stack.
/// If there is a suspended operation, restart it.
void onOperationStopped();
*/
void XGUI_Workshop::connectWithOperation(ModuleBase_Operation* theOperation)
{
- QPushButton* aOkBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
- connect(aOkBtn, SIGNAL(clicked()), theOperation, SLOT(commit()));
- QPushButton* aCancelBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
- connect(aCancelBtn, SIGNAL(clicked()), theOperation, SLOT(abort()));
-
QAction* aCommand = 0;
if (isSalomeMode()) {
aCommand = salomeConnector()->command(theOperation->getDescription()->operationId());
hidePropertyPanel(); //<! Invisible by default
hideObjectBrowser();
aDesktop->tabifyDockWidget(aObjDock, myPropertyPanel);
+
+ QPushButton* aOkBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
+ connect(aOkBtn, SIGNAL(clicked()), myOperationMgr, SLOT(onCommitOperation()));
+ QPushButton* aCancelBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
+ connect(aCancelBtn, SIGNAL(clicked()), myOperationMgr, SLOT(onAbortOperation()));
}
//******************************************************