From: vsr Date: Tue, 13 Jan 2009 13:08:44 +0000 (+0000) Subject: Fix bug of the "Show Only/Hide All" operations : do not raise warning message for... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3aec65050ef6ad4a3c9fdd7f9da3d53064a491c4;p=modules%2Fgui.git Fix bug of the "Show Only/Hide All" operations : do not raise warning message for the modules which do not have GUI library. --- diff --git a/src/CAM/CAM_Application.cxx b/src/CAM/CAM_Application.cxx index 896a9a499..354394bfb 100755 --- a/src/CAM/CAM_Application.cxx +++ b/src/CAM/CAM_Application.cxx @@ -257,7 +257,7 @@ void CAM_Application::loadModules() \param modName module name \return module object pointer or 0 if module could not be loaded */ -CAM_Module* CAM_Application::loadModule( const QString& modName ) +CAM_Module* CAM_Application::loadModule( const QString& modName, const bool showMsg ) { if ( myInfoList.isEmpty() ) { @@ -316,7 +316,7 @@ CAM_Module* CAM_Application::loadModule( const QString& modName ) module->setName( moduleName( modName ) ); } - if ( !err.isEmpty() ) { + if ( !err.isEmpty() && showMsg ) { if ( desktop() && desktop()->isVisible() ) SUIT_MessageBox::warning( desktop(), tr( "Error" ), err ); else diff --git a/src/CAM/CAM_Application.h b/src/CAM/CAM_Application.h index f77808c1d..5ce540555 100755 --- a/src/CAM/CAM_Application.h +++ b/src/CAM/CAM_Application.h @@ -57,7 +57,7 @@ public: virtual void addModule( CAM_Module* ); virtual void loadModules(); - virtual CAM_Module* loadModule( const QString& ); + virtual CAM_Module* loadModule( const QString&, const bool = true ); virtual bool activateModule( const QString& ); diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 9f606e478..2b81c7a0b 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -372,9 +372,9 @@ QString LightApp_Application::applicationVersion() const } /*!Load module by \a name.*/ -CAM_Module* LightApp_Application::loadModule( const QString& name ) +CAM_Module* LightApp_Application::loadModule( const QString& name, const bool showMsg ) { - CAM_Module* mod = CAM_Application::loadModule( name ); + CAM_Module* mod = CAM_Application::loadModule( name, showMsg ); if ( mod ) { connect( this, SIGNAL( studyOpened() ), mod, SLOT( onModelOpened() ) ); diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index 0763e2a3f..7f1787909 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -93,7 +93,7 @@ public: virtual QString applicationName() const; virtual QString applicationVersion() const; - virtual CAM_Module* loadModule( const QString& ); + virtual CAM_Module* loadModule( const QString&, const bool = true ); virtual bool activateModule( const QString& ); LightApp_SelectionMgr* selectionMgr() const; diff --git a/src/LightApp/LightApp_Displayer.cxx b/src/LightApp/LightApp_Displayer.cxx index 7f0efa250..c050811d1 100644 --- a/src/LightApp/LightApp_Displayer.cxx +++ b/src/LightApp/LightApp_Displayer.cxx @@ -257,7 +257,7 @@ LightApp_Displayer* LightApp_Displayer::FindDisplayer( const QString& mod_name, LightApp_Module* m = dynamic_cast( app ? app->module( mod_name ) : 0 ); if( !m && load ) { - m = dynamic_cast( app->loadModule( mod_name ) ); + m = dynamic_cast( app->loadModule( mod_name, false ) ); if( m ) app->addModule( m ); }