88 |
andreas |
1 |
/***************************************************************************
|
232 |
andreas |
2 |
* Copyright (C) 2007 - 2009 by Andreas Theofilu *
|
119 |
andreas |
3 |
* andreas@theosys.at *
|
88 |
andreas |
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 3 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 *
|
|
|
16 |
* Free Software Foundation, Inc., *
|
|
|
17 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
18 |
***************************************************************************/
|
|
|
19 |
|
232 |
andreas |
20 |
/*
|
|
|
21 |
* Ported to KDE4 on Jul. 8 2009 by Andreas Theofilu.
|
|
|
22 |
*/
|
132 |
andreas |
23 |
#include "config.h"
|
245 |
andreas |
24 |
#include "sportwatcher.h"
|
|
|
25 |
#include <KApplication>
|
|
|
26 |
#include <KAboutData>
|
88 |
andreas |
27 |
#include <kcmdlineargs.h>
|
245 |
andreas |
28 |
#include <KLocale>
|
|
|
29 |
#include <k3mimesourcefactory.h>
|
119 |
andreas |
30 |
#include <kstandarddirs.h>
|
245 |
andreas |
31 |
#include <KIconLoader>
|
246 |
andreas |
32 |
#include <stdlib.h>
|
88 |
andreas |
33 |
|
132 |
andreas |
34 |
// #include <iostream.h>
|
|
|
35 |
extern KApplication *mapp;
|
|
|
36 |
KApplication *mapp;
|
119 |
andreas |
37 |
|
88 |
andreas |
38 |
static const char description[] =
|
245 |
andreas |
39 |
I18N_NOOP("Reading out the Garmin Forerunner over USB port.");
|
88 |
andreas |
40 |
|
132 |
andreas |
41 |
static const char version[] = VERSION;
|
88 |
andreas |
42 |
|
245 |
andreas |
43 |
int main(int argc, char *argv[])
|
88 |
andreas |
44 |
{
|
246 |
andreas |
45 |
#ifdef HAVE_GDAL
|
|
|
46 |
/*
|
|
|
47 |
* To make sure, we can draw a map, especialy if we use a WMS-server,
|
|
|
48 |
* we must make sure, that the environment variable LC_NUMERIC is set
|
|
|
49 |
* to C. Otherwise some functions may translate numbers into a localized
|
|
|
50 |
* version, who may not work.
|
|
|
51 |
* This is a known error of GDAL 1.5. Hopefully this is corrected with
|
|
|
52 |
* GDAL 1.6, to have numbers in the application shown correct.
|
|
|
53 |
*/
|
|
|
54 |
if (setenv ("LC_NUMERIC", "C", 1) == -1)
|
|
|
55 |
fprintf (stderr, "Error setting the environment variable \"LC_NUMERIC\"!");
|
|
|
56 |
#endif
|
245 |
andreas |
57 |
KAboutData about("sportwatcher", 0, ki18n("SportWatcher"), version, ki18n(description),
|
|
|
58 |
KAboutData::License_GPL_V3, ki18n("(C) 2007 - 2009 Andreas Theofilu"),
|
|
|
59 |
KLocalizedString(), "http://www.theosys.at", "andreas@theosys.at");
|
|
|
60 |
about.addAuthor( ki18n("Andreas Theofilu"), ki18n("Maintainer, Project Management, Developer"), "andreas@theosys.at" );
|
|
|
61 |
about.addCredit( ki18n("Dave Bailey"), KLocalizedString(), "dave@daveb.net");
|
|
|
62 |
about.setTranslator (ki18n("Andreas Theofilu"), ki18n("andreas@theosys.at"));
|
88 |
andreas |
63 |
|
|
|
64 |
KCmdLineArgs::init(argc, argv, &about);
|
245 |
andreas |
65 |
|
88 |
andreas |
66 |
KApplication app;
|
245 |
andreas |
67 |
sportwatcher *mainWin = new sportwatcher;
|
|
|
68 |
mainWin->show();
|
88 |
andreas |
69 |
|
132 |
andreas |
70 |
mapp = &app;
|
88 |
andreas |
71 |
// mainWin has WDestructiveClose flag by default, so it will delete itself.
|
|
|
72 |
return app.exec();
|
|
|
73 |
}
|
|
|
74 |
|