srcPath = QDir::currentDirPath() + "/Products/SOURCES";
oneProdDirName = "PRODUCTS";
- singleBinPlts << "Red Hat 8.0"
- << "Red Hat 9"
- << "Debian 3.1"
- << "Debian 4.0"
- << "Debian 4.0 64bit"
- << "Mandrake 10.1"
- << "Mandriva 2006.0"
- << "Mandriva 2006.0 64bit"
- << "Mandriva 2007.0"
- << "Mandriva 2008.0"
- << "Mandriva 2008.0 64bit"
- << "Red Hat Enterprise WS 4"
- << "Scientific SL 4.2"
- << "Scientific SL 4.3";
commonPlatform = "Debian 3.1";
//
curPlatform = currentPlatform().join(" ");
// cout << "curOS = " << curPlatform << endl;
// curPlatform = "";
+ refPlatform = "";
// ... check XML and platform definition
getXmlAndPlatform();
QString SALOME_InstallWizard::getBasePlatform()
{
QString aBasePlt = "";
- if ( singleBinPlts.contains(curPlatform) )
+ if ( platformsMap.find( curPlatform ) != platformsMap.end() )
aBasePlt = curPlatform;
else
aBasePlt = commonPlatform;
if ( !curPlatform.isEmpty() ) {
// try to get XML file for current platform
if ( xmlMap.find( curPlatform ) != xmlMap.end() ) {
- xmlFileName = xmlMap[ getBasePlatform() ];
- QFileInfo fibp( getPlatformBinPath( getBasePlatform() ) );
+ xmlFileName = xmlMap[ curPlatform ];
+ QFileInfo fibp( getPlatformBinPath( curPlatform ) );
if ( !fibp.isDir() ) {
warnMsg = tr( "Binaries are absent for current platform" );
}
if ( installType == Binaries ) { // 'Binary' installation type
// check binaries directory
QFileInfo fib( QDir::cleanDirPath( getBinPath() ) );
- if ( !fib.exists() ) {
+ if ( !fib.isDir() ) {
QMessageBox::warning( this,
tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
}
else {
// Supported platform case
- QString aPlatform = curPlatform;
- if ( curPlatform != getBasePlatform() ) {
- refPlatform = getBasePlatform();
- xmlFileName = platformsMap[ refPlatform ];
- aPlatform = getPlatform();
- }
- QFileInfo fibp( getPlatformBinPath( aPlatform ) );
+ QFileInfo fibp( getPlatformBinPath( curPlatform ) );
if ( !fibp.isDir() ) {
warnLab->setText( tr( "Binaries are absent for current platform." ) );
this->setAppropriate( platformsPage, true );
// check sources directory
QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
- if ( !fis.exists() )
+ if ( !fis.isDir() )
if ( QMessageBox::warning( this,
tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
else { // 'Source' or 'Compile' installation type
// check sources directory
QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
- if ( !fis.exists() ) {
+ if ( !fis.isDir() ) {
QMessageBox::warning( this,
tr( "Warning" ),
tr( "The directory %1 doesn't exist.\n"
QMessageBox::NoButton );
return false;
}
+ else if ( !QDir( fis.filePath(), "*.tar.gz" ).count() ) {
+ QMessageBox::warning( this,
+ tr( "Warning" ),
+ tr( "The directory %1 doesn't contain source archives.\n" ).arg( fis.absFilePath() ),
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton );
+ return false;
+ }
if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
QString aMsg = warnMsg + ".";
if ( installType == Compile )
return false;
}
QFileInfo fi( QDir::cleanDirPath( targetDir ) );
- if ( !fi.exists() ) {
+ if ( !fi.isDir() ) {
bool toCreate =
QMessageBox::warning( this,
tr( "Warning" ),
// ... get folder with binaries
QString OS = getPlatform();
- if ( refPlatform.isEmpty() && singleBinPlts.contains(curPlatform) == 0 )
+ if ( refPlatform.isEmpty() && platformsMap.find( curPlatform ) == platformsMap.end() )
OS = commonPlatform;
QString binDir = getPlatformBinPath( OS );
// ... temp folder
if ( buttonGrp->id( buttonGrp->selected() ) == -1 )
// set default installation type
forceSrc ? srcCompileBtn->animateClick() : binBtn->animateClick();
+ else
+ buttonGrp->selected()->animateClick();
}
else if ( aPage == platformsPage ) {
// installation platforms page
QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
rb->setEnabled( fis.exists() );
}
- rb->setChecked( rb->isChecked() && rb->isEnabled() );
+// rb->setChecked( rb->isChecked() && rb->isEnabled() );
+ if ( rb->isChecked() && rb->isEnabled() )
+ rb->animateClick();
}
setNextEnabled( platformsPage, platBtnGrp->id( platBtnGrp->selected() ) != -1 );
}
removeSrcBtn->setEnabled( installType == Compile );
oneModDirBtn->setEnabled( installType == Binaries /*|| installType == Compile*/ );
oneProdDirBtn->setEnabled( installType == Binaries || installType == Compile );
+ refPlatform = "";
+ xmlFileName = getXmlFile( curPlatform );
}
else if ( aPage == platformsPage ) {
refPlatform = platBtnGrp->find( rbIndex )->name();
- xmlFileName = platformsMap[ refPlatform ];
+ xmlFileName = getXmlFile( refPlatform );
setNextEnabled( platformsPage, true );
}
if ( prevType != installType ||