]> SALOME platform Git repositories - tools/install.git/blob - src/main.cxx
Salome HOME
Use OpenCASCADE 5.2
[tools/install.git] / src / main.cxx
1 //  File      : main.cxx 
2 //  Created   : Thu Dec 18 12:01:00 2002
3 //  Author    : Vadim SANDLER
4 //  Project   : PAL/SALOME
5 //  Module    : InstallWizard
6 //  Copyright : 2004 CEA
7 //  $Header$ 
8
9 #include "SALOME_InstallWizard.hxx"
10 #include <qapplication.h>
11 #include <qfile.h>
12 #include <qmessagebox.h>
13
14 // ================================================================
15 /*!
16  *  main
17  *  Program starts here
18  */
19 // ================================================================
20 int main( int argc, char **argv )
21 {
22   QApplication a( argc, argv );
23   QString xmlFileName( argc == 2 ? argv[1] : "config.xml" );
24   
25   int result = -1;
26   QFile xmlfile(xmlFileName);
27   if ( xmlfile.exists() ) {
28     SALOME_InstallWizard wizard(xmlFileName);
29     a.setMainWidget( &wizard );
30     wizard.show();
31     result = a.exec();
32   }
33   else {
34     QMessageBox::critical( 0, 
35                            QObject::tr( "Error" ), 
36                            QObject::tr( "Can't open config file:\n%1\n\nQuitting...").arg( xmlFileName ), 
37                            QMessageBox::Ok,
38                            QMessageBox::NoButton, 
39                            QMessageBox::NoButton );
40   }
41   return result;
42 }
43