Salome HOME
Merge branch 'occ/shaper2smesh'
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI.cpp
index c9fffc916452dd9f1c75b2e122f8db374968198a..1ac461065e957c789673cdf65b4cd0e760221c6e 100644 (file)
@@ -417,6 +417,14 @@ bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
     //}
     myWorkshop->displayer()->setSelectionColor(myOldSelectionColor);
     myProxyViewer->setSelector(0);
+
+    LightApp_SelectionMgr* aMgr = getApp()->selectionMgr();
+    QList<SUIT_Selector*> aList;
+    aMgr->selectors(aList);
+    foreach(SUIT_Selector* aSel, aList) {
+      aSel->setEnabled(aSel != mySelector);
+    }
+
     delete mySelector;
     mySelector = 0;
   }
@@ -444,6 +452,8 @@ bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
   connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
           getApp(), SLOT(onSaveAsDoc()));
 
+  publishToStudy();
+
   return LightApp_Module::deactivateModule(theStudy);
 }
 
@@ -1178,3 +1188,9 @@ void SHAPERGUI::resetToolbars()
   SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
   aResMgr->remove(ToolbarsSection);
 }
+
+void SHAPERGUI::publishToStudy()
+{
+  if (isActiveModule())
+    myWorkshop->module()->launchOperation("PublishToStudy", false);
+}