+ if (hasOperation())
+ currentOperation()->postpone();
+ myOperations.append(theOperation);
+
+ connect(theOperation, SIGNAL(started()), SLOT(onOperationStarted()));
+ connect(theOperation, SIGNAL(aborted()), SLOT(onOperationAborted()));
+ connect(theOperation, SIGNAL(committed()), SLOT(onOperationCommitted()));
+ connect(theOperation, SIGNAL(stopped()), SLOT(onOperationStopped()));
+ connect(theOperation, SIGNAL(resumed()), SLOT(onOperationResumed()));
+ connect(theOperation, SIGNAL(activatedByPreselection()),
+ SIGNAL(operationActivatedByPreselection()));
+
+ theOperation->start();
+ onValidateOperation();
+ return true;
+}
+
+bool XGUI_OperationMgr::abortAllOperations()
+{
+ if(!hasOperation()) {
+ return true;
+ } else if (operationsCount() == 1) {
+ onAbortOperation();
+ return true;
+ }
+ QString aMessage = tr("All active operations will be aborted.");
+ int anAnswer = QMessageBox::question(qApp->activeWindow(),
+ tr("Abort operation"),
+ aMessage,
+ QMessageBox::Ok | QMessageBox::Cancel,
+ QMessageBox::Cancel);
+ bool result = anAnswer == QMessageBox::Ok;
+ while(result && hasOperation()) {
+ currentOperation()->abort();
+ }
+ return result;
+}
+
+void XGUI_OperationMgr::onValidateOperation()
+{
+ if (!hasOperation())