X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cxx;h=f856ec49c5b66b7be3d791bec9de65a2a8643023;hb=ee2af37feace0ee0ddc554d0cf3feba51e078616;hp=15ae14ffcab666c2477d568d915912ac831eb02f;hpb=9fc2bfc009ddf32fb0f20cfcf7151b79aec3f62d;p=tools%2Finstall.git diff --git a/src/main.cxx b/src/main.cxx index 15ae14f..f856ec4 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -3,7 +3,7 @@ // Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) // Project : SALOME // Module : Installation Wizard -// Copyright : 2002-2007 CEA +// Copyright : 2002-2015 CEA #include "globals.h" @@ -56,17 +56,18 @@ int main( int argc, char **argv ) 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-2015 CEA\n"); return 0; } else if ( a == "--target" || a == "-d" ) { @@ -76,7 +77,7 @@ int main( int argc, char **argv ) i++; } else { - tmpDirPath = QString::null; + targetDirPath = QString::null; } } else if ( a == "--tmp" || a == "-t" ) { @@ -102,6 +103,9 @@ int main( int argc, char **argv ) 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"); @@ -116,28 +120,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, force_src, single_dir); + a.setMainWidget( &wizard ); + wizard.show(); + return a.exec(); }