]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
icon, logo, splash of src/ShaperApp/resources/LightShaperApp are OK. Scene display... csgroup_IS2_lot7b
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 16 Feb 2021 13:32:49 +0000 (14:32 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 16 Feb 2021 13:32:49 +0000 (14:32 +0100)
src/LightApp/LightApp_Application.cxx
src/SUIT/SUIT_Session.cxx
src/SUIT/SUIT_Session.h
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/Shaper/Shaper.cxx
src/ShaperApp/CMakeLists.txt
src/ShaperApp/resources/LightShaperApp.xml
src/ShaperApp/resources/LightShaperApp_images.ts
src/ShaperApp/resources/ShaperApp.xml

index 49152a173776592d5c4ed64146a3683a5c2fb58b..e26fe84b9f1a43e558e64b81c6d5d2adf4b2e969 100644 (file)
@@ -326,6 +326,8 @@ LightApp_Application::LightApp_Application()
 {
   Q_INIT_RESOURCE( LightApp );
 
+  QString myResourcesPrefix = SUIT_Session::session()->resourcesConfigPrefix();
+
   STD_TabDesktop* desk = new STD_TabDesktop();
   desk->setFullScreenAllowed(false);
   desk->setMinimizeAllowed(false);
@@ -340,16 +342,16 @@ LightApp_Application::LightApp_Application()
   //connect( this, SIGNAL( moving() ), this, SLOT( onMoved() ) );
 
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
+  QPixmap aLogo = aResMgr->loadPixmap(myResourcesPrefix, tr( "APP_DEFAULT_ICO" ), false );
 
   desktop()->setWindowIcon( aLogo );
   desktop()->setDockableMenuBar( false );
   desktop()->setDockableStatusBar( false );
 
   // base logo (salome itself)
-  desktop()->logoInsert( "_app_base",  aResMgr->loadPixmap( "LightApp", tr( "APP_BASE_LOGO" ), false ) );
+  desktop()->logoInsert( "_app_base",  aResMgr->loadPixmap( myResourcesPrefix, tr( "APP_BASE_LOGO" ), false ) );
   // extra logo (salome-based application)
-  desktop()->logoInsert( "_app_extra", aResMgr->loadPixmap( "LightApp", tr( "APP_EXTRA_LOGO" ), false ) );
+  desktop()->logoInsert( "_app_extra", aResMgr->loadPixmap( myResourcesPrefix, tr( "APP_EXTRA_LOGO" ), false ) );
 
   clearViewManagers();
 
@@ -589,6 +591,7 @@ void LightApp_Application::createActions()
 
   SUIT_Desktop* desk = desktop();
   SUIT_ResourceMgr* resMgr = resourceMgr();
+  QString myResourcesPrefix = SUIT_Session::session()->resourcesConfigPrefix();
 
   // Preferences
   createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
@@ -606,7 +609,7 @@ void LightApp_Application::createActions()
   if ( !url.isEmpty() ) {
     QString title = tr ( "SALOME_SITE" );
     QAction* as = createAction( WebSiteId, title,
-                               resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
+        resMgr->loadPixmap( myResourcesPrefix, tr( "ICON_WWW" ), false ),
                                title, title,
                                0, desk, false, this, SLOT( onHelpContentsModule() ) );
     as->setData( url );
@@ -618,7 +621,7 @@ void LightApp_Application::createActions()
   if ( !url.isEmpty() ) {
     QString title = tr ( "SALOME_FORUM" );
     QAction* af = createAction( ForumId, title,
-                               resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
+        resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
                                title, title,
                                0, desk, false, this, SLOT( onHelpContentsModule() ) );
     af->setData( url );
@@ -631,7 +634,7 @@ void LightApp_Application::createActions()
     createMenu( separator(), helpMenu, -1, 0 );
     QString title = tr ( "SALOME_VIDEO_TUTORIALS" );
     QAction* av = createAction( VideosId, title,
-                               resMgr->loadPixmap( "LightApp", tr( "ICON_LIFE_RIGN" ), false ),
+        resMgr->loadPixmap( myResourcesPrefix, tr( "ICON_LIFE_RIGN" ), false ),
                                title, tr( "PRP_SALOME_VIDEO_TUTORIALS" ),
                                0, desk, false, this, SLOT( onHelpContentsModule() ) );
     av->setData( url );
@@ -644,7 +647,7 @@ void LightApp_Application::createActions()
   if ( !url.isEmpty() ) {
     QString title = tr ( "SALOME_TUTORIALS" );
     QAction* as = createAction( TutorialsId, title,
-                               resMgr->loadPixmap( "LightApp", tr( "ICON_WWW" ), false ),
+        resMgr->loadPixmap( myResourcesPrefix, tr( "ICON_WWW" ), false ),
                                title, tr( "PRP_SALOME_TUTORIALS" ),
                                0, desk, false, this, SLOT( onHelpContentsModule() ) );
     as->setData( url );
@@ -779,12 +782,12 @@ void LightApp_Application::createActions()
   registerAction( MRUId, mru );
 
   // default icon for neutral point ('SALOME' module)
-  QPixmap defIcon = resMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
+  QPixmap defIcon = resMgr->loadPixmap( myResourcesPrefix, tr( "APP_DEFAULT_ICO" ), false );
   if ( defIcon.isNull() )
     defIcon = QPixmap( imageEmptyIcon );
 
   //! default icon for any module
-  QPixmap modIcon = resMgr->loadPixmap( "LightApp", tr( "APP_MODULE_ICO" ), false );
+  QPixmap modIcon = resMgr->loadPixmap( myResourcesPrefix, tr( "APP_MODULE_ICO" ), false );
   if ( modIcon.isNull() )
     modIcon = QPixmap( imageEmptyIcon );
 
@@ -2349,10 +2352,11 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   QList<QVariant> anIndicesList;
   QIntList        idList;
   QIntList        txtList;
+  QString myResourcesPrefix = SUIT_Session::session()->resourcesConfigPrefix();
 
   // . Top-level "SALOME" preferences group <<start>>
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
-  pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
+  pref->setItemIcon( salomeCat, Qtx::scaleIcon( resourceMgr()->loadPixmap( myResourcesPrefix, tr( "APP_DEFAULT_ICO" ), false ), 20 ) );
 
   // .. "General" preferences tab <<start>>
   int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat );
index 19a5baa635d31c1b868a5cad7d79132d8d9a1c6d..8da13d50300173a377375a3ed361414f2c9bc29d 100644 (file)
@@ -46,7 +46,8 @@ SUIT_Session::SUIT_Session()
   myActiveApp( 0 ),
   myHandler( 0 ),
   myExitStatus( NORMAL ),
-  myExitFlags ( 0 )
+  myExitFlags ( 0 ),
+  myResourcesConfigPrefix("LightApp")
 {
   SUIT_ASSERT( !mySession )
 
@@ -398,7 +399,25 @@ std::string SUIT_Session::salomeAppName() const
  * \brief sets thename of the main Application launched by the executable
  * -> SalomeApp, ShaperApp
  */
-void  SUIT_Session::setExecutableAppName(const std::string & appName)
+void SUIT_Session::setExecutableAppName(const std::string & appName)
 {
   myExecutableAppName = appName;
 }
+
+/*!
+ * \brief setResourcesConfigName
+ * \param xmlFilePrefix: the name of the xml file for resources: logo, splash
+ */
+void SUIT_Session::setResourcesConfigPrefix(const QString & xmlFilePrefix)
+{
+  myResourcesConfigPrefix = xmlFilePrefix;
+}
+
+/*!
+ * \brief SUIT_Session::resourcesConfigPrefix
+ * \return name of the xml resource file
+ */
+QString SUIT_Session::resourcesConfigPrefix()
+{
+  return myResourcesConfigPrefix;
+}
index 721b1ea1c6b2258bd6dc92f31479c4e079095594..97c2b592563eb95a9d98bf9a86047ca4903c327c 100644 (file)
@@ -87,6 +87,8 @@ public:
   std::string                  shaperAppName() const;
   std::string                  salomeAppName() const;
   void                         setExecutableAppName(const std::string & appName);
+  void                         setResourcesConfigPrefix(const QString & xmlFilePrefix);
+  QString                      resourcesConfigPrefix();
 
 signals:
   void                         applicationClosed( SUIT_Application* );
@@ -119,6 +121,7 @@ private:
   int                          myExitStatus;
   int                          myExitFlags;
   std::string                  myExecutableAppName;
+  QString                      myResourcesConfigPrefix;
 };
 
 #endif
index 3f0e8f30c2797aea37542513f2c41c37762162fe..c2f3a2453e67ae79bcd37e983ea33b8153c6c58f 100644 (file)
@@ -435,6 +435,8 @@ void SalomeApp_Application::onNewDoc()
   MessageLocker ml( myToIgnoreMessages );
 
   LightApp_Application::onNewDoc();
+
+  reactivateDefaultModule();
 }
 
 /*!SLOT. Load document.*/
@@ -750,6 +752,8 @@ void SalomeApp_Application::onOpenDoc()
   MessageLocker ml( myToIgnoreMessages );
 
   LightApp_Application::onOpenDoc();
+
+  reactivateDefaultModule();
 }
 
 /*!SLOT. Load document.*/
@@ -2188,3 +2192,17 @@ void SalomeApp_Application::ensureShaperIsActivated()
   }
 }
 #endif
+
+/*!
+ * \brief reactivateDefaultModule
+ */
+void SalomeApp_Application::reactivateDefaultModule()
+{
+  QString theDefaultModule(defaultModule());
+  if(!theDefaultModule.isEmpty())
+  {
+    /// activates the default module when there exists one, after flushing all events
+    QApplication::instance()->processEvents(QEventLoop::ExcludeUserInputEvents);
+    onModuleActivation(theDefaultModule);
+  }
+}
index 80d0b0ed90bce09bb37f4ae70b868cbc4d4ffece..4ce3748abca67d5aaaacb703899010431aba3b2a 100644 (file)
@@ -209,6 +209,12 @@ private:
   void                                ensureShaperIsActivated();
 #endif
 
+  /*!
+   * \brief reactivateDefaultModule: when there is a default module,
+   * some delayed events makes the view inactive
+   */
+  void                                reactivateDefaultModule();
+
 private:
 #ifndef DISABLE_PYCONSOLE
   QPointer<SalomeApp_NoteBook>        myNoteBook;        // Notebook instance
index e8f1b6073629ef21dbc927ac130790c28d8bc9f6..ce16b4bb952bc214d7b72c2327f266e13f45635b 100644 (file)
@@ -56,7 +56,6 @@
 #include <QRegExp>
 #include <QTextStream>
 #include <QWaitCondition>
-#include <QThread>
 
 //! CORBA server for SALOME GUI session
 /*!
@@ -379,7 +378,7 @@ int main( int argc, char **argv )
 
   bool isGUI    = boolCmdOption( "--show-desktop", "--hide-desktop", true ); // true by default
   bool isSplash = boolCmdOption( "--show-splash", "--hide-splash", true ); // true by default
-  isSplash = false;
+
   // Show splash screen (only if both the "GUI" and "SPLASH" options are true)
   QtxSplash* splash = 0;
   if ( isGUI && isSplash ) {
@@ -420,6 +419,9 @@ int main( int argc, char **argv )
 
     MESSAGE( "creation SUIT_Application" );
 
+    // Fill resources configuration file in session
+    aGUISession->setResourcesConfigPrefix(myAppNameSpace::myLightAppName);
+
     aGUISession->resourceMgr() = new ResourceMgr( myAppNameSpace::myAppName );
     aGUISession->resourceMgr()->loadLanguage();
 
index 9da46446595ecf8e50b83f5407faca502382b37e..91ed03a6fede3bfc37cbb399fe8887e2fd46da66 100644 (file)
@@ -190,9 +190,7 @@ SET(_other_RESOURCES
   resources/LightShaperApp.xml
   resources/shaper.png
 )
-SET(SALOME_RESOURCES_FILES
-  shaper.png 
-)
+
 # --- sources ---
 
 # sources / moc wrappings
index 478997e7ac7f00c791bf999160b06317861daef0..e9d7903a5ffec0e1dcf435edd0c723c8c99f9aa1 100644 (file)
@@ -2,7 +2,7 @@
   <section name="launch">
     <!-- SALOME launching parameters -->
     <parameter name="gui"        value="yes"/>
-    <parameter name="splash"     value="no"/>
+    <parameter name="splash"     value="yes"/>
     <parameter name="file"       value="no"/>
     <parameter name="key"        value="no"/>
     <parameter name="interp"     value="no"/>
@@ -17,7 +17,7 @@
   </section>
   <section name="splash" >
     <!-- Splash screen settings -->
-    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/shaper_splash.png" />
+    <parameter name="image"             value="${GUI_ROOT_DIR}/share/salome/resources/gui/icon_about.png" />
     <parameter name="constant_info"     value="%A [ %V ]" />
     <parameter name="text_colors"       value="#ffffff" />
     <parameter name="hide_on_click"     value="yes" />
index f251578fe16ab8019dacf06952cc361c36c94590..b3021d99ae62f3fd7ec72a8b0ccf83319721aefa 100644 (file)
@@ -8,16 +8,36 @@
         <translation>shaper.png</translation>
     </message>
     <message>
-        <source>ICO_ABOUT</source>
+        <source>ABOUT</source>
         <translation>icon_about.png</translation>
     </message>
     <message>
-        <source>ABOUT</source>
-        <translation>about.png</translation>
+        <source>ABOUT_SPLASH</source>
+        <translation>icon_about.png</translation>
+    </message>
+    <message>
+        <source>APP_MODULE_BIG_ICO</source>
+        <translation>icon_module_big.png</translation>
     </message>
     <message>
         <source>APP_BASE_LOGO</source>
-        <translation>app_logo.png</translation>
+        <translation>icon_applogo.png</translation>
+    </message>
+    <message>
+        <source>ICON_SELECT</source>
+        <translation>icon_select.png</translation>
+    </message>
+    <message>
+        <source>APP_MODULE_ICO</source>
+        <translation>icon_module.png</translation>
+    </message>
+        <message>
+        <source>ICON_WWW</source>
+        <translation>icon_earth.png</translation>
+    </message>
+    <message>
+        <source>ICON_LIFE_RIGN</source>
+        <translation>icon_life_ring.png</translation>
     </message>
 </context>
 </TS>
index aab5264ca921ca14f3480b5f343b01d1adb2fa7f..75342ad957d6a9f7de3ffa443b1c2cd09dbe6076 100644 (file)
@@ -11,7 +11,7 @@
     <parameter name="noexcepthandler"  value="no"/>
     <parameter name="modules"    value="SHAPER"/>
     <parameter name="pyModules"  value=""/>
-    <parameter name="embedded"   value="ShaperAppEngine,study,cppContainer,registry,moduleCatalog"/>
+    <parameter name="embedded"   value="study,cppContainer,registry,moduleCatalog"/>
     <parameter name="standalone" value=""/>
   </section>
   <section name="language">
     <parameter name="multi_file_dump"     value="false" />
     <parameter name="pydump_save_gui"     value="false" />
   </section>
-  <section name="splash">
-    <parameter name="image" value="%GUI_ROOT_DIR/share/salome/resources/gui/shaper_splash.png"/>
-    <parameter name="text_colors" value="#ffffff|#000000"/>
-    <parameter name="show_percents" value="yes"/>
-    <parameter name="show_progress" value="yes"/>
-    <parameter name="show_message" value="yes"/>
-    <parameter name="font" value="Xirod,12,normal"/>
-  </section>
-  <!--section name="resources">
-    <parameter name="LightShaperApp" value="%GUI_ROOT_DIR/share/salome/resources/gui"/>
-  </section-->
 </document>