]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #124: Hide dock windows in Salome on deactivation of module
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 12 Sep 2014 14:00:13 +0000 (18:00 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 12 Sep 2014 14:00:13 +0000 (18:00 +0400)
src/NewGeom/NewGeom_Module.cpp

index 023a1ffb10f3322e5e0a8fc2e2604c6b8c5f92dc..412407827058d8722fc4227bd3670c60c29b8743 100644 (file)
@@ -109,6 +109,15 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
     setMenuShown(true);
     setToolShown(true);
 
+    QObject* aObj = myWorkshop->objectBrowser()->parent();
+    QDockWidget* aObjDoc = dynamic_cast<QDockWidget*>(aObj);
+    if (aObjDoc) {
+      QAction* aViewAct = aObjDoc->toggleViewAction();
+      aViewAct->setEnabled(true);
+      myWorkshop->objectBrowser()->setVisible(true);
+      aObjDoc->setVisible(true);
+    }
+
     if (!mySelector) {
       ViewManagerList OCCViewManagers;
       application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers);
@@ -135,6 +144,19 @@ bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy)
 {
   setMenuShown(false);
   setToolShown(false);
+
+  myWorkshop->propertyPanel()->setVisible(false);
+  desktop()->removeDockWidget(myWorkshop->propertyPanel());
+
+  QObject* aObj = myWorkshop->objectBrowser()->parent();
+  QDockWidget* aObjDoc = dynamic_cast<QDockWidget*>(aObj);
+  if (aObjDoc) {
+    aObjDoc->setVisible(false);
+    myWorkshop->objectBrowser()->setVisible(false);
+    QAction* aViewAct = aObjDoc->toggleViewAction();
+    aViewAct->setEnabled(false);
+  }
+
   //myWorkshop->contextMenuMgr()->disconnectViewer();
   return LightApp_Module::deactivateModule(theStudy);
 }