+ XGUI_ObjectsBrowser* aBrowser = myWorkshop->objectBrowser();
+ if (theValues.isEmpty()) {
+ myWorkshop->selector()->clearSelection();
+ aBrowser->treeView()->clearSelection();
+ } else {
+ myWorkshop->selector()->setSelected(theValues);
+ }
+}
+
+void XGUI_ModuleConnector::setStatusBarMessage(const QString& theMessage)
+{
+ myWorkshop->setStatusBarMessage(theMessage);
+}
+
+bool XGUI_ModuleConnector::canStartOperation(QString theId, bool& isCommitted)
+{
+ return myWorkshop->operationMgr()->canStartOperation(theId, isCommitted);
+}
+
+void XGUI_ModuleConnector::processLaunchOperation(ModuleBase_Operation* theOperation)
+{
+ XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
+
+ if (anOperationMgr->startOperation(theOperation)) {
+ ModuleBase_OperationFeature* aFOperation =
+ dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
+ if (aFOperation) {
+ workshop()->propertyPanel()->updateContentWidget(aFOperation->feature());
+ workshop()->propertyPanel()->createContentPanel(aFOperation->feature());
+ }
+ if (!theOperation->getDescription()->hasXmlRepresentation()) {
+ if (theOperation->commit())
+ workshop()->updateCommandStatus();
+ }
+ }
+}
+
+ModuleBase_Operation* XGUI_ModuleConnector::findStartedOperation(const QString& theId)
+{
+ return myWorkshop->operationMgr()->findOperation(theId);
+}
+
+bool XGUI_ModuleConnector::canStopOperation(ModuleBase_Operation* theOperation)
+{
+ return myWorkshop->operationMgr()->canStopOperation(theOperation);
+}
+
+void XGUI_ModuleConnector::stopOperation(ModuleBase_Operation* theOperation,
+ bool& isCommitted)
+{
+ myWorkshop->operationMgr()->stopOperation(theOperation, isCommitted);
+}
+
+void XGUI_ModuleConnector::updateCommandStatus()
+{
+ myWorkshop->updateCommandStatus();
+}
+
+QMainWindow* XGUI_ModuleConnector::desktop() const
+{
+ return myWorkshop->desktop();
+}
+
+bool XGUI_ModuleConnector::hasSHIFTPressed() const
+{
+ return myWorkshop->operationMgr()->hasSHIFTPressed();
+}
+
+std::shared_ptr<Config_FeatureMessage> XGUI_ModuleConnector::featureInfo(const QString& theId) const
+{
+#ifdef HAVE_SALOME
+ return myWorkshop->salomeConnector()->featureInfo(theId);
+#else
+ AppElements_Command* aAction =
+ dynamic_cast<AppElements_Command*>(myWorkshop->actionsMgr()->action(theId));
+ if (aAction)
+ return aAction->featureMessage();
+ return std::shared_ptr<Config_FeatureMessage>();
+#endif
+}
+
+void XGUI_ModuleConnector::deactivateCurrentSelector()
+{
+ myWorkshop->deactivateCurrentSelector();
+}
+
+QObjectPtrList XGUI_ModuleConnector::displayedObjects() const
+{
+ return myWorkshop->displayer()->displayedObjects();
+}
+
+bool XGUI_ModuleConnector::enableUpdateViewer(bool isEnabled)
+{
+ return myWorkshop->displayer()->enableUpdateViewer(isEnabled);
+}
+
+
+void XGUI_ModuleConnector::applyCurrentSelectionModes(const AISObjectPtr& theAIS)
+{
+ Handle(AIS_InteractiveObject) anIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
+ myWorkshop->selectionActivate()->activate(anIO, false);
+}
+
+
+void XGUI_ModuleConnector::undo()
+{
+ myWorkshop->onUndo();
+}
+
+void XGUI_ModuleConnector::setCancelEnabled(bool toEnable)
+{
+ XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
+ QAction* aAbortAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll);
+ QAction* aAbortAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort);
+ if (aAbortAction) {
+ aAbortAction->setEnabled(toEnable);
+ }
+ if (aAbortAllAction) {
+ aAbortAllAction->setEnabled(toEnable);
+ }
+}
+
+bool XGUI_ModuleConnector::isCancelEnabled() const
+{
+ XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
+ QAction* aAbortAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AbortAll);
+ QAction* aAbortAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort);
+ bool isEnabled = false;
+ if (aAbortAction) {
+ isEnabled = true;
+ }
+ if (aAbortAllAction) {
+ isEnabled &= true;
+ }
+ return isEnabled;
+}
+
+void XGUI_ModuleConnector::showHelpPage(const QString& thePage) const
+{
+ workshop()->showHelpPage(thePage);
+}