From 11dce8a75aa5b66530bfc525d6d187fbcf4e034c Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 26 Mar 2012 09:10:47 +0000 Subject: [PATCH] 0021308: EDF 1923 SMESH: Remove hard-coded dependency of the external mesh plugins from the SMESH module - Allow plug-ins putting their help files to the SMESH help sub-menu --- src/LightApp/LightApp_Application.cxx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 79ed95e1f..b4afefbed 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -553,17 +553,27 @@ void LightApp_Application::createActions() IMapConstIterator fileIt; for ( fileIt = helpData.begin(); fileIt != helpData.end(); fileIt++ ) { QString helpFileName = fileIt.key(); + // remove all '//' occurances + while ( helpFileName.contains( "//" ) ) + helpFileName.replace( "//", "" ); + // obtain submenus hierarchy if given + QStringList smenus = helpFileName.split( "/" ); + helpFileName = smenus.last(); + smenus.removeLast(); QAction* a = createAction( id, helpFileName, resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ), helpFileName, helpFileName, 0, desk, false, this, SLOT( onHelpContentsModule() ) ); a->setData( fileIt.value() ); - if ( !helpSubMenu.isEmpty() ){ - int helpSubMenuId = createMenu( helpSubMenu, helpMenu, -1, 0 ); - createMenu( a, helpSubMenuId, -1 ); + if ( !helpSubMenu.isEmpty() ) { + smenus.prepend( helpSubMenu ); } - else - createMenu( a, helpMenu, -1, 0 ); + // create sub-menus hierarchy + int menuId = helpMenu; + foreach ( QString subMenu, smenus ) { + menuId = createMenu( subMenu, menuId, -1, 0 ); + } + createMenu( a, menuId, -1, 0 ); id++; } } -- 2.39.2