-// File : SALOME_InstallWizard.cxx
+// File : SALOME_InstallWizard.cxx
// Created : Thu Dec 18 12:01:00 2002
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
#include <qcheckbox.h>
#include <qsplitter.h>
#include <qlayout.h>
-#include <qfiledialog.h>
+#include <qfiledialog.h>
#include <qapplication.h>
-#include <qfileinfo.h>
-#include <qmessagebox.h>
-#include <qtimer.h>
+#include <qfileinfo.h>
+#include <qmessagebox.h>
+#include <qtimer.h>
#include <qvbox.h>
-#include <qwhatsthis.h>
+#include <qwhatsthis.h>
#include <qtooltip.h>
#include <qfile.h>
#include <qthread.h>
#include <qmutex.h>
#include <qstringlist.h>
#include <qpopupmenu.h>
+#include <qregexp.h>
#ifdef WNT
#include <iostream.h>
virtual void run() {
while ( hasCommands() ) {
___MESSAGE___( "ProcessThread::run - Processing command : " << myCommands[ 0 ].latin1() );
- int result = system( myCommands[ 0 ] ) / 256; // return code is <errno> * 256
+ int result = system( myCommands[ 0 ] ) / 256; // return code is <errno> * 256
___MESSAGE___( "ProcessThread::run - Result : " << result );
QCheckListItem* item = myItems.first();
myCommands.pop_front();
static WarnDialog* myDlg;
bool myCloseFlag;
- WarnDialog( QWidget* parent )
+ WarnDialog( QWidget* parent )
: QDialog( parent, "WarnDialog", true, WDestructiveClose ) {
setCaption( tr( "Information" ) );
myCloseFlag = false;
QLabel* lab = new QLabel( tr( "Please, wait while checking native products configuration ..." ), this );
lab->setAlignment( AlignCenter );
- lab->setFrameStyle( QFrame::Box | QFrame::Plain );
+ lab->setFrameStyle( QFrame::Box | QFrame::Plain );
QVBoxLayout* l = new QVBoxLayout( this );
l->setMargin( 0 );
l->add( lab );
- this->setFixedSize( lab->sizeHint().width() + 50,
+ this->setFixedSize( lab->sizeHint().width() + 50,
lab->sizeHint().height() * 5 );
}
void accept() { return; }
void reject() { return; }
void closeEvent( QCloseEvent* e )
- { if ( !myCloseFlag ) return;
+ { if ( !myCloseFlag ) return;
e->accept();
QDialog::closeEvent( e );
}
if ( !myDlg ) {
myDlg = new WarnDialog( parent );
QSize sh = myDlg->size();
- myDlg->move( parent->x() + (parent->width()-sh.width())/2,
+ myDlg->move( parent->x() + (parent->width()-sh.width())/2,
parent->y() + (parent->height()-sh.height())/2 );
myDlg->show();
}
* Defines list of dependancies as string separated by space symbols
*/
// ================================================================
-static QString DefineDependeces(MapProducts& theProductsMap)
+static QString DefineDependeces(MapProducts& theProductsMap)
{
QStringList aProducts;
for ( MapProducts::Iterator mapIter = theProductsMap.begin(); mapIter != theProductsMap.end(); ++mapIter ) {
#define QUOTE(arg) QString("'") + QString(arg) + QString("'")
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- T H E O L D I M P L E M E N T A T I O N
+ T H E O L D I M P L E M E N T A T I O N
static QString DefineDependeces(MapProducts& theProductsMap, QCheckListItem* product ){
QStringList aProducts;
if ( theProductsMap.contains( product ) ) {
SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
const QString& aTargetDir,
const QString& aTmpDir)
- : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
- helpWindow( NULL ),
- moreMode( false ),
- previousPage( 0 ),
+ : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
+ helpWindow( NULL ),
+ moreMode( false ),
+ previousPage( 0 ),
exitConfirmed( false )
{
myIWName = tr( "Installation Wizard" );
setIcon( pixmap( pxIcon ) );
// enable sizegrip
setSizeGripEnabled( true );
-
+
// add logo
addLogo( pixmap( pxLogo ) );
-
+
// set defaults
setVersion( "1.2" );
setCaption( tr( "PAL/SALOME %1" ).arg( myVersion ) );
setLicense( tr( "All right reserved" ) );
setOS( "" );
- ___MESSAGE___( "Configuration file : " << xmlFileName );
- ___MESSAGE___( "Target directory : " << targetDirPath );
- ___MESSAGE___( "Temporary directory: " << tmpDirPath );
+ ___MESSAGE___( "Configuration file : " << xmlFileName.latin1() );
+ ___MESSAGE___( "Target directory : " << targetDirPath.latin1() );
+ ___MESSAGE___( "Temporary directory: " << tmpDirPath.latin1() );
// xml reader
QFile xmlfile(xmlFileName);
StructureParser* handler = new StructureParser( this );
reader.setContentHandler( handler );
- reader.parse( source );
+ reader.parse( source );
}
// create instance of class for starting shell install script
setupProgressPage();
// create readme page
setupReadmePage();
-
+
// common buttons
QWhatsThis::add( backButton(), tr( "Returns to the previous step of the installation procedure" ) );
QToolTip::add ( backButton(), tr( "Returns to the previous step of the installation procedure" ) );
QToolTip::add ( cancelButton(), tr( "Cancels installation and quits program" ) );
QWhatsThis::add( helpButton(), tr( "Displays help information window" ) );
QToolTip::add ( helpButton(), tr( "Displays help information window" ) );
-
+
// common signals connections
connect( this, SIGNAL( selected( const QString& ) ),
this, SLOT( pageChanged( const QString& ) ) );
script += QString::number( PID );
script += " > /dev/null";
___MESSAGE___( "script: " << script.latin1() );
- if ( system( script.latin1() ) ) {
+ if ( system( script.latin1() ) ) {
}
}
delete myThread;
return;
}
if ( !exitConfirmed ) {
- if ( QMessageBox::information( this,
- tr( "Exit" ),
- tr( "Do you want to quit %1?" ).arg( getIWName() ),
- tr( "&Yes" ),
+ if ( QMessageBox::information( this,
+ tr( "Exit" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
+ tr( "&Yes" ),
tr( "&No" ),
QString::null,
0,
{
// create page
introPage = new QWidget( this, "IntroPage" );
- QGridLayout* pageLayout = new QGridLayout( introPage );
+ QGridLayout* pageLayout = new QGridLayout( introPage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// create logo picture
logoLab = new QLabel( introPage );
{
// create page
productsPage = new QWidget( this, "ProductsPage" );
- QGridLayout* pageLayout = new QGridLayout( productsPage );
+ QGridLayout* pageLayout = new QGridLayout( productsPage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// target directory
QLabel* targetLab = new QLabel( tr( "Type the target directory:" ), productsPage );
QWhatsThis::add( prerequisites, tr( "Check this if you want prerequisites products to be set on automatically" ) );
QToolTip::add ( prerequisites, tr( "Check this if you want prerequisites products to be set on automatically" ) );
// <Unselect All> button
- unselectBtn = new QPushButton( tr( "&Unselect All" ), moreBox );
+ unselectBtn = new QPushButton( tr( "&Unselect All" ), moreBox );
QWhatsThis::add( unselectBtn, tr( "Unselects all products" ) );
QToolTip::add ( unselectBtn, tr( "Unselects all products" ) );
// <SALOME sources> / <SALOME binaries> tri-state checkboxes
- selectSrcBtn = new QMyCheckBox( tr( "SALOME sources" ), moreBox );
- selectSrcBtn->setTristate( true );
- QWhatsThis::add( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
- QToolTip::add ( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
- selectBinBtn = new QMyCheckBox( tr( "SALOME binaries" ), moreBox );
+ selectBinBtn = new QMyCheckBox( tr( "SALOME binaries" ), moreBox );
selectBinBtn->setTristate( true );
QWhatsThis::add( selectBinBtn, tr( "Selects/unselects SALOME binaries" ) );
QToolTip::add ( selectBinBtn, tr( "Selects/unselects SALOME binaries" ) );
- QVBoxLayout* btnLayout = new QVBoxLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 );
- btnLayout->addWidget( unselectBtn );
- btnLayout->addWidget( selectSrcBtn );
- btnLayout->addWidget( selectBinBtn );
+ selectSrcBtn = new QMyCheckBox( tr( "SALOME sources" ), moreBox );
+ selectSrcBtn->setTristate( true );
+ QWhatsThis::add( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
+ QToolTip::add ( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
+ buildSrcBtn = new QMyCheckBox( tr( "Build SALOME sources" ), moreBox );
+ QWhatsThis::add( buildSrcBtn, tr( "Check this box if you want to build selected SALOME sources after the installation" ) );
+ QToolTip::add ( buildSrcBtn, tr( "Check this box if you want to build selected SALOME sources after the installation" ) );
+ QGridLayout* btnLayout = new QGridLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 );
+ btnLayout->addMultiCellWidget( unselectBtn, 0, 0, 0, 1 );
+ btnLayout->addMultiCellWidget( selectBinBtn, 1, 1, 0, 1 );
+ btnLayout->addMultiCellWidget( selectSrcBtn, 2, 2, 0, 1 );
+ btnLayout->addWidget( buildSrcBtn, 3, 1 );
+ btnLayout->setColSpacing( 0, 20 );
+ btnLayout->setColStretch( 1, 10 );
// layouting advancet mode widgets
moreBoxLayout->addMultiCellWidget( tempLab, 0, 0, 0, 2 );
moreBoxLayout->addMultiCellWidget( tempFolder, 1, 1, 0, 1 );
moreBoxLayout->addMultiCellWidget( prerequisites,3, 3, 1, 2 );
moreBoxLayout->addMultiCellLayout( btnLayout, 4, 4, 1, 2 );
moreBoxLayout->addMultiCellLayout( sizeLayout, 5, 5, 1, 2 );
+ // <Less...> box
+ lessBox = new QWidget( productsPage );
+ QGridLayout* lessBoxLayout = new QGridLayout( lessBox );
+ lessBoxLayout->setMargin( 0 ); lessBoxLayout->setSpacing( 6 );
+ // <Install all products from sources> check box
+ allFromSrcBtn = new QMyCheckBox( tr( "Install all products from sources" ), lessBox );
+ lessBoxLayout->addWidget( allFromSrcBtn, 0, 0 );
+ lessBoxLayout->setRowStretch( 1, 10 );
+ //lessBoxLayout->addItem( new QSpacerItem( 10,10, QSizePolicy::Minimum, QSizePolicy ), 1, 1 );
// <More...> button
moreBtn = new QPushButton( tr( "More..." ), productsPage );
// layouting
pageLayout->addWidget ( targetFolder, 1, 0 );
pageLayout->addWidget ( targetBtn, 1, 1 );
pageLayout->addMultiCellWidget( moreBox, 2, 2, 0, 1 );
- pageLayout->addWidget ( moreBtn, 3, 1 );
+ pageLayout->addMultiCellWidget( lessBox, 3, 3, 0, 1 );
+ pageLayout->addWidget ( moreBtn, 4, 1 );
pageLayout->setRowStretch( 2, 5 );
+ pageLayout->setRowStretch( 3, 5 );
//pageLayout->addRowSpacing( 6, 10 );
// xml reader
QFile xmlfile(xmlFileName);
handler->setTargetDir(targetFolder);
handler->setTempDir(tempFolder);
reader.setContentHandler( handler );
- reader.parse( source );
+ reader.parse( source );
}
// take into account command line parameters
if ( !targetDirPath.isEmpty() )
// adding page
addPage( productsPage, tr( "Installation settings" ) );
// connecting signals
- connect( productsView, SIGNAL( selectionChanged() ),
- this, SLOT( onSelectionChanged() ) );
- connect( productsView, SIGNAL( itemToggled( QCheckListItem* ) ),
- this, SLOT( onItemToggled( QCheckListItem* ) ) );
- connect( unselectBtn, SIGNAL( clicked() ), this, SLOT( onProdBtn() ) );
- connect( selectSrcBtn, SIGNAL( stateChanged(int) ),
- this, SLOT( onProdBtn() ) );
- connect( selectBinBtn, SIGNAL( stateChanged(int) ),
- this, SLOT( onProdBtn() ) );
+ connect( productsView, SIGNAL( selectionChanged() ),
+ this, SLOT( onSelectionChanged() ) );
+ connect( productsView, SIGNAL( itemToggled( QCheckListItem* ) ),
+ this, SLOT( onItemToggled( QCheckListItem* ) ) );
+ connect( unselectBtn, SIGNAL( clicked() ),
+ this, SLOT( onProdBtn() ) );
+ connect( selectSrcBtn, SIGNAL( stateChanged(int) ),
+ this, SLOT( onProdBtn() ) );
+ connect( selectBinBtn, SIGNAL( stateChanged(int) ),
+ this, SLOT( onProdBtn() ) );
+ connect( buildSrcBtn, SIGNAL( stateChanged(int) ),
+ this, SLOT( onProdBtn() ) );
+ connect( allFromSrcBtn, SIGNAL( stateChanged(int) ),
+ this, SLOT( onBuildAll() ) );
// connecting signals
- connect( targetFolder, SIGNAL( textChanged( const QString& ) ),
- this, SLOT( directoryChanged( const QString& ) ) );
- connect( targetBtn, SIGNAL( clicked() ), this, SLOT( browseDirectory() ) );
- connect( tempFolder, SIGNAL( textChanged( const QString& ) ),
- this, SLOT( directoryChanged( const QString& ) ) );
- connect( tempBtn, SIGNAL( clicked() ), this, SLOT( browseDirectory() ) );
- connect( moreBtn, SIGNAL( clicked() ), this, SLOT( onMoreBtn() ) );
+ connect( targetFolder, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( directoryChanged( const QString& ) ) );
+ connect( targetBtn, SIGNAL( clicked() ),
+ this, SLOT( browseDirectory() ) );
+ connect( tempFolder, SIGNAL( textChanged( const QString& ) ),
+ this, SLOT( directoryChanged( const QString& ) ) );
+ connect( tempBtn, SIGNAL( clicked() ), this, SLOT( browseDirectory() ) );
+ connect( moreBtn, SIGNAL( clicked() ), this, SLOT( onMoreBtn() ) );
// start on default - non-advanced - mode
moreBox->hide();
}
{
// create page
prestartPage = new QWidget( this, "PrestartPage" );
- QVBoxLayout* pageLayout = new QVBoxLayout( prestartPage );
+ QVBoxLayout* pageLayout = new QVBoxLayout( prestartPage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// choice text view
choices = new QTextEdit( prestartPage );
{
// create page
progressPage = new QWidget( this, "progressPage" );
- QGridLayout* pageLayout = new QGridLayout( progressPage );
+ QGridLayout* pageLayout = new QGridLayout( progressPage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// top splitter
splitter = new QSplitter( Vertical, progressPage );
splitter->setOpaqueResize( true );
// the parent for the widgets
QWidget* widget = new QWidget( splitter );
- QGridLayout* layout = new QGridLayout( widget );
+ QGridLayout* layout = new QGridLayout( widget );
layout->setMargin( 0 ); layout->setSpacing( 6 );
// installation progress view box
installInfo = new InstallInfo( widget );
layout->addRowSpacing( 3, 6 );
// the parent for the widgets
widget = new QWidget( splitter );
- layout = new QGridLayout( widget );
+ layout = new QGridLayout( widget );
layout->setMargin( 0 ); layout->setSpacing( 6 );
// installation results view box
QLabel* resultLab = new QLabel( tr( "Installation Status:" ), widget );
{
// create page
readmePage = new QWidget( this, "ReadmePage" );
- QVBoxLayout* pageLayout = new QVBoxLayout( readmePage );
+ QVBoxLayout* pageLayout = new QVBoxLayout( readmePage );
pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
// README info text box
readme = new QTextEdit( readmePage );
QWhatsThis::add( b, tr( (*it).tootip() ) );
QToolTip::add ( b, tr( (*it).tootip() ) );
}
- hLayout->addWidget( b );
+ hLayout->addWidget( b );
(*it).setButton( b );
connect( b, SIGNAL( clicked() ), this, SLOT( onFinishButton() ) );
}
item = (QCheckListItem*)( productsView->firstChild() );
while( item ) {
if ( productsMap.contains( item ) ) {
+ if ( productsMap[ item ].hasContext( "salome sources" ) ||
+ productsMap[ item ].hasContext( "salome binaries" ) ) {
+ item = (QCheckListItem*)( item->nextSibling() );
+ continue; // skip SALOME sources and binaries
+ }
if ( item->childCount() > 0 ) {
if ( productsView->isBinaries( item ) ) {
text += "<li><b>" + item->text() + " " + item->text(1) + "</b> " + tr( "as binaries" ) + "<br>";
text += "<li><b>" + tr( "none" ) + "</b><br>";
}
text += "</ul>";
+ // SALOME binaries, sources, samples
+ QString textBin = "";
+ QString textSrc = "";
+ QString textBoth = "";
+ item = (QCheckListItem*)( productsView->firstChild() );
+ while( item ) {
+ if ( productsMap.contains( item ) ) {
+ if ( !productsMap[ item ].hasContext( "salome sources" ) &&
+ productsMap[ item ].hasContext( "salome binaries" ) ) {
+ if ( ( item->childCount() > 0 && productsView->isBinaries( item ) || item->isOn() ) && item->isEnabled() ) {
+ textBin += "<li><b>" + item->text().replace( QRegExp( "(-)?bin", false ), "" ) + "</b><br>";
+ }
+ }
+ if ( productsMap[ item ].hasContext( "salome sources" ) &&
+ !productsMap[ item ].hasContext( "salome binaries" ) ) {
+ if ( item->childCount() > 0 && productsView->isSources( item ) || item->isOn() ) {
+ textSrc += "<li><b>" + item->text().replace( QRegExp( "(-)?src", false ), "" ) + "</b><br>";
+ }
+ }
+ if ( productsMap[ item ].hasContext( "salome sources" ) &&
+ productsMap[ item ].hasContext( "salome binaries" ) ) {
+ if ( item->childCount() > 0 && productsView->isSources( item ) || item->isOn() ) {
+ textBoth += "<li><b>" + item->text() + "</b><br>";
+ }
+ }
+ }
+ item = (QCheckListItem*)( item->nextSibling() );
+ }
+ if ( !textBin.isEmpty() )
+ text += tr( "SALOME binaries to be installed" ) + ":<ul>" + textBin + "</ul>";
+ if ( !textSrc.isEmpty() )
+ text += tr( "SALOME sources to be installed" ) + ( buildSrcBtn->isChecked() ? tr( " and build" ) : QString( "" ) ) + ":<ul>" + textSrc + "</ul>";
+ if ( !textBoth.isEmpty() )
+ text += tr( "Other SALOME modules to be installed" ) + ":<ul>" + textBoth + "</ul>";
text += tr( "Total disk space required:" ) + " <b>" + QString::number( totSize ) + " Kb</b><br>" ;
text += tr( "Space for temporary files required:" ) + " <b>" + QString::number( tempSize ) + " Kb</b><br>" ;
text += "<br>";
long totSize, tempSize;
bool anySelected = checkSize( &totSize, &tempSize );
if ( !anySelected ) {
- QMessageBox::warning( this,
- tr( "Warning" ),
- tr( "Select one or more products to install" ),
- QMessageBox::Ok,
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "Select one or more products to install" ),
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
QString tempDir = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() );
// directories should differ
// if (!targetDir.isEmpty() && tempDir == targetDir) {
-// QMessageBox::warning( this,
-// tr( "Warning" ),
-// tr( "Target and temporary directories must be different"),
-// QMessageBox::Ok,
-// QMessageBox::NoButton,
+// QMessageBox::warning( this,
+// tr( "Warning" ),
+// tr( "Target and temporary directories must be different"),
+// QMessageBox::Ok,
+// QMessageBox::NoButton,
// QMessageBox::NoButton );
// return false;
// }
// check target directory
if ( targetDir.isEmpty() ) {
- QMessageBox::warning( this,
- tr( "Warning" ),
- tr( "Please, enter valid target directory path" ),
- QMessageBox::Ok,
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "Please, enter valid target directory path" ),
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
QFileInfo fi( QDir::cleanDirPath( targetDir ) );
if ( !fi.exists() ) {
- bool toCreate =
- QMessageBox::warning( this,
- tr( "Warning" ),
+ bool toCreate =
+ QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
- "Create directory?" ).arg( fi.absFilePath() ),
- QMessageBox::Yes,
+ "Create directory?" ).arg( fi.absFilePath() ),
+ QMessageBox::Yes,
QMessageBox::No,
QMessageBox::NoButton ) == QMessageBox::Yes;
- if ( !toCreate)
+ if ( !toCreate)
return false;
if ( !makeDir( fi.absFilePath(), tmpstr ) ) {
- QMessageBox::critical( this,
- tr( "Error" ),
- tr( "Can't create the directory\n%1").arg( fi.absFilePath() ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::critical( this,
+ tr( "Error" ),
+ tr( "Can't create the directory\n%1").arg( fi.absFilePath() ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
}
if ( !fi.isDir() ) {
- QMessageBox::warning( this,
- tr( "Warning" ),
+ QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "%1 is not a directory.\n"
- "Please, enter valid target directory path" ).arg( fi.absFilePath() ),
- QMessageBox::Ok,
+ "Please, enter valid target directory path" ).arg( fi.absFilePath() ),
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
if ( !fi.isWritable() ) {
- QMessageBox::warning( this,
- tr( "Warning" ),
+ QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "The directory %1 is not writeable.\n"
- "Please, enter valid target directory path or change permissions" ).arg( fi.absFilePath() ),
- QMessageBox::Ok,
+ "Please, enter valid target directory path or change permissions" ).arg( fi.absFilePath() ),
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
return false;
}
// check sources/binaries archives directories existance
- int nbSources = 0, nbBinaries = 0;
+ int nbSources = 0, nbBinaries = 0;
QCheckListItem* nitem = (QCheckListItem*)( productsView->firstChild() );
while( nitem ) {
if ( productsMap.contains( nitem ) ) {
binDir += "/" + myOS;
QFileInfo fib( QDir::cleanDirPath( binDir ) );
if ( !fib.exists() ) {
- if ( QMessageBox::warning( this,
- tr( "Warning" ),
+ if ( QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
"This directory must contain binaries archives.\n"
"Continue?" ).arg( fib.absFilePath() ),
QString srcDir = "./Products/SOURCES";
QFileInfo fis( QDir::cleanDirPath( srcDir ) );
if ( !fis.exists() ) {
- if ( QMessageBox::warning( this,
- tr( "Warning" ),
+ if ( QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
"This directory must contain sources archives.\n"
"Continue?" ).arg( fis.absFilePath() ),
script += fi.absFilePath();
script += "' ";
script += QString( "%1" ).arg( totSize );
- ___MESSAGE___( "script = " << script );
+ ___MESSAGE___( "script = " << script.latin1() );
if ( system( script ) ) {
- QMessageBox::critical( this,
- tr( "Out of space" ),
- tr( "There is no available disk space for installing of selected products" ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::critical( this,
+ tr( "Out of space" ),
+ tr( "There is no available disk space for installing of selected products" ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
// check temp directory
if ( tempDir.isEmpty() ) {
if ( moreMode ) {
- QMessageBox::warning( this,
- tr( "Warning" ),
- tr( "Please, enter valid temporary directory path" ),
- QMessageBox::Ok,
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "Please, enter valid temporary directory path" ),
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
- return false;
+ return false;
}
else {
tempDir = "/tmp";
}
QFileInfo fit( QDir::cleanDirPath( tempDir ) );
if ( !makeDir( fit.absFilePath() + TEMPDIRNAME, tmpCreated ) ) {
- QMessageBox::critical( this,
- tr( "Error" ),
- tr( "Can't use temporary directory.\nCheck permissions for the %1 directory.").arg( fit.absFilePath() ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::critical( this,
+ tr( "Error" ),
+ tr( "Can't use temporary directory.\nCheck permissions for the %1 directory.").arg( fit.absFilePath() ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
tscript += fit.absFilePath();
tscript += "' ";
tscript += QString( "%1" ).arg( tempSize );
- ___MESSAGE___( "script = " << tscript );
+ ___MESSAGE___( "script = " << tscript.latin1() );
if ( system( tscript ) ) {
- QMessageBox::critical( this,
- tr( "Out of space" ),
- tr( "There is no available disk space for the temporary files" ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::critical( this,
+ tr( "Out of space" ),
+ tr( "There is no available disk space for the temporary files" ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
// VSR : 29/01/05 : Check installation script even if product is not being installed
// if ( !productsView->isNone( item ) ) {
if ( item->text(2).isEmpty() || item->text(2).isNull() ) {
- QMessageBox::warning( this,
- tr( "Error" ),
- tr( "The installation script for %1 is not defined.").arg(item->text(0)),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::warning( this,
+ tr( "Error" ),
+ tr( "The installation script for %1 is not defined.").arg(item->text(0)),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
if ( !moreMode )
onMoreBtn();
} else {
QFileInfo fi( QString("./config_files/") + item->text(2) );
if ( !fi.exists() || !fi.isExecutable() ) {
- QMessageBox::warning( this,
- tr( "Error" ),
- tr( "The script %1 required for %2 doesn't exist or doesn't have execute permissions.").arg("./config_files/" + item->text(2)).arg(item->text(0)),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::warning( this,
+ tr( "Error" ),
+ tr( "The script %1 required for %2 doesn't exist or doesn't have execute permissions.").arg("./config_files/" + item->text(2)).arg(item->text(0)),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
if ( !moreMode )
onMoreBtn();
productsView->ensureItemVisible( item );
//productsView->setNone( item );
return false;
- }
+ }
}
// }
// collect native products
if ( productsView->isNative( item ) ) {
if ( natives.find( item->text(0) ) == natives.end() )
natives.append( item->text(0) );
- }
+ }
else if ( productsView->isBinaries( item ) || productsView->isSources( item ) ) {
QStringList dependOn = productsMap[ item ].getDependancies();
for ( int i = 0; i < (int)dependOn.count(); i++ ) {
if ( depitem ) {
if ( productsView->isNative( depitem ) && natives.find( depitem->text(0) ) == natives.end() )
natives.append( depitem->text(0) );
- }
+ }
else {
- QMessageBox::warning( this,
- tr( "Error" ),
+ QMessageBox::warning( this,
+ tr( "Error" ),
tr( "%1 is required for %2 %3 installation.\n"
- "This product is missing in the configuration file %4.").arg(dependOn[ i ]).arg(item->text(0)).arg(item->text(1)).arg(xmlFileName),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ "This product is missing in the configuration file %4.").arg(dependOn[ i ]).arg(item->text(0)).arg(item->text(1)).arg(xmlFileName),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
myThread->addCommand( item, script );
}
else {
- QMessageBox::warning( this,
- tr( "Warning" ),
+ QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "%The product %1 %2 required for installation.\n"
"This product is missing in the configuration file %4.").arg(item->text(0)).arg(item->text(1)).arg(xmlFileName),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
return false;
}
if ( !productsView->isNone( item ) )
nbSelected++;
}
-
+
if ( totSize )
*totSize = tots;
if ( tempSize )
// update required size information
requiredSize->setText( QString::number( tots ) + " Kb");
requiredTemp->setText( QString::number( temps ) + " Kb");
-
+
// update <SALOME sources>, <SALOME binaries> check boxes state
int totSrc = 0, selSrc = 0;
int totBin = 0, selBin = 0;
selectSrcBtn->blockSignals( false );
selectBinBtn->blockSignals( false );
+ buildSrcBtn->setEnabled( selSrc > 0 );
+ for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
+ if ( itProd.data().hasContext( "salome sources" ) && !itProd.data().hasContext( "salome binaries" ) ) {
+ productsView->setItemEnabled( productsView->findBinItem( itProd.data().getName() ) ,
+ !buildSrcBtn->isChecked() || !productsView->isSources( itProd.key() ) );
+ }
+ }
+
// enable/disable "Next" button
setNextEnabled( productsPage, isAnyProductSelected && isTargetDirValid && isTempDirValid );
}
}
// ... sources ?
else if ( productsView->isSources( item ) ) {
- shellProcess->addArgument( "install_source" );
+ shellProcess->addArgument( buildSrcBtn->isChecked() ? "install_source_and_build" : "install_source" );
shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
shellProcess->addArgument( QDir::currentDirPath() + "/Products/SOURCES" );
}
// ... target folder
QString tgtFolder = QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() );
shellProcess->addArgument( QFileInfo( tgtFolder ).absFilePath() );
-
- QString depproducts = DefineDependeces(productsMap);
+
+ QString depproducts = DefineDependeces(productsMap);
___MESSAGE___( "Dependancies"<< depproducts.latin1() );
shellProcess->addArgument( depproducts );
for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
QCheckListItem* item = mapIter.key();
Dependancies dep = mapIter.data();
- QString depproducts = QUOTE( DefineDependeces(productsMap) );
+ QString depproducts = QUOTE( DefineDependeces(productsMap) );
if ( !productsView->isNone( item ) && dep.pickUpEnvironment() ) {
- ___MESSAGE___( "... for " << dep.getName() );
+ ___MESSAGE___( "... for " << dep.getName().latin1() );
QString script;
script += "cd " + QUOTE( QFileInfo( QDir::cleanDirPath( "./config_files/" ) ).absFilePath() ) + "; ";
script += item->text(2) + " ";
script += depproducts + " ";
script += item->text(0);
___MESSAGE___( "... --> " << script.latin1() );
- if ( system( script.latin1() ) ) {
- ___MESSAGE___( "ERROR" );
+ if ( system( script.latin1() ) ) {
+ ___MESSAGE___( "ERROR" );
}
}
}
{
if ( moreMode ) {
moreBox->hide();
+ lessBox->show();
moreBtn->setText( tr( "More..." ) );
}
else {
moreBox->show();
+ lessBox->hide();
moreBtn->setText( tr( "Less..." ) );
}
qApp->processEvents();
script += " > /dev/null )";
___MESSAGE___( "script: " << script.latin1() );
if ( (*it).script().isEmpty() || system( script.latin1() ) ) {
- QMessageBox::warning( this,
- tr( "Error" ),
+ QMessageBox::warning( this,
+ tr( "Error" ),
tr( "Can't perform action!"),
- QMessageBox::Ok,
+ QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
}
// ================================================================
/*!
* SALOME_InstallWizard::findItem
- * Searches product listview item with given symbolic name
+ * Searches product listview item with given symbolic name
*/
// ================================================================
QCheckListItem* SALOME_InstallWizard::findItem( const QString& sName )
{
___MESSAGE___( "REJECTED" );
if ( !exitConfirmed ) {
- if ( QMessageBox::information( this,
- tr( "Exit" ),
- tr( "Do you want to quit %1?" ).arg( getIWName() ),
- tr( "&Yes" ),
+ if ( QMessageBox::information( this,
+ tr( "Exit" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
+ tr( "&Yes" ),
tr( "&No" ),
QString::null,
0,
script += "' ";
script += QUOTE(DefineDependeces(productsMap));
script += " > /dev/null";
- ___MESSAGE___( "script = " << script );
+ ___MESSAGE___( "script = " << script.latin1() );
if ( system( script.latin1() ) ) {
}
// VSR: then try to remove created temporary directory
script += " > /dev/null";
if ( system( script.latin1() ) ) {
}
- ___MESSAGE___( "script = " << script );
+ ___MESSAGE___( "script = " << script.latin1() );
}
}
// ================================================================
helpWindow->installEventFilter( this );
}
else {
- QMessageBox::warning( this,
- tr( "Help file not found" ),
+ QMessageBox::warning( this,
+ tr( "Help file not found" ),
tr( "Sorry, help is unavailable" ) );
}
}
type = tr( "sources" );
else if ( productsView->isNative( item ) )
type = tr( "native" );
- else
+ else
type = tr( "not install" );
progressView->addProduct( item->text(0), type, item->text(2) );
}
void SALOME_InstallWizard::tryTerminate()
{
if ( shellProcess->isRunning() ) {
- if ( QMessageBox::information( this,
- tr( "Exit" ),
- tr( "Do you want to quit %1?" ).arg( getIWName() ),
- tr( "&Yes" ),
+ if ( QMessageBox::information( this,
+ tr( "Exit" ),
+ tr( "Do you want to quit %1?" ).arg( getIWName() ),
+ tr( "&Yes" ),
tr( "&No" ),
QString::null,
0,
else {
text += "<b>" + tr( "not install" ) + "</b>" + "<br>";
}
-
+
text += tr( "Disk space required" ) + ": " + QString::number( totSize ) + " Kb<br>";
text += tr( "Disk space for tmp files required" ) + ": " + QString::number( tempSize ) + " Kb<br>";
text += "<br>";
int selBin = 0;
MapProducts::Iterator itProd1;
for ( itProd1 = productsMap.begin(); itProd1 != productsMap.end(); ++itProd1 ) {
- if ( itProd1.data().hasContext( "salome binaries" ) &&
+ if ( itProd1.data().hasContext( "salome binaries" ) &&
!itProd1.data().hasContext( "salome sources" ) &&
productsView->isBinaries( itProd1.key() ) )
selBin++;
int selSrc = 0;
MapProducts::Iterator itProd1;
for ( itProd1 = productsMap.begin(); itProd1 != productsMap.end(); ++itProd1 ) {
- if ( itProd1.data().hasContext( "salome sources" ) &&
+ if ( itProd1.data().hasContext( "salome sources" ) &&
!itProd1.data().hasContext( "salome binaries" ) &&
productsView->isSources( itProd1.key() ) )
selSrc++;
* Add button for the <Finish> page
*/
// ================================================================
-void SALOME_InstallWizard::addFinishButton( const QString& label,
- const QString& tooltip,
+void SALOME_InstallWizard::addFinishButton( const QString& label,
+ const QString& tooltip,
const QString& script)
{
if ( !label.isEmpty() )
f.close();
}
else {
- QMessageBox::critical( this,
- tr( "Error" ),
- tr( "Can't save file %1.\nCheck path and permissions.").arg( fileName ),
- QMessageBox::Ok,
- QMessageBox::NoButton,
+ QMessageBox::critical( this,
+ tr( "Error" ),
+ tr( "Can't save file %1.\nCheck path and permissions.").arg( fileName ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
QMessageBox::NoButton );
}
}
void SALOME_InstallWizard::updateCaption()
{
QWidget* aPage = InstallWizard::currentPage();
- if ( !aPage )
+ if ( !aPage )
return;
InstallWizard::setCaption( tr( myCaption ) + " " +
tr( getIWName() ) + " - " +
if ( val == 2 ) {
WarnDialog::showWarnDlg( 0, false );
// when try_native returns 2 it means that native product version is higher than that is prerequisited
- if ( QMessageBox::warning( this,
- tr( "Warning" ),
+ if ( QMessageBox::warning( this,
+ tr( "Warning" ),
tr( "You have newer version of %1 installed on your computer than that is required (%2).\nContinue?").arg(item->text(0)).arg(item->text(1)),
- QMessageBox::Yes,
- QMessageBox::No,
+ QMessageBox::Yes,
+ QMessageBox::No,
QMessageBox::NoButton ) == QMessageBox::No ) {
myThread->clearCommands();
myWC.wakeAll();
bool binMode = productsView->hasBinaries( item );
bool srcMode = productsView->hasSources( item );
QStringList buttons;
- buttons.append( binMode ? tr( "Install binaries" ) : ( srcMode ? tr( "Install sources" ) :
+ buttons.append( binMode ? tr( "Install binaries" ) : ( srcMode ? tr( "Install sources" ) :
tr( "Select manually" ) ) );
buttons.append( binMode ? ( srcMode ? tr( "Install sources" ) : tr( "Select manually" ) ) :
( srcMode ? tr( "Select manually" ) : QString::null ) );
buttons.append( binMode && srcMode ? tr( "Select manually" ) : QString::null );
- int answer = QMessageBox::warning( this,
- tr( "Warning" ),
- tr( "You don't have native %1 %2 on your computer.\nPlease, change your installation settings.").arg(item->text(0)).arg(item->text(1)),
+ int answer = QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "You don't have native %1 %2 on your computer.\nPlease, change your installation settings.").arg(item->text(0)).arg(item->text(1)),
buttons[0],
buttons[1],
buttons[2] );
InstallWizard::processValidateEvent( val, data );
}
}
+
+// ================================================================
+/*!
+ * SALOME_InstallWizard::resetToDefaultState
+ * Reset to default state
+ */
+// ================================================================
+void SALOME_InstallWizard::resetToDefaultState()
+{
+ productsView->blockSignals( true );
+ buildSrcBtn->setChecked( false );
+ MapProducts::Iterator itProd;
+ for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
+ QString defMode = itProd.data().getDefault();
+ if ( defMode.isEmpty() )
+ defMode = tr( "install binaries" );
+ if ( defMode == tr( "install binaries" ) )
+ productsView->setBinaries( itProd.key() );
+ else if ( defMode == tr( "install sources" ) )
+ productsView->setSources( itProd.key() );
+ else if ( defMode == tr( "use native" ) )
+ productsView->setNative( itProd.key() );
+ else
+ productsView->setNone( itProd.key() );
+ }
+ productsView->blockSignals( false );
+}
+
+// ================================================================
+/*!
+ * SALOME_InstallWizard::onBuildAll
+ * Reset to default state
+ */
+// ================================================================
+void SALOME_InstallWizard::onBuildAll()
+{
+ if ( allFromSrcBtn->isChecked() ) {
+ productsView->blockSignals( true );
+ buildSrcBtn->setChecked( false );
+ MapProducts::Iterator mapIter;
+ for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter )
+ productsView->setSources( mapIter.key() );
+ buildSrcBtn->setChecked( true );
+ productsView->blockSignals( false );
+ static bool firstTimeClicked = true;
+ if ( firstTimeClicked ) {
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "The building of all products from sources can take a lot of time\n"
+ "(more than 24 hours) depending on your computer performance!" ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton );
+ firstTimeClicked = false;
+ }
+
+ }
+ else {
+ resetToDefaultState();
+ }
+ moreBtn->setEnabled( !allFromSrcBtn->isChecked() );
+ checkProductPage();
+}