// File : main.cxx
// Created : Thu Dec 18 12:01:00 2002
-// Author : Vadim SANDLER
+// Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
// Project : SALOME
// Module : Installation Wizard
-// Copyright : 2004-2005 CEA
+// Copyright : 2002-2007 CEA
#include "globals.h"
i++;
}
else {
- tmpDirPath = QString::null;
+ targetDirPath = QString::null;
}
}
else if ( a == "--tmp" || a == "-t" ) {
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();
}