{
if (!myHelpWindow) {
myHelpWindow = new QAD_HelpWindow();
+
+ QMap<QString,QString>::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;
/* 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();
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
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();