LightApp_ModuleAction* moduleAction = qobject_cast<LightApp_ModuleAction*>( action( ModulesListId ) );
// a. regular modules were added in createActions() method
// b. here we add custom modules (manually added by the user)
- if ( HAS_SALOME_ON_DEMAND )
+ if ( HAS_SALOME_ON_DEMAND && QString::compare(getenv("SALOME_ON_DEMAND"),"HIDE", Qt::CaseInsensitive) != 0)
{
// Update rc file
updateSalomeApprc();
QStringList modList = resourceMgr()->stringValue( "launch", "user_modules" ).split( ";", QString::SkipEmptyParts );
foreach ( QString aModule, modList )
- addUserModule( aModule, resourceMgr()->stringValue( "user_modules", aModule ) );
+ addUserModule( aModule, resourceMgr()->stringValue( "user_modules", aModule ), true );
}
else
{
QString salomemodules(getenv("SALOME_MODULES"));
if(salomemodules.isEmpty())
- AddComponents_from_salomeappdir( QDir(extRootDir), resMgr );
+ UpdateCompInfo_with_salomeappdir( QDir(extRootDir), resMgr );
else
- AddComponents_from_salomemodules(salomemodules, QDir(extRootDir), resMgr);
+ UpdateCompInfo_with_salomemodules(salomemodules, QDir(extRootDir), resMgr);
}
/*!On module activation action.*/
/*Add user module.*/
bool LightApp_Application::addUserModule( const QString& name, const QString& root, bool interactive )
{
+ if ( name == "KERNEL" || name == "GUI" )
+ return false; // skip KERNEL and GUI modules
+
if ( name.isEmpty() || root.isEmpty() )
return false;
#include "SalomeApprc_utils.h"
-void AddComponents_from_salomeappdir(const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr)
+void UpdateCompInfo_with_salomeappdir(const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr)
{
+ // Remove module list and module_root_dirs list
+ ResMgr->remove("launch", "user_modules");
+ ResMgr->remove("user_modules");
+
QFileInfoList salomexd_list = salomeappdir.entryInfoList(QStringList() << "*.salomexd",QDir::Files);
foreach(QFileInfo filename, salomexd_list)
{
}
}
-void AddComponents_from_salomemodules(const QString& salomemodules, const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr)
+void UpdateCompInfo_with_salomemodules(const QString& salomemodules, const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr)
{
+ // Remove module list and module_root_dirs list
+ ResMgr->remove("launch", "user_modules");
+ ResMgr->remove("user_modules");
+
QRegularExpression sep(":|,");
QStringList components_list = salomemodules.split(sep,QString::SkipEmptyParts);
foreach (QString comp, components_list)
AddGuiComponent(comp, comp_root_dir, ResMgr);
}
-
}
void AddGuiComponent(const QString& comp, const QString& CompRoot, SUIT_ResourceMgr* ResMgr)
{
- QStringList CompsResMgr;
+ QStringList CompsResMgr = ResMgr->stringValue("launch", "user_modules").split(";", QString::SkipEmptyParts);
ResMgr->setValue( "user_modules", comp, CompRoot );
CompsResMgr << comp;
const QString ITERACTIVE_EXTCOMPONENT_KEY("salome_interactive");
-void AddComponents_from_salomeappdir(const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr);
-void AddComponents_from_salomemodules(const QString& salomemodules, const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr);
+void UpdateCompInfo_with_salomeappdir(const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr);
+void UpdateCompInfo_with_salomemodules(const QString& salomemodules, const QDir& salomeappdir, SUIT_ResourceMgr* ResMgr);
void AddGuiComponent(const QString& comp, const QString& CompRoot, SUIT_ResourceMgr* ResMgr );
#endif
\ No newline at end of file