]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Fix and some improve of a process management mechanism.
authorakl <akl@opencascade.com>
Tue, 27 May 2008 14:39:42 +0000 (14:39 +0000)
committerakl <akl@opencascade.com>
Tue, 27 May 2008 14:39:42 +0000 (14:39 +0000)
bin/SALOME_InstallWizard
src/SALOME_InstallWizard.cxx

index 575c854952c6cae0230d40c7825e574c93400375..b916a5674a22826fdc67fbba47eed021d8fc4482 100755 (executable)
Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ
index d3a27ca76aaca8fe70ffc7bfb02e7ece16be9c20..27137801ecdadb84f872aa82e277850b9d203564 100644 (file)
@@ -547,17 +547,12 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
 
   // 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();
@@ -589,11 +584,21 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
   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( readyReadStdout() ), this, SLOT( readFromStdout() ) );
+  connect(checkFLibProc, SIGNAL( readyReadStderr() ), this, SLOT( readFromStderr() ) );
+  connect(checkFLibProc, SIGNAL( processExited() ), this, SLOT( checkFLibResult() ) );
 
   // create validation thread
   myThread = new ProcessThread( this );
@@ -1747,6 +1752,7 @@ void SALOME_InstallWizard::updateAvailableSpace()
 // ================================================================
 void SALOME_InstallWizard::runModifyLaFiles()
 {
+  modifyLaProc->clearArguments();
   // ... update status label
   statusLab->setText( tr( "Modification of *.la files of SALOME modules..." ) );
   // set process arguments
@@ -1775,10 +1781,20 @@ void SALOME_InstallWizard::checkModifyLaResult()
     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 );
   }
 }
 // ================================================================
@@ -1790,6 +1806,7 @@ void SALOME_InstallWizard::checkModifyLaResult()
 void SALOME_InstallWizard::runCheckFLib()
 {
   // Check Fortran libraries
+  checkFLibProc->clearArguments();
   // ... update status label
   statusLab->setText( tr( "Check Fortran libraries..." ) );
   // ... search "not found" libraries
@@ -2663,6 +2680,7 @@ void SALOME_InstallWizard::onStart()
   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;
@@ -2923,6 +2941,8 @@ void SALOME_InstallWizard::tryTerminate()
 void SALOME_InstallWizard::onCancel()
 {
   shellProcess->kill();
+  modifyLaProc->kill();
+  checkFLibProc->kill();
   reject();
 }
 // ================================================================
@@ -3001,11 +3021,12 @@ void SALOME_InstallWizard::wroteToStdin( )
 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();
@@ -3023,12 +3044,13 @@ void SALOME_InstallWizard::readFromStdout( )
 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();