From: spo Date: Thu, 17 Sep 2015 06:24:10 +0000 (+0300) Subject: Issue #818 - Deletion of a parameter used in a feature X-Git-Tag: V_1.4.0~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b4b0748450845966e7ccf5324781d61c992fa86f;p=modules%2Fshaper.git Issue #818 - Deletion of a parameter used in a feature --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 4638e3890..076ef0b21 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1236,7 +1236,7 @@ bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theList, bool canReplaceParameters = true; foreach (ObjectPtr aObj, theList) { FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); - if (aFeature->getKind() != "Parameter") { + if (!std::dynamic_pointer_cast(aFeature->firstResult()).get()) { // the feature is not a parameter canReplaceParameters = false; break; } @@ -1250,7 +1250,7 @@ bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theList, QString aText; if (canReplaceParameters) { - aText = QString(tr("Selected parameters are used in the following features: %1.\nThese features will be deleted.\n%2Or parameters could be replaced with its values.\nWould you like to continue?")) + aText = QString(tr("Selected parameters are used in the following features: %1.\nThese features will be deleted.\n%2Or parameters could be replaced by their values.\nWould you like to continue?")) .arg(aDirectNames).arg(aIndirectNames.isEmpty() ? QString() : QString(tr("(Also these features will be deleted: %1)\n")).arg(aIndirectNames)); QPushButton *aReplaceButton = aMessageBox.addButton(tr("Replace"), QMessageBox::ActionRole); } else {