// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "SALOME_HelpWindow.hxx"
#include "SALOME_InstallWizard.hxx"
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef __SALOME_HelpWindow
#define __SALOME_HelpWindow
# Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
# Project : SALOME
# Module : Installation Wizard
-# Copyright : 2002-2007 CEA
+# Copyright : 2002-2008 CEA
TEMPLATE = app
CONFIG += qt warn_on release thread
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "globals.h"
.arg( __IW_VERSION_MINOR__ ) \
.arg( __IW_VERSION_PATCH__ ) );
QLabel* copyright = new QLabel( this, "copyright" );
- copyright->setText( "<b>Copyright</b> © 2004-2007 CEA" );
+ copyright->setText( "<b>Copyright</b> © 2002-2008 CEA" );
QFont font = title->font();
font.setPointSize( (int)( font.pointSize() * 1.8 ) );
title->setFont( font );
SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
const QString& aTargetDir,
const QString& aTmpDir,
- const bool aForceSrc)
+ const bool aForceSrc,
+ const bool aSingleDir)
: InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
helpWindow( NULL ),
moreMode( false ),
// create introduction page
setupIntroPage();
// create products page
- setupProductsPage(aForceSrc);
+ setupProductsPage(aForceSrc, aSingleDir);
// create prestart page
setupCheckPage();
// create progress page
* Creates products page
*/
// ================================================================
-void SALOME_InstallWizard::setupProductsPage(const bool forceSrc)
+void SALOME_InstallWizard::setupProductsPage(const bool forceSrc, const bool singleDir)
{
//
// create page
selectBinBtn = new QMyCheckBox( tr( "SALOME binaries" ), moreBox );
selectBinBtn->setTristate( true );
setAboutInfo( selectBinBtn, tr( "Click this button to select/deselect SALOME binaries" ) );
+ singleDirBtn = new QMyCheckBox( tr( "Install to a single directory" ), moreBox );
+ setAboutInfo( singleDirBtn, tr( "Check this box if you want to install binaries of\nall SALOME modules into a single directory." ) );
+ singleDirBtn->setChecked(singleDir);
selectSrcBtn = new QMyCheckBox( tr( "SALOME sources" ), moreBox );
selectSrcBtn->setTristate( true );
setAboutInfo( selectSrcBtn, tr( "Click this button to select/deselect SALOME sources" ) );
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->addWidget( singleDirBtn, 2, 1 );
+ btnLayout->addMultiCellWidget( selectSrcBtn, 3, 3, 0, 1 );
+ btnLayout->addWidget( buildSrcBtn, 4, 1 );
btnLayout->addColSpacing( 0, 20 );
btnLayout->setColStretch( 1, 10 );
//
this, SLOT( onProdBtn() ) );
connect( buildSrcBtn, SIGNAL( stateChanged(int) ),
this, SLOT( onProdBtn() ) );
+ connect( singleDirBtn, SIGNAL( stateChanged(int) ),
+ this, SLOT( onInstallToSingle() ) );
connect( allFromSrcBtn, SIGNAL( stateChanged(int) ),
this, SLOT( onBuildAll() ) );
// connecting signals
selectSrcBtn->blockSignals( true );
selectBinBtn->blockSignals( true );
+ singleDirBtn->blockSignals( true );
int totSrc = 0, selSrc = 0;
MapProducts::Iterator itProd;
}
}
selectBinBtn->setState( selBin == 0 ? QButton::Off : ( selBin == totBin ? QButton::On : QButton::NoChange ) );
+ singleDirBtn->setEnabled( selectBinBtn->isEnabled() && selectBinBtn->isChecked() );
selectSrcBtn->blockSignals( false );
selectBinBtn->blockSignals( false );
+ singleDirBtn->blockSignals( false );
long tots = 0, temps = 0;
// ... product name - currently instaled product
shellProcess->addArgument( item->text(0) );
+ // ... flag to install single all SALOME binaries to one installation directory,
+ // if this option was selected
+ if ( singleDirBtn->isChecked() ) { // && productsMap[ item ].hasContext( "salome binaries" ) && productsView->isBinaries( item )
+ // add flag to install salome binaries to the same directory
+ shellProcess->addArgument( "1" );
+ }
+
// run script
if ( !shellProcess->start() ) {
// error handling can be here
script += QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() ) + " ";
script += QUOTE( QFileInfo( QDir::cleanDirPath( QDir::currentDirPath() + "/Products" ) ).absFilePath() ) + " ";
script += QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() ) + " ";
- script += depproducts + " ";
- script += item->text(0);
+ script += depproducts + " "; // dependencies
+ script += item->text(0) + " "; // product
+ if ( singleDirBtn->isChecked() ) // single directory flag
+ script += "1";
___MESSAGE___( "... --> " << script.latin1() );
if ( system( script.latin1() ) ) {
___MESSAGE___( "ERROR" );
productsView->blockSignals( false );
}
+// ================================================================
+/*!
+ * SALOME_InstallWizard::onInstallToSingle
+ * Install SALOME binaries to a single directory check box slot
+ */
+// ================================================================
+void SALOME_InstallWizard::onInstallToSingle()
+{
+}
+
// ================================================================
/*!
* SALOME_InstallWizard::onBuildAll
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef __SALOME_InstallWizard
#define __SALOME_InstallWizard
SALOME_InstallWizard(const QString& aXmlFileName,
const QString& aTargetDir = QString::null,
const QString& aTmpDir = QString::null,
- const bool aForceSrc = false);
+ const bool aForceSrc = false,
+ const bool aSingleDir = false);
// destructor
virtual ~SALOME_InstallWizard( );
// creates introduction page
void setupIntroPage();
// creates products page
- void setupProductsPage(const bool forceSrc = false);
+ void setupProductsPage(const bool forceSrc = false, const bool singleDir = false);
// creates directories page
void setupDirPage();
// creates prestart page
void onProdBtn();
// <More...> button slot
void onMoreBtn();
+ // <Install SALOME binaries to a single directory> check box
+ void onInstallToSingle();
// <Install all products from sources> check box
void onBuildAll();
QPushButton* unselectBtn; // <Unselect All> button
QWidget* lessBox; // container for the <Less...> mode widgets
QMyCheckBox* allFromSrcBtn; // <Install all products from sources> check box
+ QMyCheckBox* singleDirBtn; // <Install SALOME binaries to a single directory> check box
// --> prestart page
QWidget* prestartPage; // page itself
QTextEdit* choices; // choice text view
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "SALOME_ProductsView.hxx"
#include <qstringlist.h>
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef __SALOME_ProductsView
#define __SALOME_ProductsView
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "SALOME_ProgressView.hxx"
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef __SALOME_ProgressView
#define __SALOME_ProgressView
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "globals.h"
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef __SALOME_XmlHandler
#define __SALOME_XmlHandler
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#if !defined( ___GLOBALS )
#define ___GLOBALS
#define __IW_VERSION_MAJOR__ 1
#define __IW_VERSION_MINOR__ 0
-#define __IW_VERSION_PATCH__ 3
+#define __IW_VERSION_PATCH__ 4
#define __IW_VERSION__ (__IW_VERSION_MAJOR__*10000 + \
__IW_VERSION_MINOR__*100 + \
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "icons.h"
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#ifndef ___ICONS_h
#define ___ICONS_h
// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2002-2007 CEA
+// Copyright : 2002-2008 CEA
#include "globals.h"
bool has_target = false;
bool has_tmp = false;
bool force_src = false;
+ bool single_dir = false;
for( int i = 1; i < argc; i++ ) {
QString a = QString( argv[i] );
if ( a == "--version" || a == "-v" ) {
- printf("SALOME Installation Wizard version %d.%d.%d ",
+ printf("SALOME Installation Wizard version %d.%d.%d (Qt version %d.%d.%d)\n",
( __IW_VERSION__ / 10000 ),
( __IW_VERSION__ / 100 % 100 ),
- ( __IW_VERSION__ % 100 ) );
- printf("(Qt version %d.%d.%d)\n",
+ ( __IW_VERSION__ % 100 ),
( QT_VERSION >> 16 ) & 0xFF,
( QT_VERSION >> 8 ) & 0xFF,
( QT_VERSION ) & 0xFF );
+ printf("Copyright (C) 2002-2008 CEA\n");
return 0;
}
else if ( a == "--target" || a == "-d" ) {
else if ( a == "--all-from-sources" || a == "-a" ) {
force_src = true;
}
+ else if ( a == "--single-directory" || a == "-s" ) {
+ single_dir = true;
+ }
}
if ( has_xml && xmlFileName.isEmpty() ) {
printf("Please specify the configuration XML file!\n");
int result = -1;
QFile xmlfile(xmlFileName);
if ( xmlfile.exists() ) {
- SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath, force_src);
+ SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath, force_src, single_dir);
a.setMainWidget( &wizard );
wizard.show();
result = a.exec();