X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cxx;h=1d1b8d67b7cfe97babdd437a525c05b6e6da753c;hb=7f20464cbfdbb123c2880002895cdbb454e63fbf;hp=d759c9fa5655321644a0cd66379b15d2912c4e42;hpb=70c860ea96eefb14a96e8bbd13919c9e11759966;p=tools%2Finstall.git diff --git a/src/main.cxx b/src/main.cxx index d759c9f..1d1b8d6 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-2006 CEA +// Copyright : 2002-2007 CEA #include "globals.h" @@ -75,7 +75,7 @@ int main( int argc, char **argv ) i++; } else { - tmpDirPath = QString::null; + targetDirPath = QString::null; } } else if ( a == "--tmp" || a == "-t" ) { @@ -112,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); - 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(); }