]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0021308: EDF 1923 SMESH: Remove hard-coded dependency of the external mesh plugins...
authorvsr <vsr@opencascade.com>
Mon, 26 Mar 2012 09:10:47 +0000 (09:10 +0000)
committervsr <vsr@opencascade.com>
Mon, 26 Mar 2012 09:10:47 +0000 (09:10 +0000)
- Allow plug-ins putting their help files to the SMESH help sub-menu

src/LightApp/LightApp_Application.cxx

index 79ed95e1fde7f06c3646b497b622d0dc3a833c28..b4afefbedf7c3864cb3b2f77d698f7a51e3c6677 100644 (file)
@@ -553,17 +553,27 @@ void LightApp_Application::createActions()
     IMapConstIterator<QString, QString > 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++;
     }
   }