]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/app.cpp
Added logfile logging, ZIP file fishing
[virtualjaguar] / src / gui / app.cpp
1 //
2 // app.cpp - Qt-based GUI for Virtual Jaguar
3 //
4 // by James L. Hammons
5 // (C) 2010 Underground Software
6 //
7 // JLH = James L. Hammons <jlhamm@acm.org>
8 //
9 // Who  When        What
10 // ---  ----------  -------------------------------------------------------------
11 // JLH  12/23/2009  Created this file
12 //
13
14 #include "app.h"
15
16 #include <QApplication>
17 #include "log.h"
18 #include "mainwin.h"
19 #include "types.h"
20
21 // Here's the main application loop--short and simple...
22 int main(int argc, char * argv[])
23 {
24         if (argc > 1)
25         {
26                 if (strcmp(argv[1], "--help") == 0)
27                 {
28                         printf("Virtual Jaguar 2.0.0 help\n");
29                         printf("\n");
30                         printf("This is an experimental branch of Virtual Jaguar, how did you get it?\n");
31                         return 0;
32                 }
33         }
34
35         Q_INIT_RESOURCE(vj);    // This must the same name as the exe filename
36 //or is it the .qrc filename???
37         // This is so we can pass this stuff using signal/slot mechanism...
38 //ick   int id = qRegisterMetaType<uint32>();
39
40         LogInit("vj.log");                                                      // Init logfile
41         App app(argc, argv);                                            // Declare an instance of the application
42
43         int retVal = app.exec();                                        // And run it!
44         LogDone();                                                                      // Close logfile
45         return retVal;
46 }
47
48 // Main app constructor--we stick globally accessible stuff here...
49
50 App::App(int argc, char * argv[]): QApplication(argc, argv)
51 {
52         mainWindow = new MainWin();
53         mainWindow->show();
54 }