-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
136 lines (115 loc) · 5.23 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*****************************************************************************
* ____ ____ _ _ _ *
* /# /_\_ | _ \ (_) __| | (_) ___ _ __ *
* | |/o\o\ | | | | | | / _` | | | / _ \ | '__| *
* | \\_/_/ | |_| | | | | (_| | | | | __/ | | *
* / |_ | |____/ |_| \__,_| |_| \___| |_| *
* | ||\_ ~| *
* | ||| \/ *
* | ||| Project : KFreeFlight : a KDE4 GUI frontend for FlightGear *
* \// | *
* || | Developper : Didier FABERT <didier.fabert@gmail.com> *
* ||_ \ Date : 2009, April *
* \_| o| ,__, *
* \___/ Copyright (C) 2009 by didier fabert (oo)____ *
* ||||__ (__) )\ *
* (___)_) File : main.cpp ||--|| * *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
*****************************************************************************/
#include "config.h"
#include "kfreeflight.h"
#include "kfreeflightview.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <KDE/KLocale>
#include <iostream>
static const char description[] =
I18N_NOOP( "A FlightGear GUI-frontend designed for KDE4 user" );
static const char version[] = KFREEFLIGHT_VERSION;
static const char homepage[] = "http://kfreeflight.sourceforge.net";
int main( int argc, char **argv )
{
KAboutData * m_about;
m_about = new KAboutData( "kfreeflight", 0,
ki18n( "kfreeflight" ),
version,
ki18n( description ),
KAboutData::License_GPL,
ki18n( "(C) 2009 Didier Fabert" ),
KLocalizedString(),
homepage,
"didier.fabert@gmail.com" );
m_about->addAuthor( ki18n( "Didier Fabert" ),
ki18n( "Project manager and main developer" ),
"didier.fabert@gmail.com" );
m_about->addAuthor( ki18n( "Peter Morgan" ),
ki18n( "Hacker for FreeFlightSim.org" ),
"pedromorgan@gmail.com" );
m_about->addCredit( ki18n( "Gerard Robin" ),
ki18n( "Main Beta testeur and 3D modeler" ),
"ghrobin@laposte.net",
"http://perso.orange.fr/GRTux" );
m_about->addCredit( ki18n( "Andrea Sciucca" ),
ki18n( "Italian translation (application) and Slackware package" ),
"gohanz@infinito.it" );
m_about->addCredit( ki18n( "Mauro Toffanin" ),
ki18n( "Gentoo ebuild maker" ),
"info@wiredtek.info" );
m_about->addCredit( ki18n( "Fanta" ),
ki18n( "German translation (application and website)" ),
"fanta23@gmail.com" );
/*m_about->addCredit( ki18n( "Martin Bantz" ),
ki18n( "Danish translation (application)" ),
"martin.bantz@gmail.com" );*/
KCmdLineArgs::init( argc, argv, m_about );
KCmdLineOptions options;
options.add( "+[PROFILE]", ki18n( "Profile to open" ) );
options.add( "no-airport", ki18n( "Do not load airport list" ) );
options.add( "no-carrier", ki18n( "Do not make carrier list" ) );
options.add("d").add( "debug", ki18n( "Do not launch programs, see only the command line" ) );
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
KFreeFlight *widget = new KFreeFlight;
int fl = KFreeFlightView::DEFAULT;
// see if we are starting with session management
if ( app.isSessionRestored() )
{
RESTORE( KFreeFlight );
}
else
{
// no session.. just start up normally
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (!args->isSet("-carrier"))
{
fl += KFreeFlightView::DISABLE_CARIER;
}
if (!args->isSet("-airport"))
{
fl += KFreeFlightView::DISABLE_AIRPORT;
}
if (args->isSet("debug"))
{
fl += KFreeFlightView::DEBUG_ONLY;
}
if ( args->count() == 1 )
{
widget->setProfile( args->arg(0) );
}
widget->setFlag( fl );
widget->hide();
widget->loadSettings();
args->clear();
}
return app.exec();
}