src/main.cpp

Wed, 17 Jul 2013 03:06:21 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 17 Jul 2013 03:06:21 +0300
changeset 5
3c04e05ab24f
parent 3
d0b278fd29d5
child 6
67b6ef6917ba
permissions
-rw-r--r--

Added configs for Zandronum binary paths

1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
1 #include <QApplication>
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
2 #include <QSettings>
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
3 #include "types.h"
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
4 #include "config.h"
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
6 const list<str> g_zanVersions ({
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
7 "1.1",
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
8 });
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
9
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
10 // =============================================================================
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
11 // -----------------------------------------------------------------------------
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
12 int main( int argc, char* argv[] ) {
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
13 QApplication app( argc, argv );
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
14 app.setApplicationName( UNIXNAME );
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
15 app.setOrganizationName( UNIXNAME );
3
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
16 app.setApplicationVersion( versionString() );
d0b278fd29d5 Implemented wad path list
Teemu Piippo <crimsondusk64@gmail.com>
parents: 2
diff changeset
17
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
18 print( "Settings path: %1\n", QSettings().fileName() );
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
19
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
20 for( int i = 1; i < argc; ++i ) {
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
21 str arg = argv[i];
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
22
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
23 if( arg == "--config" ) {
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
24 ConfigBox dlg;
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
25 return dlg.exec();
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
26 }
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
27 }
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
28
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
29 return app.exec();
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 }
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
32 // =============================================================================
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
33 // -----------------------------------------------------------------------------
5
3c04e05ab24f Added configs for Zandronum binary paths
Teemu Piippo <crimsondusk64@gmail.com>
parents: 3
diff changeset
34 str versionString() {
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36 #if VERSION_PATCH != 0
1
c9b22c06307c Done config box base
Teemu Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
37 text += fmt( ".%1", VERSION_PATCH );
0
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38 #endif
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 #if BUILD_ID == BUILD_INTERNAL
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 text += "-intern";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 #elif BUILD_ID == BUILD_ALPHA
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43 text += "-alpha";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
44 #elif BUILD_ID == BUILD_BETA
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
45 text += "-beta";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
46 #elif BUILD_ID == BUILD_RC
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
47 text += fmt( "-rc%1", RC_ID );
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
48 #elif BUILD_ID == BUILD_RELEASE
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
49 text += "-rel";
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50 #else
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
51 # error Invalid build code!
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
52 #endif // BUILD_ID
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
53
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
54 return text;
bb264814dd81 Initial commit
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
55 }

mercurial