- XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
- if (!isSketchOp && anOpMgr->canStopOperation()) {
- ModuleBase_Operation* aCurrentOp = anOpMgr->currentOperation();
- if (aCurrentOp) {
- aCurrentOp->abort();
- }
- }
- std::set<FeaturePtr> aRefFeatures;
- foreach (ObjectPtr aObj, aSelectedObj)
- {
- //ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
- //if (aPart) {
- // TODO: check for what there is this condition. It is placed here historicaly because
- // ther is this condition during remove features.
- //} else {
- FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
- if (aFeature.get() != NULL) {
- aObj->document()->refsToFeature(aFeature, aRefFeatures, false);
- }
- //}
- }
- QString aDescription = tr("Delete");
- /**
- // according to #355 feature, it is not necessary to inform about dependencies during
- // sketch delete operation
- //
- if (!aRefFeatures.empty()) {
- QStringList aRefNames;
- std::set<FeaturePtr>::const_iterator anIt = aRefFeatures.begin(),
- aLast = aRefFeatures.end();
- for (; anIt != aLast; anIt++) {
- FeaturePtr aFeature = (*anIt);
- if (aFeature == aSketch)
- continue;
- aRefNames.append((*anIt)->name().c_str());
- }
- if (!aRefNames.empty()) {
- QString aNames = aRefNames.join(", ");
- aDescription += aNames.prepend(" ");
-
- QMainWindow* aDesktop = aWorkshop->desktop();
- QMessageBox::StandardButton aRes = QMessageBox::warning(
- aDesktop, tr("Delete features"),
- QString(tr("Selected features are used in the following features: %1.\
- These features will be deleted also. Would you like to continue?")).arg(aNames),
- QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
- if (aRes != QMessageBox::Yes)
- return;
- }
- }*/