From: Anthony Geay Date: Tue, 16 Feb 2021 13:32:49 +0000 (+0100) Subject: icon, logo, splash of src/ShaperApp/resources/LightShaperApp are OK. Scene display... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fcsgroup_IS2_lot7b;p=modules%2Fgui.git icon, logo, splash of src/ShaperApp/resources/LightShaperApp are OK. Scene display on HDF5 load time is OK --- diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 49152a173..e26fe84b9 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -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 anIndicesList; QIntList idList; QIntList txtList; + QString myResourcesPrefix = SUIT_Session::session()->resourcesConfigPrefix(); // . Top-level "SALOME" preferences group <> 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 <> int genTab = pref->addPreference( tr( "PREF_TAB_GENERAL" ), salomeCat ); diff --git a/src/SUIT/SUIT_Session.cxx b/src/SUIT/SUIT_Session.cxx index 19a5baa63..8da13d503 100644 --- a/src/SUIT/SUIT_Session.cxx +++ b/src/SUIT/SUIT_Session.cxx @@ -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; +} diff --git a/src/SUIT/SUIT_Session.h b/src/SUIT/SUIT_Session.h index 721b1ea1c..97c2b5925 100644 --- a/src/SUIT/SUIT_Session.h +++ b/src/SUIT/SUIT_Session.h @@ -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 diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 3f0e8f30c..c2f3a2453 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -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); + } +} diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 80d0b0ed9..4ce3748ab 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -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 myNoteBook; // Notebook instance diff --git a/src/Shaper/Shaper.cxx b/src/Shaper/Shaper.cxx index e8f1b6073..ce16b4bb9 100644 --- a/src/Shaper/Shaper.cxx +++ b/src/Shaper/Shaper.cxx @@ -56,7 +56,6 @@ #include #include #include -#include //! 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(); diff --git a/src/ShaperApp/CMakeLists.txt b/src/ShaperApp/CMakeLists.txt index 9da464465..91ed03a6f 100644 --- a/src/ShaperApp/CMakeLists.txt +++ b/src/ShaperApp/CMakeLists.txt @@ -190,9 +190,7 @@ SET(_other_RESOURCES resources/LightShaperApp.xml resources/shaper.png ) -SET(SALOME_RESOURCES_FILES - shaper.png -) + # --- sources --- # sources / moc wrappings diff --git a/src/ShaperApp/resources/LightShaperApp.xml b/src/ShaperApp/resources/LightShaperApp.xml index 478997e7a..e9d7903a5 100644 --- a/src/ShaperApp/resources/LightShaperApp.xml +++ b/src/ShaperApp/resources/LightShaperApp.xml @@ -2,7 +2,7 @@
- + @@ -17,7 +17,7 @@
- + diff --git a/src/ShaperApp/resources/LightShaperApp_images.ts b/src/ShaperApp/resources/LightShaperApp_images.ts index f251578fe..b3021d99a 100644 --- a/src/ShaperApp/resources/LightShaperApp_images.ts +++ b/src/ShaperApp/resources/LightShaperApp_images.ts @@ -8,16 +8,36 @@ shaper.png - ICO_ABOUT + ABOUT icon_about.png - ABOUT - about.png + ABOUT_SPLASH + icon_about.png + + + APP_MODULE_BIG_ICO + icon_module_big.png APP_BASE_LOGO - app_logo.png + icon_applogo.png + + + ICON_SELECT + icon_select.png + + + APP_MODULE_ICO + icon_module.png + + + ICON_WWW + icon_earth.png + + + ICON_LIFE_RIGN + icon_life_ring.png diff --git a/src/ShaperApp/resources/ShaperApp.xml b/src/ShaperApp/resources/ShaperApp.xml index aab5264ca..75342ad95 100644 --- a/src/ShaperApp/resources/ShaperApp.xml +++ b/src/ShaperApp/resources/ShaperApp.xml @@ -11,7 +11,7 @@ - +
@@ -35,15 +35,4 @@
-
- - - - - - -
-