+ ModuleBase_Tools::blockUpdateViewer(false);
+}
+
+void PartSet_MenuMgr::onActivateAllParts()
+{
+ SessionPtr aMgr = ModelAPI_Session::get();
+ if (aMgr->isOperation())
+ return;
+
+ DocumentPtr aDoc = aMgr->moduleDocument();
+ int aNbParts = aDoc->size(ModelAPI_ResultPart::group());
+ QList<ResultPartPtr> aPartsToLoad;
+ for (int i = 0; i < aNbParts; i++) {
+ ObjectPtr aObj = aDoc->object(ModelAPI_ResultPart::group(), i);
+ ResultPartPtr aPartRes = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
+ if (!aPartRes->partDoc().get())
+ aPartsToLoad.append(aPartRes);
+ }
+ if (!aPartsToLoad.isEmpty()) {
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+ aMgr->startOperation("All Parts loading");
+ foreach(ResultPartPtr aPartRes, aPartsToLoad) {
+ aPartRes->loadPart();
+ }
+ aMgr->finishOperation();
+
+ XGUI_Workshop* aWorkshop = myModule->getWorkshop();
+ XGUI_ObjectsBrowser* aObjBrowser = aWorkshop->objectBrowser();
+ aObjBrowser->update();
+ aWorkshop->viewer()->update();
+ aWorkshop->updateCommandStatus();
+ QApplication::restoreOverrideCursor();
+ }