// get all prerequisites
QStringList dependOn = productsMap[ item ].getDependancies();
// install SALOME without GUI case
- if ( installGuiBtn->state() != QButton::On && woGuiModules.contains( item->text(0) ) != 0 ) {
+ if ( installGuiBtn->state() != QButton::On &&
+ woGuiModules.find( item->text(0) ) != woGuiModules.end() &&
+ woGuiModules[item->text(0)] == True ) {
dependOn.remove( "GUI" );
}
// setting prerequisites
itProd.key()->setOn( true );
itProd.key()->setEnabled( false );
}
+ break;
}
}
}
for ( int k = 0; k < (int)prereqsList.count(); k++ ) {
if ( prereqsList[ k ] == itProd1.data().getName() ) {
nbDependents++;
+ break;
}
}
}
itProd1.key()->setOn( false );
}
}
+ break;
}
}
}
// ... binaries directory
shellProcess->addArgument( binDir );
// ... install SALOME with GUI or not?
- if ( woGuiModules.contains( prodProc ) != 0 ) {
- if ( installGuiBtn->state() != QButton::On )
- shellProcess->addArgument( "FALSE" );
- else
- shellProcess->addArgument( "TRUE" );
+ if ( installGuiBtn->state() != QButton::On ) {
+ if ( woGuiModules.find( prodProc ) != woGuiModules.end() )
+ woGuiModules[ prodProc ] == True ?
+ shellProcess->addArgument( "FALSE" ) :
+ shellProcess->addArgument( "TRUE" );
}
// ... single installation directory for SALOME modules, if this option was selected
if ( oneModDirBtn->isChecked() ) {
}
else {
QString itemName = itProd.data().getName();
- if ( woGuiModules.contains( itemName ) == 0 ) {
+ if ( woGuiModules.find( itemName ) == woGuiModules.end() ||
+ woGuiModules[ itemName ] == False ) {
itProd.key()->setOn( false );
itProd.key()->setEnabled( false );
}
if ( tempFolder->text().isEmpty() )
parser->setTempDir( tempFolder );
parser->readXmlFile( xmlFileName );
- // create a list of SALOME modules, that support installation without GUI mode
+ // create a map of SALOME modules names, that can support installation without GUI mode
if ( woGuiModules.isEmpty() ) {
MapProducts::Iterator mapIter;
for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); mapIter++ ) {
Dependancies dep = mapIter.data();
- if ( dep.supportWoGuiMode() )
- woGuiModules.append( dep.getName() );
+ if ( dep.getType() == "component" && dep.supportWoGuiMode() != NotDefined )
+ woGuiModules[ dep.getName() ] = dep.supportWoGuiMode();
}
}
// This enum describes the possible types of the SALOME installation
enum InstallationType { Binaries, Sources, Compile };
+// This enum describes the possible states of a tristate parameter
+enum BoolTristate { False, True, NotDefined };
/*!
Class Dependancies : Products info
const QString& descr = QString::null,
const QString& tp = QString::null,
bool pickup = false,
- bool woGui = false )
+ BoolTristate woGui = NotDefined )
: smbName( name ),
dependsOn( depend ),
sizeBinaryTotal( Binsize ),
// returns true if this product needs to pick-up environment
bool pickUpEnvironment() { return pickupEnv; }
// returns true if this product supports installation without GUI mode
- bool supportWoGuiMode() { return woGuiMode; }
+ BoolTristate supportWoGuiMode() { return woGuiMode; }
private:
QString smbName; // symbolic name
QString description; // product's description
QString type; // product's type (salome sources, binaries or prerequisite)
bool pickupEnv; // "Pick-up environment" flag
- bool woGuiMode; // support of installation without GUI flag
+ BoolTristate woGuiMode; // support of installation without GUI flag
};
/*!
typedef QMap<QCheckListItem*, Dependancies> MapProducts;
typedef QValueList<Button> ButtonList;
typedef QMap<QString, QString> MapXmlFiles;
+typedef QMap<QString, BoolTristate> MapAttrStates;
/*!
Class SALOME_InstallWizard : Installation Wizard's main window
QStringList toInstall; // list of products being installed
QStringList notInstall; // list of products being not installed
QStringList prodSequence; // specified list of products being installed
- QStringList woGuiModules; // list of SALOME modules, that support installation without GUI mode
+ MapAttrStates woGuiModules; // map of SALOME modules names, that can support installation without GUI mode
InstallationType installType; // type of the installation
QString curPlatform; // current operating system
QString refPlatform; // referenced operating system (selected by user). It is defined,
if ( instElem.attribute( "os" ) != myWizard->getPlatform() && instElem.attribute( "os" ) != "all" )
continue;
if ( isBoolAttributeSet( instElem.attribute( "disable" ) ) )
- break; // current product is skip
+ break; // current product is skipped
QDomElement prodElem = prodNode.toElement();
QStringList diskspace = QStringList::split( ",", instElem.attribute( "installdiskspace" ) );
QString name = prodElem.attribute( "name" ).stripWhiteSpace();
QString type = prodElem.attribute( "type" ).stripWhiteSpace().lower();
+ BoolTristate woGuiMode = NotDefined;
bool pickUp = isBoolAttributeSet( instElem.attribute( "pickupenv" ) );
- bool woGuiMode = isBoolAttributeSet( instElem.attribute( "woguimode" ) );
QString script = instElem.attribute( "script" );
QStringList typesList = QStringList::split( ",", type );
- if ( typesList.find( "component" ) != typesList.end() )
+ if ( typesList.find( "component" ) != typesList.end() ) {
+ QString woGuiAttr = instElem.attribute( "woguimode" );
+ if ( !woGuiAttr.isNull() )
+ woGuiMode = BoolTristate( isBoolAttributeSet( woGuiAttr ) );
element = myModules->addItem( name,
"unknown",
script );
+ }
else
element = myPrereqs->addItem( name,
"unknown",