if (aDoc == myDocument) { // If root objects
if (aUpdMsg->group().compare(PARTS_GROUP) == 0) { // Updsate only Parts group
- int aStart = myPartModels.size();
- removeSubModel(myPartModels.size() - 1);
+ int aStart = myPartModels.size() - 1;
+ removeSubModel(aStart);
removeRow(aStart, partFolderNode());
} else { // Update top groups (other except parts
QModelIndex aIndex = myModel->findGroup(aUpdMsg->group());
QString aWchName = QString::fromStdString(theMessage->workbenchId());
QString aNestedFeatures = QString::fromStdString(theMessage->nestedFeatures());
bool isUsePropPanel = theMessage->isUseInput();
+ QString aId = QString::fromStdString(theMessage->id());
if (isSalomeMode()) {
- QString aId = QString::fromStdString(theMessage->id());
QAction* aAction = salomeConnector()->addFeature(aWchName,
aId,
QString::fromStdString(theMessage->text()),
aGroup = aPage->addGroup(aGroupName);
}
//Create feature...
- XGUI_Command* aCommand = aGroup->addFeature(QString::fromStdString(theMessage->id()),
+ XGUI_Command* aCommand = aGroup->addFeature(aId,
QString::fromStdString(theMessage->text()),
QString::fromStdString(theMessage->tooltip()),
QIcon(theMessage->icon().c_str()),
tr("Seleted features will be deleted. Continue?"),
QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
if (aRes == QMessageBox::Yes) {
+ PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
+ aMgr->rootDocument()->startOperation();
foreach (FeaturePtr aFeature, theList) {
- DocumentPtr aDoc = aFeature->data()->docRef("PartDocument")->value();
- aDoc->removeFeature(aFeature);
+ if (aFeature->getKind() == "Part") {
+ DocumentPtr aDoc = aFeature->data()->docRef("PartDocument")->value();
+ if (aDoc == aMgr->currentDocument()) {
+ aDoc->close();
+ }
+ } //else
+ //aDoc = aFeature->document();
+ aMgr->rootDocument()->removeFeature(aFeature);
}
+ aMgr->rootDocument()->finishOperation();
}
}
\ No newline at end of file