From: akl Date: Fri, 27 Feb 2009 13:32:30 +0000 (+0000) Subject: Fix issue 0020160:[CEA:321] (installation wizard should make the difference between... X-Git-Tag: V4_1_4sp2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b41c8dfd72164af30801beb3af0807ddb16a92f;p=tools%2Finstall.git Fix issue 0020160:[CEA:321] (installation wizard should make the difference between optional and mandatory "missing libraries"): a new attribute 'optionallibs' was added to 'config' section of XML configuration file. IW processes it and makes difference between 'not found' libraries. --- diff --git a/bin/SALOME_InstallWizard b/bin/SALOME_InstallWizard index e294c30..2ffb781 100755 Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ diff --git a/doc/readme.html b/doc/readme.html index 3f44daf..77a7f17 100755 --- a/doc/readme.html +++ b/doc/readme.html @@ -657,7 +657,11 @@ targetdir=<target_directory>       [ tempdir=<temp_directory>      -     ]
+     ]
+
      +        [ +optionallibs=<optional_libraries>  ] +
      />

    @@ -834,6 +838,12 @@ installed. The temporary directory is the path to the directory for the temporary files. +
    +
  • optionallibs
  • +
+A list of names of libraries. +An absence of these libraries in the user's system +doesn't affect on the correct work of SALOME platform.

<buttons> section

This is an optional section and may contains one or more <product> sections. @@ -1224,4 +1234,4 @@ configuration file is set to the "true" value.

- \ No newline at end of file + diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index 20da19d..d97d52f 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -1894,7 +1894,7 @@ void SALOME_InstallWizard::checkModifyLaResult() // ================================================================ /*! * SALOME_InstallWizard::runCheckFLib - * Run the Fortran libraries checking + * Run the Fortran and other required libraries checking */ // ================================================================ void SALOME_InstallWizard::runCheckFLib() @@ -1902,7 +1902,7 @@ void SALOME_InstallWizard::runCheckFLib() // Check Fortran libraries checkFLibProc->clearArguments(); // ... update status label - statusLab->setText( tr( "Check Fortran libraries..." ) ); + statusLab->setText( tr( "Check Fortran and other required libraries..." ) ); // ... search "not found" libraries checkFLibProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) ); checkFLibProc->addArgument( "checkFortran.sh" ); @@ -1915,26 +1915,58 @@ void SALOME_InstallWizard::runCheckFLib() // ================================================================ /*! * SALOME_InstallWizard::checkFLibResult - * Slot to take result of Fortran libraries checking + * Slot to take result of Fortran and other required libraries checking */ // ================================================================ void SALOME_InstallWizard::checkFLibResult() { if ( checkFLibProc->normalExit() && checkFLibProc->exitStatus() == 1 ) { - QStringList notFoundLibsList; + QStringList notFoundLibsList, notFoundOptLibsList; QString record = ""; + QStringList prefOptLibs = getOptionalLibs(); + // create list of strings with all 'not found' libraries while ( checkFLibProc->canReadLineStdout() ) { - record = checkFLibProc->readLineStdout(); - if ( !record.isEmpty() && !notFoundLibsList.contains( record ) ) - notFoundLibsList.append( record ); - } - QMessageBox::warning( this, - tr( "Warning" ), - tr( "The following libraries are absent on current system:\n" - "%1").arg( notFoundLibsList.join( "\n" ) ), - QMessageBox::Ok, - QMessageBox::NoButton, - QMessageBox::NoButton ); + record = checkFLibProc->readLineStdout().stripWhiteSpace(); + if ( !record.isEmpty() ) { + record = QStringList::split( " ", record )[0]; + if ( !notFoundLibsList.contains( record ) && + !notFoundOptLibsList.contains( record ) ) { + bool isOptional = false; + QStringList::Iterator it_opt; + for ( it_opt = prefOptLibs.begin(); it_opt != prefOptLibs.end(); ++it_opt ) + if ( record.startsWith( (*it_opt).stripWhiteSpace(), false ) ) { + isOptional = true; + break; + } + isOptional ? notFoundOptLibsList.append( record ) \ + : notFoundLibsList.append( record ); + } + } + } + QString msg = tr( "Some libraries are absent!

" ); + if ( !notFoundLibsList.isEmpty() ) { + msg += tr( "One or several mandatory libraries listed below are not found. SALOME may not work properly.
" ); + msg += notFoundLibsList.join( "
" ); + msg += "

"; + } + if ( !notFoundOptLibsList.isEmpty() ) { + msg += tr( "One or several optional libraries listed below are not found. This does not affect on the correct work of SALOME platform.
" ); + msg += notFoundOptLibsList.join( "
" ); + } + if ( !notFoundLibsList.isEmpty() ) + QMessageBox::warning( this, + tr( "Warning" ), + msg, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton ); + else if ( !notFoundOptLibsList.isEmpty() ) + QMessageBox::information( this, + tr( "Information" ), + msg, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton ); } // Update GUI and check installation errors completeInstallation(); diff --git a/src/SALOME_InstallWizard.hxx b/src/SALOME_InstallWizard.hxx index 4a42840..9ada2d7 100644 --- a/src/SALOME_InstallWizard.hxx +++ b/src/SALOME_InstallWizard.hxx @@ -207,6 +207,8 @@ class SALOME_InstallWizard: public InstallWizard void setCopyright( const QString& copyright ) { myCopyright = copyright; } // set license void setLicense( const QString& license ) { myLicense = license; } + // set list of optional libraries + void setOptionalLibs( const QString& optlibs ) { myOptLibs = QStringList::split( ",", optlibs ); } // get version QString getVersion() { return myVersion; } @@ -216,6 +218,8 @@ class SALOME_InstallWizard: public InstallWizard QString getCopyright() { return myCopyright; } // get license QString getLicense() { return myLicense; } + // get list of optional libraries + QStringList getOptionalLibs() { return myOptLibs; } // get platform QString getPlatform() { return !refPlatform.isEmpty() ? refPlatform : curPlatform; } // get corresponding XML file @@ -353,6 +357,7 @@ class SALOME_InstallWizard: public InstallWizard QString myLicense; // license info QString myTargetPath; // target directory path QString myTmpPath; // temporary directory path + QStringList myOptLibs; // list of optional libraries HelpWindow* helpWindow; // help window QProcess* shellProcess; // shell process (install script) diff --git a/src/SALOME_XmlHandler.cxx b/src/SALOME_XmlHandler.cxx index bd58546..86a6e1f 100644 --- a/src/SALOME_XmlHandler.cxx +++ b/src/SALOME_XmlHandler.cxx @@ -144,7 +144,7 @@ void StructureParser::setTempDir( QLineEdit* dir ) // ================================================================ void StructureParser::getConfigInfo(const QDomElement &theElem) { - QString myVersion, myCaption, myCopyright, myLicense, myPlatforms; + QString myVersion, myCaption, myCopyright, myLicense, myPlatforms, myOptLibs; if ( theElem.attribute( "version" ) ) { myVersion = theElem.attribute( "version" ).stripWhiteSpace(); if ( myWizard && !myVersion.isEmpty() ) @@ -178,6 +178,11 @@ void StructureParser::getConfigInfo(const QDomElement &theElem) if ( myTempDir ) myTempDir->setText( substituteVars( theElem.attribute( "tempdir" ) ) ); } + if ( theElem.attribute( "optionallibs" ) ) { + myOptLibs = theElem.attribute( "optionallibs" ).stripWhiteSpace(); + if ( myWizard && !myOptLibs.isEmpty() ) + myWizard->setOptionalLibs( myOptLibs ); + } } // ================================================================ /*!