From: mpa Date: Mon, 18 May 2015 14:22:46 +0000 (+0300) Subject: INT PAL 0022812: TC6.4.0: prefernces work only for a new study X-Git-Tag: V7_6_0rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=41b6f904ba5ef8506d54e9aea2c6070a996e9ae2;p=modules%2Fgui.git INT PAL 0022812: TC6.4.0: prefernces work only for a new study --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index ef92a88d4..4064fb3d2 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -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(); if ( !accel.isEmpty() ) diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index d53467536..24d59fbcb 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -207,6 +207,7 @@ public slots: virtual void onCopy(); virtual void onPaste(); virtual void onSelectionChanged(); + virtual void onDockWindowVisibilityChanged( bool ); protected: virtual void createActions(); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 296efc161..04b1eb2cf 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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)" */ diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 702279474..d64b1e4c8 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -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* );