From: azv Date: Thu, 22 May 2014 07:34:31 +0000 (+0400) Subject: Merge remote-tracking branch 'remotes/origin/master' into SolveSpace X-Git-Tag: V_0.2~29^2^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6d67df3511c8cc3518911419aea31c15bafd2a8d;p=modules%2Fshaper.git Merge remote-tracking branch 'remotes/origin/master' into SolveSpace --- 6d67df3511c8cc3518911419aea31c15bafd2a8d diff --cc src/XGUI/XGUI_Workshop.cpp index a41702119,8504e1531..d095b1cb4 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@@ -716,17 -747,25 +747,25 @@@ void XGUI_Workshop::activatePart(Featur } //************************************************************** - void XGUI_Workshop::activatePart(bool toActivate) + void XGUI_Workshop::activateLastPart() { - if (toActivate) { - QFeatureList aFeatures = mySelector->selectedFeatures(); - if (aFeatures.size() > 0) { - changeCurrentDocument(aFeatures.first()); - myObjectBrowser->activateCurrentPart(true); + PluginManagerPtr aMgr = ModelAPI_PluginManager::get(); + DocumentPtr aDoc = aMgr->rootDocument(); + FeaturePtr aLastPart = aDoc->feature(PARTS_GROUP, aDoc->size(PARTS_GROUP) - 1, true); + activatePart(aLastPart); + } + + //************************************************************** + void XGUI_Workshop::deleteFeatures(QFeatureList theList) + { + QMainWindow* aDesktop = isSalomeMode()? salomeConnector()->desktop() : myMainWindow; + QMessageBox::StandardButton aRes = QMessageBox::warning(aDesktop, tr("Delete features"), + tr("Seleted features will be deleted. Continue?"), + QMessageBox::No | QMessageBox::Yes, QMessageBox::No); + if (aRes == QMessageBox::Yes) { + foreach (FeaturePtr aFeature, theList) { + DocumentPtr aDoc = aFeature->data()->docRef("PartDocument")->value(); + aDoc->removeFeature(aFeature); } - } else { - changeCurrentDocument(FeaturePtr()); - myObjectBrowser->activateCurrentPart(false); } -} +} -