From: akl
Date: Wed, 8 Apr 2009 07:15:51 +0000 (+0000)
Subject: Implementation of the 0019993 improvement ("If error of installation in installWizard...
X-Git-Tag: V5_1_2rc1~16
X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e70598f51be637f9d2e2c1ebd00523f50f9fb1e3;p=tools%2Finstall.git
Implementation of the 0019993 improvement ("If error of installation in installWizard, please stop installation"): IW is stopped and error message box appears if there is an error during installation.
---
diff --git a/bin/SALOME_InstallWizard b/bin/SALOME_InstallWizard
index fa9d3be..99158b7 100755
Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ
diff --git a/doc/progresspage1.png b/doc/progresspage1.png
index 20ac54b..465ce58 100644
Binary files a/doc/progresspage1.png and b/doc/progresspage1.png differ
diff --git a/doc/progresspage2.png b/doc/progresspage2.png
index c2aad1f..50cc18b 100644
Binary files a/doc/progresspage2.png and b/doc/progresspage2.png differ
diff --git a/doc/readme.html b/doc/readme.html
index 968eb4e..9dfc60d 100755
--- a/doc/readme.html
+++ b/doc/readme.html
@@ -419,7 +419,7 @@ previous pages. You can review again your choices and change them if
necessary returning to the previous pages.
When you are sure that everything is OK, press "Next"
button to
-follow to the progress page.
+follow to the progress page.
@@ -428,14 +428,16 @@ not started yet
To start the installation
-of the selected
-products click "Start"
+of the selected products click "Start"
button. It launches the shell installation script and you will be able
to see the output of the script in the topmost frame of the dialog box.
-If any
-errors occur during the installation progress, the corresponding
-messages
-will be printed to the log window in the bold red font.
+If any errors occur during the installation progress, the corresponding
+messages will be printed to the log window in the bold red font and
+installation process will be aborted with error message box. But user
+has possibility to change this default behaviour by
+"Ignore installation errors" checkbox. It is necessary to check
+it before start and all occured errors will be passed,
+and installation will be continued in any case.
It is possible to break the
installation at any time by pressing "Stop"
diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx
index 8198b96..0dafef5 100644
--- a/src/SALOME_InstallWizard.cxx
+++ b/src/SALOME_InstallWizard.cxx
@@ -1344,14 +1344,20 @@ void SALOME_InstallWizard::setupProgressPage()
progressView = new ProgressView( widget );
progressView->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
progressView->setMinimumSize( 100, 10 );
+ // possibility to ignore all errors
+ ignoreErrCBox = new QCheckBox( tr( "Ignore errors" ), widget );
+ setAboutInfo( ignoreErrCBox, tr( "Check this option if you want to proceed installation \nprocess even there will be some errors" ) );
+ ignoreErrCBox->setChecked( false );
+ // product installation status bar
statusLab = new QLabel( widget );
statusLab->setFrameShape( QButtonGroup::LineEditPanel );
setAboutInfo( progressView, tr( "Installation status on the selected products" ) );
// layouting
layout->addRowSpacing( 0, 6 );
- layout->addWidget( resultLab, 1, 0 );
- layout->addWidget( progressView, 2, 0 );
- layout->addWidget( statusLab, 3, 0 );
+ layout->addWidget( resultLab, 1, 0 );
+ layout->addWidget( progressView, 2, 0 );
+ layout->addWidget( ignoreErrCBox, 3, 0 );
+ layout->addWidget( statusLab, 4, 0 );
// layouting
pageLayout->addWidget( splitter, 0, 0 );
// adding page
@@ -1881,11 +1887,7 @@ void SALOME_InstallWizard::checkModifyLaResult()
QMessageBox::NoButton );
// enable 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() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable button
setBackEnabled( true );
@@ -2271,6 +2273,12 @@ void SALOME_InstallWizard::launchScript()
}
return;
}
+
+ // else try to find aborted product
+ prodProc = progressView->findStatus( Aborted );
+ if ( !prodProc.isNull() )
+ return; // installation has been aborted
+
___MESSAGE___( "All products have been installed successfully" );
// all products are installed successfully
MapProducts::Iterator mapIter;
@@ -2321,10 +2329,7 @@ void SALOME_InstallWizard::completeInstallation()
statusLab->setText( tr( "Installation completed" ) );
// button
setNextEnabled( true );
- nextButton()->setText( tr( "&Next >" ) );
- setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
// button
setBackEnabled( true );
@@ -2339,7 +2344,7 @@ void SALOME_InstallWizard::completeInstallation()
if ( hasErrors ) {
if ( QMessageBox::warning( this,
tr( "Warning" ),
- tr( "There were some errors and/or warnings during the installation.\n"
+ tr( "There were some errors during the installation.\n"
"Do you want to save the installation log?" ),
tr( "&Save" ),
tr( "&Cancel" ),
@@ -2564,10 +2569,7 @@ void SALOME_InstallWizard::clean(bool rmDir)
// ================================================================
void SALOME_InstallWizard::pageChanged( const QString & mytitle)
{
- nextButton()->setText( tr( "&Next >" ) );
- setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
cancelButton()->disconnect();
connect( cancelButton(), SIGNAL( clicked()), this, SLOT( reject() ) );
@@ -2676,11 +2678,7 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle)
passedParams->clear();
passedParams->setEnabled( false );
QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
- 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() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
setNextEnabled( true );
// reconnect Cancel button to terminate process
@@ -2820,6 +2818,8 @@ void SALOME_InstallWizard::onStart()
installInfo->setFinished( false );
passedParams->clear();
passedParams->setEnabled( false );
+ // disable 'Ignore errors' checkbox during installation process
+ ignoreErrCBox->setEnabled( false );
QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
// update status label
@@ -2874,11 +2874,7 @@ void SALOME_InstallWizard::onStart()
statusLab->setText( tr( "Installation has been aborted" ) );
// enable 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() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable button
setBackEnabled( true );
@@ -2960,13 +2956,9 @@ void SALOME_InstallWizard::onStart()
// installation aborted
abort();
statusLab->setText( tr( "Installation has been aborted by user" ) );
- // enable button
+ // update 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() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
// enable button
setBackEnabled( true );
@@ -3018,16 +3010,9 @@ void SALOME_InstallWizard::productInstalled()
installInfo->setFinished( true );
// enable 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() ) );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
- //nextButton()->setText( tr( "&Next >" ) );
- //setAboutInfo( nextButton(), tr( "Move to the next step of the installation procedure" ) );
- //disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
- //disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ //doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
//connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
// enable button
setBackEnabled( true );
@@ -3188,6 +3173,10 @@ void SALOME_InstallWizard::readFromStderr( )
installInfo->scrollToBottom();
hasErrors = true;
}
+
+ // stop or proceed installation process
+ manageInstProc();
+
// VSR: 10/11/05 - disable answer mode ==>
// passedParams->setEnabled( true );
// passedParams->setFocus();
@@ -3195,6 +3184,41 @@ void SALOME_InstallWizard::readFromStderr( )
// VSR: 10/11/05 - disable answer mode <==
}
// ================================================================
+/*!
+ * SALOME_InstallWizard::manageInstProc
+ * QProcess slot: -->stop installation if there is an error in stderr
+ */
+// ================================================================
+void SALOME_InstallWizard::manageInstProc()
+{
+ if ( !hasErrors || ignoreErrCBox->isChecked() )
+ return; //proceed installation process
+
+ // abort the current installation
+ statusLab->setText( tr( "Aborting installation..." ) );
+ abort();
+ statusLab->setText( tr( "Installation has been aborted because some errors" ) );
+ if ( QMessageBox::critical( this,
+ tr( "Error" ),
+ tr( "Installation process has been stopped, because an error occured \n"
+ "during an installation of the current product!\n"
+ "Please see the installation progress view for more details about the error.\n\n"
+ "Do you want to save the installation log?" ),
+ tr( "&Save" ),
+ tr( "&Cancel" ),
+ QString::null,
+ 0,
+ 1 ) == 0 )
+ saveLog();
+ // enable button
+ setNextEnabled( true );
+ doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
+ connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ // enable button
+ setBackEnabled( true );
+ installInfo->setFinished( true );
+}
+// ================================================================
/*!
* SALOME_InstallWizard::setDependancies
* Sets dependancies for the product item
@@ -3205,6 +3229,24 @@ void SALOME_InstallWizard::setDependancies( QCheckListItem* item, Dependancies d
productsMap[item] = dep;
}
// ================================================================
+/*!
+ * SALOME_InstallWizard::doPostActions
+ * Executes some actions after finish of installation process (successful or not)
+ */
+// ================================================================
+void SALOME_InstallWizard::doPostActions( const QString& btnText,
+ const QString& btnAboutInfo )
+{
+ // update button
+ nextButton()->setText( btnText );
+ setAboutInfo( nextButton(), btnAboutInfo );
+ // reconnect Next button - to use it as Start button
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
+ disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
+ // enable 'Ignore errors' checkbox
+ ignoreErrCBox->setEnabled( true );
+}
+// ================================================================
/*!
* SALOME_InstallWizard::addFinishButton
* Add button for the page.
diff --git a/src/SALOME_InstallWizard.hxx b/src/SALOME_InstallWizard.hxx
index e2b26cd..94a6c93 100644
--- a/src/SALOME_InstallWizard.hxx
+++ b/src/SALOME_InstallWizard.hxx
@@ -193,6 +193,10 @@ class SALOME_InstallWizard: public InstallWizard
// set dependancies
void setDependancies( QCheckListItem* item, Dependancies dep);
+ // executes some actions after finish of installation process (successful or not)
+ void doPostActions( const QString& btnText,
+ const QString& btnAboutInfo );
+
// add button for the page
void addFinishButton( const QString& label,
const QString& tooltip,
@@ -348,6 +352,8 @@ class SALOME_InstallWizard: public InstallWizard
void readFromStdout();
// -->something was written to stderr
void readFromStderr();
+ // -->stop installation process if there is an error in stderr
+ void manageInstProc();
private:
QString myIWName; // Installation Wizard's name
@@ -438,6 +444,7 @@ class SALOME_InstallWizard: public InstallWizard
QLineEdit* passedParams; // user can pass data to running script
QTextEdit* installProgress;// contains information about progress of installing selected products
ProgressView* progressView; // displays information about progress of installing selected products
+ QCheckBox* ignoreErrCBox; // checkbox to ignore installation errors
QLabel* statusLab; // displays currently performed action
// --> finish page
QWidget* readmePage; // page itself
diff --git a/src/globals.h b/src/globals.h
index a7fe46d..6d57705 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -17,7 +17,7 @@
#define __IW_VERSION_MAJOR__ 1
#define __IW_VERSION_MINOR__ 1
-#define __IW_VERSION_PATCH__ 6
+#define __IW_VERSION_PATCH__ 7
#define __IW_VERSION__ (__IW_VERSION_MAJOR__*10000 + \
__IW_VERSION_MINOR__*100 + \