Salome HOME
add GUI preference for automatic loading of Light modules at study opening
authorPaul RASCLE <paul.rascle@edf.fr>
Sat, 30 Jan 2016 12:07:13 +0000 (13:07 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Tue, 16 Feb 2016 16:10:22 +0000 (17:10 +0100)
doc/salome/gui/input/setting_preferences.doc
src/LightApp/LightApp_Application.cxx
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts
src/SalomeApp/SalomeApp_VisualState.cxx
src/SalomeApp/resources/SalomeApp.xml

index 478666f5ad499a3c91674dc9563d0d5265860458..0b26fbda723015c8d9459488e5d1262902067d32 100644 (file)
@@ -59,6 +59,9 @@ the whole GUI SALOME session.
     the SALOME platform. 
   - <b>ASCII save</b> - if checked in, your study will be saved in
     ASCII format file (or files).
+  - <b>Automatic loading of light modules when opening study</b> -  if checked in, 
+    Light Modules of the current study will be automatically loaded at the next study
+    opening, allowing completion of object browser.
   - <b>Store positions of windows</b> -  if checked in, positions of windows
     will be saved in a special file at the end of the current session and
     then restored for a new session.
index c800af179314a353d9d6bd1ab280828bac13529e..3c25f3a045dc5a3d207caf3b16853d3dad361eb9 100644 (file)
@@ -2250,6 +2250,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   // .... -> ascii save mode
   pref->addPreference( tr( "PREF_ASCII_FILE" ), studyGroup, LightApp_Preferences::Bool, "Study", "ascii_file" );
   // .... -> store windows geometry
+  pref->addPreference( tr( "PREF_LOAD_LIGHT" ), studyGroup, LightApp_Preferences::Bool, "Study", "autoload_light_modules" );
   pref->addPreference( tr( "PREF_STORE_POS" ),  studyGroup, LightApp_Preferences::Bool, "Study", "store_positions" );
   pref->addPreference( "", studyGroup, LightApp_Preferences::Space );
   pref->addPreference( tr( "PREF_STORE_TOOL_POS" ),  studyGroup, LightApp_Preferences::Bool, "Study", "store_tool_positions" );
index befb3b4e2ea593233c5cbbe5fb26a0c14c8c51e2..37c53bb808bc9344ece413c40475ce1d73dda349 100644 (file)
   </section>
   <section name="Study">
     <!-- General study settings -->
+    <parameter name="autoload_light_modules"    value="true" />
     <parameter name="store_positions"    value="true" />
     <parameter name="store_tool_positions"     value="true" />
     <parameter name="auto_save_interval" value="0" />
index 8fca4a6048dcf2e50de153356d7fe030bc3d0056..21e76543d72b59d9e84e61754cc142d78ab5e541 100644 (file)
@@ -155,6 +155,10 @@ The changes will be applied on the next application session.</translation>
         <source>PREF_GROUP_VTKVIEWER</source>
         <translation>VTK 3D Viewer</translation>
     </message>
+    <message>
+        <source>PREF_LOAD_LIGHT</source>
+        <translation>Automatic loading of light modules when opening study</translation>
+    </message>
     <message>
         <source>PREF_STORE_POS</source>
         <translation>Store positions of windows</translation>
index 63b93ab94dee8c675cc1406bc2f4b9e5053dfe3a..60a4e23d7572c905aeddd9683f9e2514275d4083 100755 (executable)
@@ -155,6 +155,10 @@ Les modifications seront appliquées à la prochaine session.</translation>
         <source>PREF_GROUP_VTKVIEWER</source>
         <translation>Scène VTK 3D</translation>
     </message>
+    <message>
+        <source>PREF_LOAD_LIGHT</source>
+        <translation>Chargement automatique des modules Light à l'ouverture d'étude</translation>
+    </message>
     <message>
         <source>PREF_STORE_POS</source>
         <translation>Enregistrer la position des fenêtres</translation>
index 084e385be48ac50f81400fd7c6193428dfdaba52..11da88ffa6a11856f97c744855d75d0a837cfa35 100644 (file)
@@ -155,6 +155,10 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
       <source>PREF_GROUP_VTKVIEWER</source>
       <translation>VTK 3D Viewer</translation>
     </message>
+    <message>
+      <source>PREF_LOAD_LIGHT</source>
+      <translation>Automatic loading of light modules when opening study</translation>
+    </message>
     <message>
       <source>PREF_STORE_POS</source>
       <translation>ウィンドウの位置を保存</translation>
index 8dd15089a2805909387379f6a5743f3dad53a8d3..a1183d641e66d6d2ae5ca2a887a710f41826ba5f 100644 (file)
@@ -26,7 +26,8 @@
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
 
-//#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
 #include <SUIT_ViewManager.h>
 #include <SUIT_ViewWindow.h>
 #include <QtxWorkstack.h>
@@ -174,13 +175,17 @@ int SalomeApp_VisualState::storeState()
   myApp->modules( mlist );
   QListIterator<CAM_Module*> itM( mlist );
   CAM_Module* module = 0;
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  bool loadLight = aResMgr->booleanValue( "Study", "autoload_light_modules", true );
+
   while ( itM.hasNext() ) {
     module = itM.next();
     if ( !module ) continue;
 
 
     if ( LightApp_Module* lModule = dynamic_cast<LightApp_Module*>( module ) ) {
-      ip->append( "AP_MODULES_LIST", lModule->moduleName().toStdString() );
+      if (loadLight)
+        ip->append( "AP_MODULES_LIST", lModule->moduleName().toStdString() );
       if ( SalomeApp_Module* sModule = dynamic_cast<SalomeApp_Module*>( module ) )
         sModule->storeVisualParameters( savePoint );
     }
index 20c6b4172a6352f83c3c9231b1d148265344534e..3fd82cba880d8f4f8a58018ffd3f05d05d3d40ea 100644 (file)
@@ -54,6 +54,7 @@
   </section>
   <section name="Study">
     <!-- General study settings -->
+    <parameter name="autoload_light_modules"     value="true" />
     <parameter name="store_positions"     value="true" />
     <parameter name="store_tool_positions"     value="true" />
     <parameter name="store_visual_state"  value="false" />