]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for bug IPAL19492 : Qt4 porting: object browser preferences don't influence on...
authormkr <mkr@opencascade.com>
Wed, 23 Apr 2008 12:39:26 +0000 (12:39 +0000)
committermkr <mkr@opencascade.com>
Wed, 23 Apr 2008 12:39:26 +0000 (12:39 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_msg_en.po
src/SalomeApp/resources/SalomeApp_msg_en.ts

index 19cf616f9165e70d06f30778bac973c61fa6c30e..c724c08e54e3e3b189004acb1f7e3e02c5707861 100644 (file)
@@ -48,6 +48,7 @@
 #include <SUIT_ResourceMgr.h>
 
 #include <QtxMRUAction.h>
+#include <QtxTreeView.h>
 
 // temporary commented
 //#include <OB_ListItem.h>
@@ -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<SalomeApp_Study*>( 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 )) );
+}
index d23bef56adaaac0ac3a4ee8b62ddb0ac3dbb5c77..72954e9197a8d80ba0bdf9e382969b5207f0b96e 100644 (file)
@@ -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<int, QString>          activateModuleActions() const;
   virtual void                        moduleActionSelected( const int );
 
+  void                                objectBrowserColumnsVisibility();
+
 private slots:
   void                                onDeleteInvalidReferences();
   void                                onDblClick( QListViewItem* );
index fe7e5a04de91afba9049c94bc6dc6e3c115d7fc4..3ff2c72203668e519fb13e04cd2297b0365ea299 100644 (file)
@@ -83,8 +83,8 @@
     <parameter name="auto_hide_search_tool" value="true" />
     <parameter name="auto_size"             value="false" />
     <parameter name="auto_size_first"       value="true"  />
-    <parameter name="visibility_column_0"   value="true"  />
-    <parameter name="visibility_column_1"   value="false" />
+    <parameter name="visibility_column_0"   value="false"  />
+    <parameter name="visibility_column_1"   value="true" />
     <parameter name="visibility_column_2"   value="false" />
     <parameter name="visibility_column_3"   value="false" />
   </section>
index c5c5fe7bd5dc96556a07cf6b9814c822b402c527..d363ec7af30ef2f59a60d7dd6b2b6b2f89d51d37 100644 (file)
@@ -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"
index 37f3e3d9bde21acd68c8c45fc817a45e4985640e..146e43ade74443cfff0bb6ab7d398994945efc79 100644 (file)
@@ -187,11 +187,11 @@ Do you want to reload it ?</translation>
     </message>
     <message>
         <source>OBJ_BROWSER_COLUMN_0</source>
-        <translation>Value</translation>
+        <translation>Entry</translation>
     </message>
     <message>
         <source>OBJ_BROWSER_COLUMN_1</source>
-        <translation>Entry</translation>
+        <translation>Value</translation>
     </message>
     <message>
         <source>OBJ_BROWSER_COLUMN_2</source>