]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
FIX of INTPAL 52634: "Camera Controls" and "Center Axes Controls" tool-bars are alway...
authorakl <alexander.kovalev@opencascade.com>
Tue, 24 Mar 2015 06:42:59 +0000 (10:42 +0400)
committerakl <alexander.kovalev@opencascade.com>
Tue, 24 Mar 2015 06:42:59 +0000 (10:42 +0400)
src/PVViewer/PVViewer_GUIElements.cxx
src/PVViewer/PVViewer_GUIElements.h
src/PVViewer/PVViewer_ViewManager.cxx
src/PVViewer/PVViewer_ViewManager.h

index 411dccf1c2baa8a363fc3ce1030533c1e60a56f5..ac4a4536740ed2f82ed3ec70a185b31f4b369808 100644 (file)
@@ -198,3 +198,17 @@ QList<QToolBar*> PVViewer_GUIElements::getToolbars()
     << commonToolbar << dataToolbar;
   return l;
 }
+
+void PVViewer_GUIElements::setToolBarEnabled(bool enabled)
+{
+  mainToolBar  ->setEnabled(enabled);
+  vcrToolbar   ->setEnabled(enabled);
+  timeToolbar  ->setEnabled(enabled);
+  colorToolbar ->setEnabled(enabled);
+  reprToolbar  ->setEnabled(enabled);
+  cameraToolbar->setEnabled(enabled);
+  axesToolbar  ->setEnabled(enabled);
+  macrosToolbar->setEnabled(enabled);
+  commonToolbar->setEnabled(enabled);
+  dataToolbar  ->setEnabled(enabled);
+}
index 382f9f7b4ac8e99d254413224a0b88af636fb8bc..92d5d7111094195ba039ca0e11d2260b48aa54e5 100644 (file)
@@ -59,6 +59,7 @@ public:
   void myBuildToolbars(SUIT_Desktop* desk);
   void addToolbars(SUIT_Desktop* desk);
   void setToolBarVisible(bool show);
+  void setToolBarEnabled(bool enabled);
   QList<QToolBar*> getToolbars();
 
 public slots:
index 8fa82f047a1c6f9907cfae31652a4ec2ab4d784d..0e5ed865649b12de8b18cda659add071d3db77a6 100644 (file)
@@ -70,6 +70,8 @@ PVViewer_ViewManager::PVViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* des
   // Initialize minimal paraview stuff (if not already done)
   ParaviewInitApp(desk, logWindow);
 
+  connect( desk, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
 //  connect(this, SIGNAL(viewCreated(SUIT_ViewWindow*)), this, SLOT(onPVViewCreated(SUIT_ViewWindow*)));
 }
 
@@ -238,3 +240,15 @@ void PVViewer_ViewManager::onEmulateApply()
   PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desktop);
   guiElements->onEmulateApply();
 }
+
+/*!Enable toolbars if view \a view is ParaView viewer and disable otherwise.
+*/
+void PVViewer_ViewManager::onWindowActivated(SUIT_ViewWindow* view)
+{
+  if (view)
+    {
+    PVViewer_ViewWindow* pvWindow = dynamic_cast<PVViewer_ViewWindow*>(view);
+    PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desktop);
+    guiElements->setToolBarEnabled(pvWindow!=0);
+    }
+}
index 9bbc74aa4cab85ca9c3ecbb55a7bb222357405b4..65871c883db9b553e6913be8aacfbb75987ba6e9 100644 (file)
@@ -58,6 +58,9 @@ public:
 public slots:
   void onEmulateApply();
 
+protected slots:
+  void onWindowActivated(SUIT_ViewWindow*);
+
 private:
   static pqPVApplicationCore* MyCoreApp;
   static bool ConfigLoaded;