X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cxx;h=1d1b8d67b7cfe97babdd437a525c05b6e6da753c;hb=befca22392c26f7d479f1913c8cff0fe0422a536;hp=15ae14ffcab666c2477d568d915912ac831eb02f;hpb=9fc2bfc009ddf32fb0f20cfcf7151b79aec3f62d;p=tools%2Finstall.git diff --git a/src/main.cxx b/src/main.cxx index 15ae14f..1d1b8d6 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -55,7 +55,6 @@ int main( int argc, char **argv ) bool has_xml = false; bool has_target = false; bool has_tmp = false; - bool force_src = false; for( int i = 1; i < argc; i++ ) { QString a = QString( argv[i] ); if ( a == "--version" || a == "-v" ) { @@ -76,7 +75,7 @@ int main( int argc, char **argv ) i++; } else { - tmpDirPath = QString::null; + targetDirPath = QString::null; } } else if ( a == "--tmp" || a == "-t" ) { @@ -99,9 +98,6 @@ int main( int argc, char **argv ) xmlFileName = QString::null; } } - else if ( a == "--all-from-sources" || a == "-a" ) { - force_src = true; - } } if ( has_xml && xmlFileName.isEmpty() ) { printf("Please specify the configuration XML file!\n"); @@ -116,28 +112,24 @@ int main( int argc, char **argv ) return 1; } - if ( xmlFileName.isEmpty() ) - xmlFileName = "config.xml"; - QApplication a( argc, argv ); a.setFont( QFont( "Sans", 12 ) ); - int result = -1; - QFile xmlfile(xmlFileName); - if ( xmlfile.exists() ) { - SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath, force_src); - a.setMainWidget( &wizard ); - wizard.show(); - result = a.exec(); - } - else { - QMessageBox::critical( 0, - QObject::tr( "Error" ), - QObject::tr( "Can't open config file:\n%1\n\nQuitting...").arg( xmlFileName ), - QMessageBox::Ok, - QMessageBox::NoButton, - QMessageBox::NoButton ); + if ( has_xml ) { + QFile xmlfile(xmlFileName); + if ( !xmlfile.exists() ) { + QMessageBox::critical( 0, + QObject::tr( "Error" ), + QObject::tr( "Can't open config file:\n%1\n\nQuitting...").arg( xmlFileName ), + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton ); + return -1; + } } - return result; + SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath); + a.setMainWidget( &wizard ); + wizard.show(); + return a.exec(); }