Salome HOME
Additional fix of INTPAL 52639: Creation of ParaView viewer makes Paraview toolbars...
[modules/paravis.git] / src / PVGUI / PVGUI_Module_widgets.cxx
index 2f5555bd501b38eea8486307dd48819166e23530..a20a3af46b19fca2fc7a9c807e78068f775bdbd3 100644 (file)
@@ -56,7 +56,6 @@
 #include <pqMultiBlockInspectorPanel.h>
 #include <pqProgressWidget.h>
 #include <pqProgressManager.h>
-//#include <pqDisplayProxyEditorWidget.h>
 #include <pqPropertiesPanel.h>
 
 #include <pqApplicationCore.h>
@@ -71,7 +70,7 @@
 
 class ResizeHelper : public pqPVAnimationWidget
 {
-  // TEMPORARILY WORKAROUND AROUND PARAVIEW 3.14 BUG:
+  // TEMPORARY WORKAROUND AROUND PARAVIEW 3.14 BUG:
   // WHEN ANIMATION VIEW IS RESIZED, ITS CONTENTS IS NOT PREPERLY RE-ARRANGED
   // CAUSING SOME CONTROLS TO STAY NON-VISIBLE
   // THIS BUG IS NATURALLY FIXED BY ADDING
@@ -95,8 +94,6 @@ protected:
   }
 };
 
-
-
 /*!
   \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc.
   ParaView pqMainWindowCore class is fully responsible for these dock widgets' contents.
@@ -346,7 +343,7 @@ void PVGUI_Module::setupDockWidgets()
 /*!
   \brief Save states of dockable ParaView widgets.
 */
-void PVGUI_Module::saveDockWidgetsState()
+void PVGUI_Module::saveDockWidgetsState(bool hideWidgets)
 {
   SUIT_Desktop* desk = application()->desktop();
 
@@ -365,8 +362,10 @@ void PVGUI_Module::saveDockWidgetsState()
     it1.next();
     QDockWidget* dw = qobject_cast<QDockWidget*>( it1.key() );
     myDockWidgets[dw] = dw->isVisible();
-    dw->setVisible( false );
-    dw->toggleViewAction()->setVisible( false );
+    if ( hideWidgets ) {
+      dw->setVisible( false );
+      dw->toggleViewAction()->setVisible( false );
+    }
   }
   // store toolbar breaks state and remove all tollbar breaks 
   QMapIterator<QWidget*, bool> it2( myToolbarBreaks );
@@ -374,7 +373,7 @@ void PVGUI_Module::saveDockWidgetsState()
     it2.next();
     QToolBar* tb = qobject_cast<QToolBar*>( it2.key() );
     myToolbarBreaks[tb] = desk->toolBarBreak( tb );
-    if ( myToolbarBreaks[tb] )
+    if ( myToolbarBreaks[tb] && hideWidgets )
       desk->removeToolBarBreak( tb );
   }
   // store toolbars visibility state and hide'em all
@@ -383,8 +382,10 @@ void PVGUI_Module::saveDockWidgetsState()
     it3.next();
     QToolBar* tb = qobject_cast<QToolBar*>( it3.key() );
     myToolbars[tb] = tb->isVisible();
-    tb->setVisible( false );
-    tb->toggleViewAction()->setVisible( false );
+    if ( hideWidgets ) {
+      tb->setVisible( false );
+      tb->toggleViewAction()->setVisible( false );
+    }
   }
 }