// So, displayer will be created on demand.
mySelector = new XGUI_SelectionMgr(this);
+ connect(mySelector, SIGNAL(selectionChanged()), this, SLOT(changeCurrentDocument()));
myOperationMgr = new XGUI_OperationMgr(this);
myActionsMgr = new XGUI_ActionsMgr(this);
myErrorDlg = new XGUI_ErrorDialog(myMainWindow);
QApplication::setOverrideCursor(Qt::WaitCursor);
if (objectBrowser() == 0) {
createDockWidgets();
- mySelector->connectObjectBrowser(objectBrowser());
+ mySelector->connectViewers();
}
showObjectBrowser();
if (!isSalomeMode()) {
}
return myDisplayer;
}
+
+//******************************************************
+void XGUI_Workshop::changeCurrentDocument()
+{
+ QFeatureList aFeatures = objectBrowser()->selectedFeatures();
+
+ // Set current document
+ if (aFeatures.size() > 0) {
+ FeaturePtr aFeature = aFeatures.first();
+
+ boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
+ boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = aFeature->data()->docRef("PartDocument");
+ if (aDocRef)
+ aMgr->setCurrentDocument(aDocRef->value());
+ }
+}
+
+//******************************************************
+void XGUI_Workshop::salomeViewerSelectionChanged()
+{
+ emit salomeViewerSelection();
+}