Subversion Repositories svn1

Rev

Rev 320 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
171 david 1
/*************************************************************************
2
*           Copyright (C) 1992 Embedded Solutions.
3
*                       All rights reserved
4
*
5
* file:         mara.c
6
*
7
* purpose:      Main entry point
8
*               Marathon program  program
9
*
10
* functions:
11
*       main                    - Main entry point
12
*       usage                   - Display general usage message
13
*       ms_system               - Temp escape to DOS
14
*       test_legal_version      - Test program version
15
*
16
*
17
* programmer: David Purdie (DDP)
18
*
19
* revision  date        by      reason
20
*           13-May-91   DDP     Added a nasty.
21
*                               This program will produce funny results if
22
*                               the system date is after 1-Jan-92.
23
*
24
*           25-Oct-91   DDP     Version 2.01 will not produce funny results
25
*
26
*   00.0    6-Nov-92    DDP     Ansified existing code
27
*   00.0    27/01/95    DDP     Tidies up the program and formatted the file
28
*
29
**************************************************************************/
30
#include    <QtGui/QApplication>
320 david 31
#include    <QMessageBox>
171 david 32
 
33
#include    <time.h>
34
#include    "consts.h"
35
#include    "structs.h"
36
#include    "proto.h"
37
 
38
#include    "qmconfteams.h"
39
#include    "mainwindow.h"
173 - 40
#include    "qmconfig.h"
177 - 41
#include    "qmteamdata.h"
171 david 42
 
43
#undef      DISPLAY_STRUCTURES
44
 
45
/*============================================================================
46
 *  Main entry point
47
 *
48
 *  Purpose:
49
 *      Main enrty point
50
 *      Load configuration file
51
 *      Locate data base
52
 *      Perform copyright stuff
53
 *      Process top level menu
54
 *
55
 *  Parameters:
56
 *      argc    - number of arguments
57
 *      argv    - pointer to first argument pointer
58
 *      
59
 *      
60
 *  Returns:
61
 *      program exit code
62
 *          0 - All is well
63
 *          1 -
64
 *          2 - 
65
 *
66
 *===========================================================================*/
67
 
68
int main( int argc, char *argv[] )
69
{
175 - 70
    QString       eventFile;
171 david 71
    QApplication a(argc, argv);
72
 
73
    /*
74
    **  Verify command arguments
75
    */
213 david 76
//    if( argc < 2 )
77
//        usage();
171 david 78
 
79
    /*
80
    **  Walk the user arguments and extract switches and file names
81
    */
82
    while( --argc )
83
    {
84
        argv++;
85
        if( argv[0][0] == '-' )
86
        {
87
            switch( argv[0][1] )
88
            {
89
                /*
90
                **  Unknown switch
91
                */
92
              default:
93
                usage();
94
            }
95
        }
96
        else
97
        {
98
            /*
99
            **  Parameter without a switch
100
            **  Must be the input file name
101
            */
175 - 102
            if( !eventFile.isEmpty() )                   /* Already defined */
171 david 103
            {
104
                qWarning("Mutiple input files found");
105
            }
175 - 106
            eventFile = argv[0];
171 david 107
        }
108
    }
109
 
176 - 110
    config.load(eventFile);
177 - 111
    QmTeamData  teamDataReader;
112
    teamDataReader.initTeamData(NULL);
173 - 113
 
171 david 114
    MainWindow w;
115
    w.show();
116
 
117
    MainWindow::showMessage ("Mara Started", 5000);
118
    return a.exec();
119
  }
120
 
121
/*============================================================================
122
 *
123
 *  Display general usage message
124
 *
125
 *  Purpose:
126
 *      Display general usage message
127
 *      Used on command line syntax error
128
 *      
129
 *  Parameters:
130
 *      None
131
 *      
132
 *  Returns:
133
 *      exit code 3
134
 *      
135
 *===========================================================================*/
136
 
137
void usage(void)
138
{
213 david 139
    QMessageBox::question ( 0, "Usage",
140
                           "mara [options] config_file\n"
141
                           "Options are:\n"
142
                           "    No options yet",
143
                           QMessageBox::Ok
144
                           );
171 david 145
    exit( 3 );
146
}
147
 
148
 
149
 
150
/********************************* EOF ***********************************/
151