Wed, 17 Jul 2013 01:55:18 +0300
SEPARATORS
1 | 1 | #include <QApplication> |
3
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
2 | #include <QSettings> |
0 | 3 | #include "types.h" |
1 | 4 | #include "config.h" |
0 | 5 | |
3
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
6 | QSettings* cfg; |
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
7 | |
1 | 8 | // ============================================================================= |
9 | // ----------------------------------------------------------------------------- | |
10 | int main( int argc, char* argv[] ) { | |
11 | QApplication app( argc, argv ); | |
3
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
12 | app.setApplicationName( APPNAME ); |
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
13 | app.setApplicationVersion( versionString() ); |
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
14 | |
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
15 | QSettings settings; |
d0b278fd29d5
Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents:
2
diff
changeset
|
16 | cfg = &settings; |
1 | 17 | |
18 | for( int i = 1; i < argc; ++i ) { | |
19 | str arg = argv[i]; | |
20 | ||
21 | if( arg == "--config" ) { | |
22 | ConfigBox* dlg = new ConfigBox; | |
23 | dlg->show(); | |
24 | } | |
25 | } | |
26 | ||
2 | 27 | print( "Hello world! This is " APPNAME " %1\n", versionString() ); |
1 | 28 | return app.exec(); |
0 | 29 | } |
30 | ||
1 | 31 | // ============================================================================= |
32 | // ----------------------------------------------------------------------------- | |
0 | 33 | QString versionString() { |
34 | str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR ); | |
35 | #if VERSION_PATCH != 0 | |
1 | 36 | text += fmt( ".%1", VERSION_PATCH ); |
0 | 37 | #endif |
38 | ||
39 | #if BUILD_ID == BUILD_INTERNAL | |
40 | text += "-intern"; | |
41 | #elif BUILD_ID == BUILD_ALPHA | |
42 | text += "-alpha"; | |
43 | #elif BUILD_ID == BUILD_BETA | |
44 | text += "-beta"; | |
45 | #elif BUILD_ID == BUILD_RC | |
46 | text += fmt( "-rc%1", RC_ID ); | |
47 | #elif BUILD_ID == BUILD_RELEASE | |
48 | text += "-rel"; | |
49 | #else | |
50 | # error Invalid build code! | |
51 | #endif // BUILD_ID | |
52 | ||
53 | return text; | |
54 | } |