Salome HOME
0022256: [CEA 866] Add item "Developers" in menu "Help"
authorvsr <vsr@opencascade.com>
Tue, 6 Aug 2013 10:04:55 +0000 (10:04 +0000)
committervsr <vsr@opencascade.com>
Tue, 6 Aug 2013 10:04:55 +0000 (10:04 +0000)
src/LightApp/LightApp_Application.cxx
src/LightApp/resources/LightApp.xml

index 889c6f2f3e3555f7fb159fde17407db0cae00609..5cb0200fcdc46aad9bcbeafae8953c4cbd45c298 100644 (file)
@@ -491,14 +491,17 @@ void LightApp_Application::createActions()
   SUIT_Desktop* desk = desktop();
   SUIT_ResourceMgr* resMgr = resourceMgr();
 
-  //! Preferences
+  // Preferences
   createAction( PreferencesId, tr( "TOT_DESK_PREFERENCES" ), QIcon(),
                 tr( "MEN_DESK_PREFERENCES" ), tr( "PRP_DESK_PREFERENCES" ),
                 Qt::CTRL+Qt::Key_R, desk, false, this, SLOT( onPreferences() ) );
 
-  //! Help for modules
+  // Help menu:
+
+  // - Help for modules
+
   int helpMenu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1, 1000 );
-  createMenu( separator(), helpMenu, -1, 1 );
+  createMenu( separator(), helpMenu, -1, 10 );
   QStringList aModuleList;
   modules( aModuleList, false );
   aModuleList.prepend( "GUI" );
@@ -506,8 +509,6 @@ void LightApp_Application::createActions()
 
   int id = LightApp_Application::UserID + FIRST_HELP_ID;
 
-  // help for other existing modules
-
   QString aModule;
   foreach( aModule, aModuleList ) {
     if ( aModule.isEmpty() )                                         // module title (user name)
@@ -573,6 +574,24 @@ void LightApp_Application::createActions()
     }
   }
 
+  // - Additional help items
+
+  QStringList addHelpItems = resMgr->parameters( "add_help" );
+  foreach ( QString addHelpItem, addHelpItems ) {
+    QString valueStr = resMgr->stringValue( "add_help", addHelpItem );
+    printf("-----%s\n", qPrintable(valueStr));
+    if ( !valueStr.isEmpty() && QFile::exists( valueStr ) ) {
+      QAction* a = createAction( id, addHelpItem,
+                                 resMgr->loadPixmap( "STD", tr( "ICON_HELP" ), false ),
+                                 addHelpItem, addHelpItem,
+                                 0, desk, false, this, SLOT( onHelpContentsModule() ) );
+      a->setData( valueStr );
+      createMenu( a, helpMenu, -1, 5 );
+      id++;
+    }
+  }
+  createMenu( separator(), helpMenu, -1, 5 );
+
   //! MRU
   static QtxMRUAction* mru = new QtxMRUAction( tr( "TOT_DESK_MRU" ), tr( "MEN_DESK_MRU" ), 0 );
   connect( mru, SIGNAL( activated( const QString& ) ), this, SLOT( onMRUActivated( const QString& ) ) );
index 5c85bbf9c6831c3e5e019629d97521973f437e7c..b9b52e6509081b3cbad5e370bda48a641df6e1a5 100644 (file)
     <parameter name="application"          value="/usr/bin/mozilla" />
     <parameter name="parameters"           value="" />
   </section>
+  <section name="add_help">
+    <!-- Additional help resources -->
+    <parameter name="Developer resources"  value="${DOCUMENTATION_ROOT_DIR}/index.html" />
+  </section>
 </document>