]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Improve SALOME style handling
authorvsr <vsr@opencascade.com>
Fri, 31 Oct 2008 15:31:08 +0000 (15:31 +0000)
committervsr <vsr@opencascade.com>
Fri, 31 Oct 2008 15:31:08 +0000 (15:31 +0000)
src/LightApp/resources/LightApp_msg_en.ts
src/Session/SALOME_Session_Server.cxx
src/Style/resources/SalomeStyle.xml

index 4ec13897c82259feb3aa9bab1fdd5252834ac43b..d5e7a2c1850de9a93cbc3b43d717d8b23a2b9bfc 100644 (file)
@@ -33,6 +33,18 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
 </context>
 <context>
     <name>LightApp_Application</name>
+    <message>
+        <source>MEN_DESK_THEME</source>
+        <translation>Theme</translation>
+    </message>
+    <message>
+        <source>TOT_THEME</source>
+        <translation>Theme</translation>
+    </message>
+    <message>
+        <source>PRP_THEME</source>
+        <translation>Change style properties</translation>
+    </message>
     <message>
         <source>INF_TOOLBAR_MODULES</source>
         <translation>Modules</translation>
index 26a87385722036037ae75c6a94722541ef99aee0..de4c0822d0a70994b13aaa03b9d40c365a330b6d 100755 (executable)
@@ -61,7 +61,6 @@
 
 #include <QtxSplash.h>
 #include <Style_Salome.h>
-#include <Style_Model.h>
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
 #include <SUIT_Application.h>
@@ -359,7 +358,8 @@ int main( int argc, char **argv )
     // ...create resource manager
     SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
     resMgr.setCurrentFormat( "xml" );
-    resMgr.loadLanguage( false, "LightApp", "en" );
+    resMgr.setWorkingMode( QtxResourceMgr::IgnoreUserValues );
+    resMgr.loadLanguage( "LightApp", "en" );
     //
     splash = QtxSplash::splash( QPixmap() );
     splash->readSettings( &resMgr );
@@ -534,16 +534,9 @@ int main( int argc, char **argv )
       SUIT_Application* aGUIApp = aGUISession->startApplication( "SalomeApp", 0, 0 );
       if ( aGUIApp )
       {
-        // Set SALOME style to the application
-       SUIT_ResourceMgr resMgr( "SalomeApp", QString( "%1Config" ) );
-       resMgr.setCurrentFormat( "xml" );
-       resMgr.loadLanguage( false, "LightApp", "en" );
-       if ( bool isSSUse = resMgr.booleanValue( "Style", "use_salome_style", true ) )
-       {
-         Style_Salome* aStyle = new Style_Salome();
-         aStyle->getModel()->initFromResource( aGUIApp->resourceMgr() );
-         _qappl.setStyle( aStyle );
-       }
+       Style_Salome::initialize( aGUIApp->resourceMgr() );
+       if ( aGUIApp->resourceMgr()->booleanValue( "Style", "use_salome_style", true ) )
+         Style_Salome::apply();
 
        if ( !isFound( "noexcepthandler", argc, argv ) )
          _qappl.setHandler( aGUISession->handler() ); // after loading SalomeApp application
index d09cd5fd0ffd3f02cedb226e3be48c3767b543ee..858bf73104a1704a3cd5f7e0126c7c57d0e88647 100644 (file)
@@ -1,5 +1,5 @@
 <document>
-  <section name="Steel-blue">
+  <section name="Steel-Blue">
     <parameter name="button-color"            value="silver" />
     <parameter name="base-color"              value="white" />
     <parameter name="window-color"            value="lightsteelblue" />
@@ -22,7 +22,7 @@
     <parameter name="widget-effect"           value="1" />
     <parameter name="slider-size"             value="5" />
   </section>
-  <section name="Dark-green">
+  <section name="Dark-Green">
     <parameter name="button-color"            value="#003300" />
     <parameter name="window-color"            value="black" />
     <parameter name="text-color"              value="white" />