]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
INT PAL 0022812: TC6.4.0: prefernces work only for a new study
authormpa <mpa@opencascade.com>
Mon, 18 May 2015 14:22:46 +0000 (17:22 +0300)
committermpa <mpa@opencascade.com>
Mon, 18 May 2015 14:22:46 +0000 (17:22 +0300)
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h

index ef92a88d48c38ff2de8217c31830b434acd584d7..4064fb3d27aa89c876a7d5460aeb8af764f80199 100644 (file)
@@ -1230,6 +1230,13 @@ void LightApp_Application::onSelectionChanged()
   action( EditPasteId )->setEnabled(canPaste);
 }
 
+/*!
+  SLOT: Performs some actions when dockable windows are triggered
+*/
+void LightApp_Application::onDockWindowVisibilityChanged( bool )
+{
+}
+
 QWidget* LightApp_Application::dockWindow( const int id ) const
 {
   QWidget* wid = 0;
@@ -1270,6 +1277,9 @@ void LightApp_Application::insertDockWindow( const int id, QWidget* wid )
   dock->setObjectName( wid->objectName().isEmpty() ? QString( "window_%1" ).arg( id ) : 
                       QString( "%1Dock" ).arg( wid->objectName() ) );
   dock->setWidget( wid );
+  dock->toggleViewAction()->setData( QVariant( wid->objectName() ) );
+  connect( dock->toggleViewAction(), SIGNAL( triggered( bool ) ),
+           this, SLOT( onDockWindowVisibilityChanged( bool ) ) );
 
   QKeySequence accel = wid->property( "shortcut" ).value<QKeySequence>();
   if ( !accel.isEmpty() )
index d53467536c79efb0303c6ffe5f1bba6fbfa2143c..24d59fbcbfcb4aa3f0b61b1080163c35c8ee063d 100644 (file)
@@ -207,6 +207,7 @@ public slots:
   virtual void                        onCopy();
   virtual void                        onPaste();
   virtual void                        onSelectionChanged();
+  virtual void                        onDockWindowVisibilityChanged( bool );
 
 protected:
   virtual void                        createActions();
index 296efc161f2fc6b617064afa0764fb8ce8f46575..04b1eb2cf4cc4353e97f3c3999781254a4fab5c6 100644 (file)
@@ -1037,6 +1037,16 @@ void SalomeApp_Application::onLocalCheckIn()
 #endif
 }
 
+/*!Public SLOT. Performs some actions when dockable windows are triggered.*/
+void SalomeApp_Application::onDockWindowVisibilityChanged( bool theIsVisible )
+{
+  LightApp_Application::onDockWindowVisibilityChanged( theIsVisible );
+  QAction* send = (QAction*)sender();
+  QString aWinName = send->data().toString();
+  if ( theIsVisible && aWinName == "objectBrowser" )
+    objectBrowserColumnsVisibility();
+}
+
 /*!Gets file filter.
  *\retval QString "(*.hdf)"
  */
index 702279474ed6ffe5fb579d6c440818e3707e785d..d64b1e4c87d59ca072f80a7dc68f80b6e3746c81 100644 (file)
@@ -140,6 +140,8 @@ public slots:
   virtual void                        onCheckIn();
   virtual void                        onLocalCheckIn();
 
+  virtual void                        onDockWindowVisibilityChanged( bool );
+
 protected slots:
   void                                onStudyCreated( SUIT_Study* );
   void                                onStudyOpened( SUIT_Study* );