1 #include "XGUI_Module.h"
2 #include "XGUI_Constants.h"
3 #include "XGUI_Command.h"
4 #include "XGUI_MainMenu.h"
5 #include "XGUI_MainWindow.h"
6 #include "XGUI_MenuGroupPanel.h"
7 #include "XGUI_Tools.h"
8 #include "XGUI_Workbench.h"
9 #include "XGUI_Workshop.h"
10 #include "XGUI_Viewer.h"
11 #include "ModuleBase_WidgetFactory.h"
12 #include "XGUI_SelectionMgr.h"
13 #include "XGUI_ObjectsBrowser.h"
14 #include "XGUI_Displayer.h"
15 #include "XGUI_OperationMgr.h"
16 #include "XGUI_SalomeConnector.h"
17 #include "XGUI_SalomeViewer.h"
18 #include "XGUI_ActionsMgr.h"
19 #include "XGUI_ErrorDialog.h"
20 #include "XGUI_ViewerProxy.h"
21 #include "XGUI_PropertyPanel.h"
22 #include "XGUI_ContextMenuMgr.h"
24 #include <Model_Events.h>
25 #include <ModelAPI_PluginManager.h>
26 #include <ModelAPI_Feature.h>
27 #include <ModelAPI_Data.h>
28 #include <ModelAPI_AttributeDocRef.h>
30 #include <Events_Loop.h>
31 #include <Events_Error.h>
32 #include <ModuleBase_Operation.h>
33 #include <ModuleBase_Operation.h>
34 #include <ModuleBase_OperationDescription.h>
35 #include <Config_Common.h>
36 #include <Config_FeatureMessage.h>
37 #include <Config_PointerMessage.h>
38 #include <Config_ModuleReader.h>
40 #include <QApplication>
41 #include <QFileDialog>
42 #include <QMessageBox>
43 #include <QMdiSubWindow>
44 #include <QPushButton>
45 #include <QDockWidget>
59 QMap<QString, QString> XGUI_Workshop::myIcons;
61 QString XGUI_Workshop::featureIcon(const std::string& theId)
63 QString aId(theId.c_str());
64 if (myIcons.contains(aId))
69 XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
71 myCurrentFile(QString()),
72 myPartSetModule(NULL),
73 mySalomeConnector(theConnector),
78 myMainWindow = mySalomeConnector? 0 : new XGUI_MainWindow();
80 myDisplayer = new XGUI_Displayer(this);
82 mySelector = new XGUI_SelectionMgr(this);
84 myOperationMgr = new XGUI_OperationMgr(this);
85 myActionsMgr = new XGUI_ActionsMgr(this);
86 myErrorDlg = new XGUI_ErrorDialog(myMainWindow);
87 myContextMenuMgr = new XGUI_ContextMenuMgr(this);
89 myViewerProxy = new XGUI_ViewerProxy(this);
91 connect(myOperationMgr, SIGNAL(operationStarted()), this, SLOT(onOperationStarted()));
92 connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)),
93 this, SLOT(onOperationStopped(ModuleBase_Operation*)));
94 connect(this, SIGNAL(errorOccurred(const QString&)), myErrorDlg, SLOT(addError(const QString&)));
97 //******************************************************
98 XGUI_Workshop::~XGUI_Workshop(void)
102 //******************************************************
103 void XGUI_Workshop::startApplication()
106 //Initialize event listening
107 Events_Loop* aLoop = Events_Loop::loop();
108 aLoop->registerListener(this, Events_Error::errorID()); //!< Listening application errors.
109 //TODO(sbh): Implement static method to extract event id [SEID]
110 Events_ID aFeatureId = aLoop->eventByName(EVENT_FEATURE_LOADED);
111 aLoop->registerListener(this, aFeatureId);
112 Events_ID aPartSetId = aLoop->eventByName("PartSetModuleEvent");
113 aLoop->registerListener(this, aPartSetId);
114 Events_ID aFeatureUpdatedId = aLoop->eventByName(EVENT_FEATURE_UPDATED);
115 aLoop->registerListener(this, aFeatureUpdatedId);
118 myMainWindow->show();
119 updateCommandStatus();
124 //******************************************************
125 void XGUI_Workshop::initMenu()
127 if (isSalomeMode()) {
128 // Create only Undo, Redo commands
129 salomeConnector()->addEditCommand("UNDO_CMD",
130 tr("Undo"), tr("Undo last command"),
131 QIcon(":pictures/undo.png"),
132 false, this, SLOT(onUndo()),
134 salomeConnector()->addEditCommand("REDO_CMD",
135 tr("Redo"), tr("Redo last command"),
136 QIcon(":pictures/redo.png"),
137 false, this, SLOT(onRedo()),
139 salomeConnector()->addEditMenuSeparator();
142 XGUI_Workbench* aPage = myMainWindow->menuObject()->generalPage();
144 // File commands group
145 XGUI_MenuGroupPanel* aGroup = aPage->addGroup("Default");
147 XGUI_Command* aCommand;
149 aCommand = aGroup->addFeature("SAVE_CMD", tr("Save..."), tr("Save the document"),
150 QIcon(":pictures/save.png"), QKeySequence::Save);
151 aCommand->connectTo(this, SLOT(onSave()));
152 //aCommand->disable();
154 aCommand = aGroup->addFeature("UNDO_CMD", tr("Undo"), tr("Undo last command"),
155 QIcon(":pictures/undo.png"), QKeySequence::Undo);
156 aCommand->connectTo(this, SLOT(onUndo()));
158 aCommand = aGroup->addFeature("REDO_CMD", tr("Redo"), tr("Redo last command"),
159 QIcon(":pictures/redo.png"), QKeySequence::Redo);
160 aCommand->connectTo(this, SLOT(onRedo()));
162 aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
163 QIcon(":pictures/rebuild.png"));
165 aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
166 QIcon(":pictures/save.png"));
167 aCommand->connectTo(this, SLOT(onSaveAs()));
168 //aCommand->disable();
170 aCommand = aGroup->addFeature("OPEN_CMD", tr("Open..."), tr("Open a new document"),
171 QIcon(":pictures/open.png"), QKeySequence::Open);
172 aCommand->connectTo(this, SLOT(onOpen()));
174 //aCommand = aGroup->addFeature("NEW_CMD", tr("New"), tr("Create a new document"),
175 // QIcon(":pictures/new.png"), QKeySequence::New);
176 //aCommand->connectTo(this, SLOT(onNew()));
178 aCommand = aGroup->addFeature("EXIT_CMD", tr("Exit"), tr("Exit application"),
179 QIcon(":pictures/close.png"), QKeySequence::Close);
180 aCommand->connectTo(this, SLOT(onExit()));
182 myContextMenuMgr->createActions();
185 //******************************************************
186 XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName)
188 XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
189 return aMenuBar->addWorkbench(theName);
192 //******************************************************
193 void XGUI_Workshop::processEvent(const Events_Message* theMessage)
195 //A message to start feature creation received.
196 static Events_ID aFeatureLoadedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED);
197 if (theMessage->eventID() == aFeatureLoadedId) {
198 const Config_FeatureMessage* aFeatureMsg = dynamic_cast<const Config_FeatureMessage*>(theMessage);
199 addFeature(aFeatureMsg);
202 //Update property panel on corresponding message. If there is no current operation (no
203 //property panel), or received message has different feature to the current - do nothing.
204 static Events_ID aFeatureUpdatedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED);
205 if (theMessage->eventID() == aFeatureUpdatedId && myOperationMgr->hasOperation())
207 const Model_FeatureUpdatedMessage* anUpdateMsg =
208 dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
209 boost::shared_ptr<ModelAPI_Feature> aNewFeature = anUpdateMsg->feature();
210 boost::shared_ptr<ModelAPI_Feature> aCurrentFeature = myOperationMgr->currentOperation()->feature();
211 if(aNewFeature == aCurrentFeature) {
212 myPropertyPanel->updateContentWidget(aCurrentFeature);
215 //An operation passed by message. Start it, process and commit.
216 const Config_PointerMessage* aPartSetMsg = dynamic_cast<const Config_PointerMessage*>(theMessage);
218 ModuleBase_Operation* anOperation =
219 (ModuleBase_Operation*)(aPartSetMsg->pointer());
221 if (myOperationMgr->startOperation(anOperation)) {
222 myPropertyPanel->updateContentWidget(anOperation->feature());
223 if (anOperation->getDescription()->xmlRepresentation().isEmpty()) {
224 anOperation->commit();
225 updateCommandStatus();
230 //Show error dialog if error message received.
231 const Events_Error* anAppError = dynamic_cast<const Events_Error*>(theMessage);
233 emit errorOccurred(QString::fromLatin1(anAppError->description()));
236 myErrorDlg->activateWindow();
241 //******************************************************
242 void XGUI_Workshop::onOperationStarted()
244 ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
246 if(!aOperation->getDescription()->xmlRepresentation().isEmpty()) { //!< No need for property panel
247 connectWithOperation(aOperation);
251 ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aOperation);
252 QWidget* aContent = myPropertyPanel->contentWidget();
253 qDeleteAll(aContent->children());
254 aFactory.createWidget(aContent);
255 myPropertyPanel->setModelWidgets(aFactory.getModelWidgets());
256 myPropertyPanel->setWindowTitle(aOperation->getDescription()->description());
260 //******************************************************
261 void XGUI_Workshop::onOperationStopped(ModuleBase_Operation* theOperation)
263 ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
265 //!< No need for property panel
266 updateCommandStatus();
268 if(myOperationMgr->operationsCount() > 1) {
269 myActionsMgr->updateAction(theOperation->getDescription()->operationId());
272 if(!aOperation->getDescription()->xmlRepresentation().isEmpty()) {
273 myActionsMgr->restoreCommandState();
280 void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
284 qDebug() << "XGUI_Workshop::addFeature: NULL message.";
288 // Remember features icons
289 myIcons[QString::fromStdString(theMessage->id())] = QString::fromStdString(theMessage->icon());
291 //Find or create Workbench
292 QString aWchName = QString::fromStdString(theMessage->workbenchId());
293 QString aNestedFeatures = QString::fromStdString(theMessage->nestedFeatures());
294 bool isUsePropPanel = theMessage->isUseInput();
295 if (isSalomeMode()) {
296 QString aId = QString::fromStdString(theMessage->id());
297 salomeConnector()->addFeature(aWchName,
298 QString::fromStdString(theMessage->id()),
300 QString::fromStdString(theMessage->tooltip()),
301 QIcon(theMessage->icon().c_str()),
302 isUsePropPanel, this,
303 SLOT(onFeatureTriggered()), QKeySequence());
304 myActionsMgr->addCommand(aId, salomeConnector()->command(aId));
305 salomeConnector()->setNestedActions(aId, aNestedFeatures.split(" "));
309 XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
310 XGUI_Workbench* aPage = aMenuBar->findWorkbench(aWchName);
312 aPage = addWorkbench(aWchName);
314 //Find or create Group
315 QString aGroupName = QString::fromStdString(theMessage->groupId());
316 XGUI_MenuGroupPanel* aGroup = aPage->findGroup(aGroupName);
318 aGroup = aPage->addGroup(aGroupName);
321 XGUI_Command* aCommand = aGroup->addFeature(QString::fromStdString(theMessage->id()),
322 QString::fromStdString(theMessage->text()),
323 QString::fromStdString(theMessage->tooltip()),
324 QIcon(theMessage->icon().c_str()),
325 QKeySequence(), isUsePropPanel);
326 aCommand->setUnblockableCommands(aNestedFeatures.split(" "));
327 myActionsMgr->addCommand(aCommand);
328 myPartSetModule->featureCreated(aCommand);
333 * Makes a signal/slot connections between Property Panel
334 * and given operation. The given operation becomes a
335 * current operation and previous operation if exists
337 void XGUI_Workshop::connectWithOperation(ModuleBase_Operation* theOperation)
339 QPushButton* aOkBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_OK);
340 connect(aOkBtn, SIGNAL(clicked()), theOperation, SLOT(commit()));
341 QPushButton* aCancelBtn = myPropertyPanel->findChild<QPushButton*>(XGUI::PROP_PANEL_CANCEL);
342 connect(aCancelBtn, SIGNAL(clicked()), theOperation, SLOT(abort()));
344 QAction* aCommand = 0;
345 if (isSalomeMode()) {
346 aCommand = salomeConnector()->command(theOperation->getDescription()->operationId());
348 XGUI_MainMenu* aMenu = myMainWindow->menuObject();
349 aCommand = aMenu->feature(theOperation->getDescription()->operationId());
351 //Abort operation on uncheck the command
352 connect(aCommand, SIGNAL(triggered(bool)), theOperation, SLOT(setRunning(bool)));
356 * Saves document with given name.
358 void XGUI_Workshop::saveDocument(QString theName)
360 QApplication::restoreOverrideCursor();
361 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
362 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
363 aDoc->save(theName.toLatin1().constData());
364 QApplication::restoreOverrideCursor();
367 //******************************************************
368 void XGUI_Workshop::onExit()
370 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
371 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
372 if(aDoc->isModified()) {
373 int anAnswer = QMessageBox::question(
374 myMainWindow, tr("Save current file"),
375 tr("The document is modified, save before exit?"),
376 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel);
377 if(anAnswer == QMessageBox::Save) {
379 } else if (anAnswer == QMessageBox::Cancel) {
386 //******************************************************
387 void XGUI_Workshop::onNew()
389 QApplication::setOverrideCursor(Qt::WaitCursor);
390 if (objectBrowser() == 0) {
392 mySelector->connectViewers();
394 myViewerProxy->connectToViewer();
396 if (!isSalomeMode()) {
397 myMainWindow->showPythonConsole();
398 QMdiSubWindow* aWnd = myMainWindow->viewer()->createView();
399 aWnd->showMaximized();
400 updateCommandStatus();
402 QApplication::restoreOverrideCursor();
405 //******************************************************
406 void XGUI_Workshop::onOpen()
408 //save current file before close if modified
409 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
410 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
411 if(aDoc->isModified()) {
412 //TODO(sbh): re-launch the app?
413 int anAnswer = QMessageBox::question(
414 myMainWindow, tr("Save current file"),
415 tr("The document is modified, save before opening another?"),
416 QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Cancel);
417 if(anAnswer == QMessageBox::Save) {
419 } else if (anAnswer == QMessageBox::Cancel) {
426 //show file dialog, check if readable and open
427 myCurrentFile = QFileDialog::getExistingDirectory(mainWindow());
428 if(myCurrentFile.isEmpty())
430 QFileInfo aFileInfo(myCurrentFile);
431 if(!aFileInfo.exists() || !aFileInfo.isReadable()) {
432 QMessageBox::critical(myMainWindow, tr("Warning"), tr("Unable to open the file."));
436 QApplication::setOverrideCursor(Qt::WaitCursor);
437 aDoc->load(myCurrentFile.toLatin1().constData());
438 QApplication::restoreOverrideCursor();
439 updateCommandStatus();
442 //******************************************************
443 void XGUI_Workshop::onSave()
445 if(myCurrentFile.isEmpty()) {
449 saveDocument(myCurrentFile);
450 updateCommandStatus();
453 //******************************************************
454 void XGUI_Workshop::onSaveAs()
456 QString aTemp = myCurrentFile;
457 myCurrentFile = QFileDialog::getSaveFileName(mainWindow());
458 if(myCurrentFile.isEmpty()) {
459 myCurrentFile = aTemp;
462 QFileInfo aFileInfo(myCurrentFile);
463 if(aFileInfo.exists() && !aFileInfo.isWritable()) {
464 QMessageBox::critical(myMainWindow, tr("Warning"), tr("Unable to save the file."));
470 //******************************************************
471 void XGUI_Workshop::onUndo()
473 objectBrowser()->setCurrentIndex(QModelIndex());
474 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
475 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
476 //if (!operationMgr()->abortOperation())
478 operationMgr()->abortOperation();
480 updateCommandStatus();
483 //******************************************************
484 void XGUI_Workshop::onRedo()
486 objectBrowser()->setCurrentIndex(QModelIndex());
487 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
488 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
490 updateCommandStatus();
493 //******************************************************
494 XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule)
497 QString::fromStdString(library(theModule.toStdString()));
498 if (libName.isEmpty()) {
500 qPrintable( tr( "Information about module \"%1\" doesn't exist." ).arg( theModule ) ));
505 CREATE_FUNC crtInst = 0;
508 HINSTANCE modLib = ::LoadLibrary((LPTSTR) qPrintable(libName));
512 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
513 0, ::GetLastError(), 0, (LPTSTR) & lpMsgBuf, 0, 0);
514 QString aMsg((char*) &lpMsgBuf);
515 err = QString("Failed to load %1. %2").arg(libName).arg(aMsg);
516 ::LocalFree(lpMsgBuf);
518 crtInst = (CREATE_FUNC) ::GetProcAddress(modLib, CREATE_MODULE);
522 FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
523 | FORMAT_MESSAGE_IGNORE_INSERTS,
524 0, ::GetLastError(), 0, (LPTSTR) & lpMsgBuf, 0, 0);
525 QString aMsg((char*) &lpMsgBuf);
526 err = QString("Failed to find %1 function. %2").arg( CREATE_MODULE).arg(aMsg);
527 ::LocalFree(lpMsgBuf);
531 void* modLib = dlopen( libName.toLatin1(), RTLD_LAZY );
533 err = QString( "Can not load library %1. %2" ).arg( libName ).arg( dlerror() );
535 crtInst = (CREATE_FUNC)dlsym( modLib, CREATE_MODULE );
537 err = QString( "Failed to find function %1. %2" ).arg( CREATE_MODULE ).arg( dlerror() );
542 XGUI_Module* aModule = crtInst ? crtInst(this) : 0;
544 if (!err.isEmpty()) {
546 QMessageBox::warning(mainWindow(), tr("Error"), err);
548 qWarning( qPrintable( err ));
554 //******************************************************
555 bool XGUI_Workshop::activateModule()
557 Config_ModuleReader aModuleReader;
558 QString moduleName = QString::fromStdString(aModuleReader.getModuleName());
559 myPartSetModule = loadModule(moduleName);
560 if (!myPartSetModule)
562 myPartSetModule->createFeatures();
566 //******************************************************
567 void XGUI_Workshop::updateCommandStatus()
569 if (isSalomeMode()) // TODO: update commands in SALOME
571 XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
573 QList<XGUI_Command*> aCommands = aMenuBar->features();
574 QList<XGUI_Command*>::const_iterator aIt;
576 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
577 if (aMgr->hasRootDocument()) {
578 XGUI_Command* aUndoCmd;
579 XGUI_Command* aRedoCmd;
580 foreach(XGUI_Command* aCmd, aCommands) {
581 if (aCmd->id() == "UNDO_CMD")
583 else if (aCmd->id() == "REDO_CMD")
585 else // Enable all commands
588 boost::shared_ptr<ModelAPI_Document> aDoc = aMgr->rootDocument();
589 aUndoCmd->setEnabled(aDoc->canUndo());
590 aRedoCmd->setEnabled(aDoc->canRedo());
592 foreach(XGUI_Command* aCmd, aCommands) {
593 if (aCmd->id() == "NEW_CMD")
595 else if (aCmd->id() == "EXIT_CMD")
603 //******************************************************
604 QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent)
606 QDockWidget* aObjDock = new QDockWidget(theParent);
607 aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
608 aObjDock->setWindowTitle(tr("Object browser"));
609 myObjectBrowser = new XGUI_ObjectsBrowser(aObjDock);
610 connect(myObjectBrowser, SIGNAL(activePartChanged(FeaturePtr)), this, SLOT(changeCurrentDocument(FeaturePtr)));
611 aObjDock->setWidget(myObjectBrowser);
613 myContextMenuMgr->connectObjectBrowser();
617 //******************************************************
619 * Creates dock widgets, places them in corresponding area
620 * and tabifies if necessary.
622 void XGUI_Workshop::createDockWidgets()
624 QMainWindow* aDesktop = isSalomeMode()? salomeConnector()->desktop() :
626 QDockWidget* aObjDock = createObjectBrowser(aDesktop);
627 aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock);
628 myPropertyPanel = new XGUI_PropertyPanel(aDesktop);
629 aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel);
630 hidePropertyPanel(); //<! Invisible by default
632 aDesktop->tabifyDockWidget(aObjDock, myPropertyPanel);
635 //******************************************************
636 void XGUI_Workshop::showPropertyPanel()
638 QAction* aViewAct = myPropertyPanel->toggleViewAction();
639 //<! Restore ability to close panel from the window's menu
640 aViewAct->setEnabled(true);
641 myPropertyPanel->show();
642 myPropertyPanel->raise();
645 //******************************************************
646 void XGUI_Workshop::hidePropertyPanel()
648 QAction* aViewAct = myPropertyPanel->toggleViewAction();
649 //<! Do not allow to show empty property panel
650 aViewAct->setEnabled(false);
651 myPropertyPanel->hide();
654 //******************************************************
655 void XGUI_Workshop::showObjectBrowser()
657 myObjectBrowser->parentWidget()->show();
660 //******************************************************
661 void XGUI_Workshop::hideObjectBrowser()
663 myObjectBrowser->parentWidget()->hide();
666 //******************************************************
667 void XGUI_Workshop::onFeatureTriggered()
669 QAction* aCmd = dynamic_cast<QAction*>(sender());
671 QString aId = salomeConnector()->commandId(aCmd);
673 myPartSetModule->launchOperation(aId);
677 //******************************************************
678 void XGUI_Workshop::changeCurrentDocument(FeaturePtr thePart)
680 boost::shared_ptr<ModelAPI_PluginManager> aMgr = ModelAPI_PluginManager::get();
682 boost::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = thePart->data()->docRef("PartDocument");
684 aMgr->setCurrentDocument(aDocRef->value());
686 aMgr->setCurrentDocument(aMgr->rootDocument());
690 //******************************************************
691 void XGUI_Workshop::salomeViewerSelectionChanged()
693 emit salomeViewerSelection();
697 //**************************************************************
698 XGUI_SalomeViewer* XGUI_Workshop::salomeViewer() const
700 return mySalomeConnector->viewer();