From 412c9bda264e8ad6f09ff47431954d11e47f8b15 Mon Sep 17 00:00:00 2001 From: mkr Date: Wed, 23 Apr 2008 12:39:26 +0000 Subject: [PATCH] Fix for bug IPAL19492 : Qt4 porting: object browser preferences don't influence on the columns. --- src/SalomeApp/SalomeApp_Application.cxx | 22 +++++++++++++++++++++ src/SalomeApp/SalomeApp_Application.h | 3 +++ src/SalomeApp/resources/SalomeApp.xml | 4 ++-- src/SalomeApp/resources/SalomeApp_msg_en.po | 4 ++-- src/SalomeApp/resources/SalomeApp_msg_en.ts | 4 ++-- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 19cf616f9..c724c08e5 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -48,6 +48,7 @@ #include #include +#include // temporary commented //#include @@ -1276,6 +1277,14 @@ void SalomeApp_Application::onDeleteGUIState() updateSavePointDataObjects( study ); } +/*!Called on New study operation*/ +void SalomeApp_Application::onStudyCreated( SUIT_Study* study ) +{ + LightApp_Application::onStudyCreated( study ); + + objectBrowserColumnsVisibility(); +} + /*!Called on Save study operation*/ void SalomeApp_Application::onStudySaved( SUIT_Study* study ) { @@ -1293,6 +1302,8 @@ void SalomeApp_Application::onStudyOpened( SUIT_Study* study ) { LightApp_Application::onStudyOpened( study ); + objectBrowserColumnsVisibility(); + // temporary commented /*if ( objectBrowser() ) { updateSavePointDataObjects( dynamic_cast( study ) ); @@ -1397,3 +1408,14 @@ bool SalomeApp_Application::useStudy( const QString& theName ) updateCommandsStatus(); return res; } + +/*! Show/hide object browser colums according to preferences */ +void SalomeApp_Application::objectBrowserColumnsVisibility() +{ + if ( objectBrowser() ) + for ( int i = SalomeApp_DataObject::EntryIdx; i <= SalomeApp_DataObject::RefEntryIdx; i++ ) + objectBrowser()->treeView()->setColumnHidden( i, + !(resourceMgr()->booleanValue( "ObjectBrowser", + QString().sprintf( "visibility_column_%d", i-1 ), + true )) ); +} diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index d23bef56a..72954e919 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -107,6 +107,7 @@ public slots: void onSaveGUIState();// called from VISU protected slots: + void onStudyCreated( SUIT_Study* ); void onStudySaved( SUIT_Study* ); void onStudyOpened( SUIT_Study* ); void onDesktopMessage( const QString& ); @@ -131,6 +132,8 @@ protected: virtual QMap activateModuleActions() const; virtual void moduleActionSelected( const int ); + void objectBrowserColumnsVisibility(); + private slots: void onDeleteInvalidReferences(); void onDblClick( QListViewItem* ); diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index fe7e5a04d..3ff2c7220 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -83,8 +83,8 @@ - - + + diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.po b/src/SalomeApp/resources/SalomeApp_msg_en.po index c5c5fe7bd..d363ec7af 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.po +++ b/src/SalomeApp/resources/SalomeApp_msg_en.po @@ -155,10 +155,10 @@ msgid "SalomeApp_Application::OBJ_BROWSER_NAME" msgstr "Object" msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_0" -msgstr "Value" +msgstr "Entry" msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_1" -msgstr "Entry" +msgstr "Value" msgid "SalomeApp_Application::OBJ_BROWSER_COLUMN_2" msgstr "IOR" diff --git a/src/SalomeApp/resources/SalomeApp_msg_en.ts b/src/SalomeApp/resources/SalomeApp_msg_en.ts index 37f3e3d9b..146e43ade 100644 --- a/src/SalomeApp/resources/SalomeApp_msg_en.ts +++ b/src/SalomeApp/resources/SalomeApp_msg_en.ts @@ -187,11 +187,11 @@ Do you want to reload it ? OBJ_BROWSER_COLUMN_0 - Value + Entry OBJ_BROWSER_COLUMN_1 - Entry + Value OBJ_BROWSER_COLUMN_2 -- 2.39.2