]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
implemented preferences for visual parameters
authorasv <asv@opencascade.com>
Wed, 1 Mar 2006 15:16:33 +0000 (15:16 +0000)
committerasv <asv@opencascade.com>
Wed, 1 Mar 2006 15:16:33 +0000 (15:16 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_VisualState.cxx
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_msg_en.po

index 3baab9935d4d190d28133450b253601dfa2a5f6a..3e605fe86bb4df7c77763c343977af0bdfe64a08 100644 (file)
@@ -624,6 +624,11 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref )
                          LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_%d", i ) );
   }
   pref->setItemProperty( defCols, "columns", 1 );
+
+  // adding preference to LightApp_Application handled preferences..  a bit of hacking with resources..
+  int genTab = pref->addPreference( LightApp_Application::tr( "PREF_TAB_GENERAL" ), salomeCat );
+  int studyGroup = pref->addPreference( LightApp_Application::tr( "PREF_GROUP_STUDY" ), genTab );
+  pref->addPreference( tr( "PREF_STORE_VISUAL_STATE" ), studyGroup, LightApp_Preferences::Bool, "Study", "store_visual_state" );
 }
 
 /*!Update desktop title.*/
index 937a3e98ef67227530704742113f65da8a5a5b08..cdb521e2dc6c512d2beb3a6ba555f92c46f6b4e6 100644 (file)
@@ -22,6 +22,7 @@
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
 
+#include <SUIT_ResourceMgr.h>
 #include <QtxWorkstack.h>
 
 #include <STD_TabDesktop.h>
@@ -95,6 +96,10 @@ void nameViewWindows( const ViewManagerList& lst )
 //================================================================
 int SalomeApp_VisualState::storeState()
 {
+  bool store = myApp->resourceMgr()->booleanValue( "Study", "store_visual_state", true );
+  if ( !store )
+    return -1;
+
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
   if ( !study )
     return -1;
@@ -172,6 +177,10 @@ int SalomeApp_VisualState::storeState()
 //================================================================
 void SalomeApp_VisualState::restoreState(int savePoint)
 {
+  bool store = myApp->resourceMgr()->booleanValue( "Study", "store_visual_state", true );
+  if ( !store )
+    return;
+
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
   if ( !study )
     return;
index 8644a5a140b4cb121a0efa21565d873c51ad20ad..0e0e304d67c16d165255bc1d62bd95ef00953b7b 100644 (file)
@@ -59,7 +59,8 @@
     <parameter name="font" value="Helvetic,12" />
   </section>
   <section name="Study">
-    <parameter name="store_positions" value="false" />
+    <parameter name="store_positions"          value="false" />
+    <parameter name="store_visual_state"       value="false" />
   </section>
   <section name="GEOM">
     <parameter name="name"       value="Geometry"/>
index 9be7820a0972f7945fdae3e323fff7afea0f4378..ae0693c42929610015ee5e02ea45848ad1656332 100644 (file)
@@ -102,6 +102,9 @@ msgstr "Activate Module"
 msgid "SalomeApp_Application::MEN_DELETE_INVALID_REFERENCE"
 msgstr "Delete Invalid Reference"
 
+msgid "SalomeApp_Application::PREF_STORE_VISUAL_STATE"
+msgstr "Store visual parameters"
+
 //=======================================================================================
 
 msgid "PUBLISH_IN_STUDY"