From a920ff88a44b54c432e350d4fdc55d596b1f319b Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Sat, 30 Jan 2016 13:07:13 +0100 Subject: [PATCH 1/1] add GUI preference for automatic loading of Light modules at study opening --- doc/salome/gui/input/setting_preferences.doc | 3 +++ src/LightApp/LightApp_Application.cxx | 1 + src/LightApp/resources/LightApp.xml | 1 + src/LightApp/resources/LightApp_msg_en.ts | 4 ++++ src/LightApp/resources/LightApp_msg_fr.ts | 4 ++++ src/LightApp/resources/LightApp_msg_ja.ts | 4 ++++ src/SalomeApp/SalomeApp_VisualState.cxx | 9 +++++++-- src/SalomeApp/resources/SalomeApp.xml | 1 + 8 files changed, 25 insertions(+), 2 deletions(-) diff --git a/doc/salome/gui/input/setting_preferences.doc b/doc/salome/gui/input/setting_preferences.doc index 478666f5a..0b26fbda7 100644 --- a/doc/salome/gui/input/setting_preferences.doc +++ b/doc/salome/gui/input/setting_preferences.doc @@ -59,6 +59,9 @@ the whole GUI SALOME session. the SALOME platform. - ASCII save - if checked in, your study will be saved in ASCII format file (or files). + - Automatic loading of light modules when opening study - if checked in, + Light Modules of the current study will be automatically loaded at the next study + opening, allowing completion of object browser. - Store positions of windows - 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. diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index c0b35e467..0a3399ae4 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -2241,6 +2241,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" ); diff --git a/src/LightApp/resources/LightApp.xml b/src/LightApp/resources/LightApp.xml index befb3b4e2..37c53bb80 100644 --- a/src/LightApp/resources/LightApp.xml +++ b/src/LightApp/resources/LightApp.xml @@ -125,6 +125,7 @@
+ diff --git a/src/LightApp/resources/LightApp_msg_en.ts b/src/LightApp/resources/LightApp_msg_en.ts index 8fca4a604..21e76543d 100644 --- a/src/LightApp/resources/LightApp_msg_en.ts +++ b/src/LightApp/resources/LightApp_msg_en.ts @@ -155,6 +155,10 @@ The changes will be applied on the next application session. PREF_GROUP_VTKVIEWER VTK 3D Viewer + + PREF_LOAD_LIGHT + Automatic loading of light modules when opening study + PREF_STORE_POS Store positions of windows diff --git a/src/LightApp/resources/LightApp_msg_fr.ts b/src/LightApp/resources/LightApp_msg_fr.ts index 63b93ab94..60a4e23d7 100755 --- a/src/LightApp/resources/LightApp_msg_fr.ts +++ b/src/LightApp/resources/LightApp_msg_fr.ts @@ -155,6 +155,10 @@ Les modifications seront appliquées à la prochaine session. PREF_GROUP_VTKVIEWER Scène VTK 3D + + PREF_LOAD_LIGHT + Chargement automatique des modules Light à l'ouverture d'étude + PREF_STORE_POS Enregistrer la position des fenêtres diff --git a/src/LightApp/resources/LightApp_msg_ja.ts b/src/LightApp/resources/LightApp_msg_ja.ts index 084e385be..11da88ffa 100644 --- a/src/LightApp/resources/LightApp_msg_ja.ts +++ b/src/LightApp/resources/LightApp_msg_ja.ts @@ -155,6 +155,10 @@ CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITASPREF_GROUP_VTKVIEWER VTK 3D Viewer + + PREF_LOAD_LIGHT + Automatic loading of light modules when opening study + PREF_STORE_POS ウィンドウの位置を保存 diff --git a/src/SalomeApp/SalomeApp_VisualState.cxx b/src/SalomeApp/SalomeApp_VisualState.cxx index 8dd15089a..a1183d641 100644 --- a/src/SalomeApp/SalomeApp_VisualState.cxx +++ b/src/SalomeApp/SalomeApp_VisualState.cxx @@ -26,7 +26,8 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" -//#include +#include +#include #include #include #include @@ -174,13 +175,17 @@ int SalomeApp_VisualState::storeState() myApp->modules( mlist ); QListIterator 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( 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( module ) ) sModule->storeVisualParameters( savePoint ); } diff --git a/src/SalomeApp/resources/SalomeApp.xml b/src/SalomeApp/resources/SalomeApp.xml index 20c6b4172..3fd82cba8 100644 --- a/src/SalomeApp/resources/SalomeApp.xml +++ b/src/SalomeApp/resources/SalomeApp.xml @@ -54,6 +54,7 @@
+ -- 2.30.2