// ================================================================
SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
const QString& aTargetDir,
- const QString& aTmpDir)
+ const QString& aTmpDir,
+ const bool aForceSrc)
: InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
helpWindow( NULL ),
moreMode( false ),
xmlFileName = aXmlFileName;
myTargetPath = aTargetDir;
myTmpPath = aTmpDir;
+ forceSrc = aForceSrc;
stateChanged = true;
binPath = QDir::currentDirPath() + "/Products/BINARIES";
srcPath = QDir::currentDirPath() + "/Products/SOURCES";
// create instance of class for starting shell script to get available disk space
diskSpaceProc = new QProcess( this, "procDiskSpace" );
- connect( diskSpaceProc, SIGNAL( processExited() ), this, SLOT( updateAvailableSpace() ) );
-
// create instance of class for starting shell install script
shellProcess = new QProcess( this, "shellProcess" );
-
// create instance of class for starting shell script to modify SALOME *.la files
modifyLaProc = new QProcess( this, "modifyLaProc" );
- connect(modifyLaProc, SIGNAL( processExited() ), this, SLOT( checkModifyLaResult() ) );
// create instance of class for starting shell script to check Fortran libraries
checkFLibProc = new QProcess( this, "checkFLibProc" );
- connect(checkFLibProc, SIGNAL( processExited() ), this, SLOT( checkFLibResult() ) );
// create introduction page
setupIntroPage();
connect( this, SIGNAL( helpClicked() ), this, SLOT( helpClicked() ) );
connect( this, SIGNAL( aboutClicked() ), this, SLOT( onAbout() ) );
- // catch signals from launched script
+ // catch signals from launched diskSpaceProc
+ connect( diskSpaceProc, SIGNAL( processExited() ), this, SLOT( updateAvailableSpace() ) );
+ // catch signals from launched shellProcess
connect(shellProcess, SIGNAL( readyReadStdout() ), this, SLOT( readFromStdout() ) );
connect(shellProcess, SIGNAL( readyReadStderr() ), this, SLOT( readFromStderr() ) );
connect(shellProcess, SIGNAL( processExited() ), this, SLOT( productInstalled() ) );
connect(shellProcess, SIGNAL( wroteToStdin() ), this, SLOT( wroteToStdin() ) );
+ // catch signals from launched modifyLaProc
+ connect(modifyLaProc, SIGNAL( readyReadStdout() ), this, SLOT( readFromStdout() ) );
+ connect(modifyLaProc, SIGNAL( readyReadStderr() ), this, SLOT( readFromStderr() ) );
+ connect(modifyLaProc, SIGNAL( processExited() ), this, SLOT( checkModifyLaResult() ) );
+ // catch signals from launched checkFLibProc
+ connect(checkFLibProc, SIGNAL( processExited() ), this, SLOT( checkFLibResult() ) );
// create validation thread
myThread = new ProcessThread( this );
// ================================================================
void SALOME_InstallWizard::runModifyLaFiles()
{
+ modifyLaProc->clearArguments();
// ... update status label
statusLab->setText( tr( "Modification of *.la files of SALOME modules..." ) );
// set process arguments
statusLab->setText( tr( "Installation has been aborted" ) );
QMessageBox::critical( this,
tr( "Error" ),
- tr( "There is a problem during modification of *.la SALOME files"),
+ tr( "Modification of *.la SALOME files has not been completed."),
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
+ // enable <Next> button
+ setNextEnabled( true );
+ nextButton()->setText( tr( "&Start" ) );
+ setAboutInfo( nextButton(), tr( "Start installation process" ) );
+ // reconnect Next button - to use it as Start button
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ // enable <Back> button
+ setBackEnabled( true );
}
}
// ================================================================
void SALOME_InstallWizard::runCheckFLib()
{
// Check Fortran libraries
+ checkFLibProc->clearArguments();
// ... update status label
statusLab->setText( tr( "Check Fortran libraries..." ) );
// ... search "not found" libraries
// ... binaries directory
shellProcess->addArgument( binDir );
// ... install SALOME with GUI or not?
- if ( installGuiBtn->state() != QButton::On ) {
- if ( woGuiModules.find( prodProc ) != woGuiModules.end() )
- woGuiModules[ prodProc ] == True ?
- shellProcess->addArgument( "FALSE" ) :
- shellProcess->addArgument( "TRUE" );
- }
+ if ( woGuiModules.find( prodProc ) != woGuiModules.end() )
+ ( installGuiBtn->state() != QButton::On && woGuiModules[ prodProc ] == True ) ?
+ shellProcess->addArgument( "FALSE" ) :
+ shellProcess->addArgument( "TRUE" );
// ... single installation directory for SALOME modules, if this option was selected
if ( oneModDirBtn->isChecked() ) {
MapProducts::Iterator mapIter;
for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter )
- if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "component" )
+ if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "component" ) {
shellProcess->addArgument( oneModDirName );
+ break;
+ }
}
// ... single installation directory for prerequisites, if this option was selected
if ( oneProdDirBtn->isChecked() ) {
else {
MapProducts::Iterator mapIter;
for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter )
- if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "prerequisite" )
+ if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "prerequisite" ) {
shellProcess->addArgument( oneProdDirName );
+ break;
+ }
}
}
if ( aPage == typePage ) {
// installation type page
if ( buttonGrp->id( buttonGrp->selected() ) == -1 )
- binBtn->animateClick(); // set default installation type
+ // set default installation type
+ forceSrc ? srcCompileBtn->animateClick() : binBtn->animateClick();
}
else if ( aPage == platformsPage ) {
// installation platforms page
if ( nextButton()->text() == tr( "&Stop" ) ) {
statusLab->setText( tr( "Aborting installation..." ) );
shellProcess->kill();
+ modifyLaProc->kill();
while( shellProcess->isRunning() );
statusLab->setText( tr( "Installation has been aborted by user" ) );
return;
void SALOME_InstallWizard::onCancel()
{
shellProcess->kill();
+ modifyLaProc->kill();
+ checkFLibProc->kill();
reject();
}
// ================================================================
void SALOME_InstallWizard::readFromStdout( )
{
___MESSAGE___( "Something was sent to stdout" );
- while ( shellProcess->canReadLineStdout() ) {
- installInfo->append( QString( shellProcess->readLineStdout() ) );
+ QProcess* theProcess = ( QProcess* )sender();
+ while ( theProcess->canReadLineStdout() ) {
+ installInfo->append( QString( theProcess->readLineStdout() ) );
installInfo->scrollToBottom();
}
- QString str( shellProcess->readStdout() );
+ QString str( theProcess->readStdout() );
if ( !str.isEmpty() ) {
installInfo->append( str );
installInfo->scrollToBottom();
void SALOME_InstallWizard::readFromStderr( )
{
___MESSAGE___( "Something was sent to stderr" );
- while ( shellProcess->canReadLineStderr() ) {
- installInfo->append( OUTLINE_TEXT( QString( shellProcess->readLineStderr() ) ) );
+ QProcess* theProcess = ( QProcess* )sender();
+ while ( theProcess->canReadLineStderr() ) {
+ installInfo->append( OUTLINE_TEXT( QString( theProcess->readLineStderr() ) ) );
installInfo->scrollToBottom();
hasErrors = true;
}
- QString str( shellProcess->readStderr() );
+ QString str( theProcess->readStderr() );
if ( !str.isEmpty() ) {
installInfo->append( OUTLINE_TEXT( str ) );
installInfo->scrollToBottom();