From: akl Date: Mon, 26 May 2008 05:44:12 +0000 (+0000) Subject: Fix problem when 'woguimode' key is equal to 'false'. X-Git-Tag: V4_1_3~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=33194d4559f463745b114d8577684e6c5cad6e8b;p=tools%2Finstall.git Fix problem when 'woguimode' key is equal to 'false'. --- diff --git a/bin/SALOME_InstallWizard b/bin/SALOME_InstallWizard index 7941547..a91cf1c 100755 Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index c5905e1..7387aff 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -1912,7 +1912,9 @@ void SALOME_InstallWizard::setPrerequisites( QCheckListItem* item ) // 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 @@ -1926,6 +1928,7 @@ void SALOME_InstallWizard::setPrerequisites( QCheckListItem* item ) itProd.key()->setOn( true ); itProd.key()->setEnabled( false ); } + break; } } } @@ -1976,6 +1979,7 @@ void SALOME_InstallWizard::unsetPrerequisites( QCheckListItem* item ) for ( int k = 0; k < (int)prereqsList.count(); k++ ) { if ( prereqsList[ k ] == itProd1.data().getName() ) { nbDependents++; + break; } } } @@ -1985,6 +1989,7 @@ void SALOME_InstallWizard::unsetPrerequisites( QCheckListItem* item ) itProd1.key()->setOn( false ); } } + break; } } } @@ -2088,11 +2093,11 @@ void SALOME_InstallWizard::launchScript() // ... 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() ) { @@ -2219,7 +2224,8 @@ void SALOME_InstallWizard::onInstallGuiBtn() } 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 ); } @@ -2467,13 +2473,13 @@ void SALOME_InstallWizard::pageChanged( const QString & mytitle) 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(); } } diff --git a/src/SALOME_InstallWizard.hxx b/src/SALOME_InstallWizard.hxx index 85eb75f..2c77abb 100644 --- a/src/SALOME_InstallWizard.hxx +++ b/src/SALOME_InstallWizard.hxx @@ -36,6 +36,8 @@ class QButtonGroup; // 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 @@ -57,7 +59,7 @@ class Dependancies 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 ), @@ -95,7 +97,7 @@ class Dependancies // 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 @@ -108,7 +110,7 @@ class Dependancies 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 }; /*! @@ -147,6 +149,7 @@ class Button typedef QMap MapProducts; typedef QValueList