author | nemo |
Fri, 11 May 2012 16:09:11 -0400 | |
changeset 7064 | 0cf7cad767aa |
parent 6952 | 7f70f37bbf08 |
child 8610 | 6d6b5b529890 |
permissions | -rw-r--r-- |
5252 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
6952 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
5252 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#include "HWApplication.h" |
|
20 |
#include <QFileOpenEvent> |
|
21 |
||
22 |
#include "hwform.h" |
|
23 |
||
5257 | 24 |
HWApplication::HWApplication(int &argc, char **argv): |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
5257
diff
changeset
|
25 |
QApplication(argc, argv) |
5252 | 26 |
{ |
27 |
||
28 |
} |
|
29 |
||
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
5257
diff
changeset
|
30 |
bool HWApplication::event(QEvent *event) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
5257
diff
changeset
|
31 |
{ |
5252 | 32 |
QFileOpenEvent *openEvent; |
5255
947025eeb5dc
under osx don't load a file in case a game is already running (also a little of code formatting)
koda
parents:
5252
diff
changeset
|
33 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
5257
diff
changeset
|
34 |
switch (event->type()) |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
5257
diff
changeset
|
35 |
{ |
5252 | 36 |
case QEvent::FileOpen: |
37 |
openEvent = (QFileOpenEvent *)event; |
|
5255
947025eeb5dc
under osx don't load a file in case a game is already running (also a little of code formatting)
koda
parents:
5252
diff
changeset
|
38 |
if (form) form->PlayDemoQuick(openEvent->file()); |
5252 | 39 |
return true; |
40 |
break; |
|
41 |
default: |
|
42 |
return QApplication::event(event); |
|
43 |
break; |
|
44 |
} |
|
45 |
} |
|
46 |
||
47 |