From: nri Date: Thu, 22 May 2003 09:25:31 +0000 (+0000) Subject: NRI : Update in order to search MODULES documentation and open active MODULE document... X-Git-Tag: V1_4_0~102 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ccf35be9f1acf3353a34918da83abb2d01fb22d6;p=modules%2Fkernel.git NRI : Update in order to search MODULES documentation and open active MODULE documentation. --- diff --git a/src/SALOMEGUI/QAD_Desktop.cxx b/src/SALOMEGUI/QAD_Desktop.cxx index b4a6ea7d0..3d0ea1507 100644 --- a/src/SALOMEGUI/QAD_Desktop.cxx +++ b/src/SALOMEGUI/QAD_Desktop.cxx @@ -1152,6 +1152,37 @@ QAD_HelpWindow* QAD_Desktop::getHelpWindow() { if (!myHelpWindow) { myHelpWindow = new QAD_HelpWindow(); + + QMap::Iterator it; + for( it = mapComponentName.begin(); it != mapComponentName.end(); ++it ) { + QCString dir; + QString root; + + // look for index.html and set homeDir + // 1. $(MODULE_ROOT_DIR)/doc/index.html + // 2. $(MODULE_ROOT_DIR)/doc/html/index.html + // 3. $(MODULE_ROOT_DIR)/doc/html/html/index.html + + if (dir = getenv( QString( it.data() + "_ROOT_DIR")) ) { + root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + } + } + } + } + connect(myHelpWindow, SIGNAL(helpWindowClosed()), this, SLOT(onHelpWindowClosed())); } return myHelpWindow; @@ -3217,7 +3248,31 @@ void QAD_Desktop::helpSearch() /* Help Contents */ void QAD_Desktop::helpContents() { - getHelpWindow()->contents(); + if (myActiveComp == "") + myActiveComp = "Salome"; + + QCString dir; + QString root; + if (dir = getenv( getComponentName( myActiveComp ) + "_ROOT_DIR")) { + root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + helpContext( root + "index.html", "" ); + } + } + } + } + + //NRI getHelpWindow()->contents(); getHelpWindow()->show(); getHelpWindow()->raise(); getHelpWindow()->setActiveWindow(); diff --git a/src/SALOMEGUI/QAD_HelpWindow.cxx b/src/SALOMEGUI/QAD_HelpWindow.cxx index c1302c27f..3f86cf15c 100644 --- a/src/SALOMEGUI/QAD_HelpWindow.cxx +++ b/src/SALOMEGUI/QAD_HelpWindow.cxx @@ -89,6 +89,7 @@ QAD_HelpWindow::QAD_HelpWindow() setDockEnabled( TornOff, FALSE ); setDockMenuEnabled( false ); + /* // look for index.html and set homeDir // 1. $(SALOME_ROOT_DIR)/doc/index.html // 2. $(SALOME_ROOT_DIR)/doc/html/index.html @@ -97,33 +98,34 @@ QAD_HelpWindow::QAD_HelpWindow() QCString dir; QString root; - if ( (dir = getenv("SALOME_ROOT_DIR")) ) { - root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + "doc" ); - if ( QFileInfo( root + "index.html" ).exists() ) { - homeDir = root; - } - else { - root = QAD_Tools::addSlash( root + "html" ); - if ( QFileInfo( root + "index.html" ).exists() ) { - homeDir = root; - } - else { - root = QAD_Tools::addSlash( root + "html" ); - if ( QFileInfo( root + "index.html" ).exists() ) { - homeDir = root; - } - } - } + if ( (dir = getenv("KERNEL_ROOT_DIR")) ) { + root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + homeDir = root; + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + homeDir = root; + } + else { + root = QAD_Tools::addSlash( root + "html" ); + if ( QFileInfo( root + "index.html" ).exists() ) { + homeDir = root; + } + } + } } if ( root.isEmpty() ) { - if ( QFileInfo( "/usr/local/doc/html/index.html" ).exists() ) { - homeDir = "/usr/local/doc/html/"; - } + if ( QFileInfo( "/usr/local/doc/html/index.html" ).exists() ) { + homeDir = "/usr/local/doc/html/"; + } } if ( root.isEmpty() ) - root = "./doc/"; - + root = "./doc/"; + browser->setSource( QFileInfo( homeDir + "index.html" ).absFilePath() ); + */ browser->setFocus(); QSize dSize = QApplication::desktop()->size();