From: vsr Date: Mon, 26 Mar 2012 09:10:47 +0000 (+0000) Subject: 0021308: EDF 1923 SMESH: Remove hard-coded dependency of the external mesh plugins... X-Git-Tag: V6_5_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=11dce8a75aa5b66530bfc525d6d187fbcf4e034c;p=modules%2Fgui.git 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 --- 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++; } }