1/* main.cpp
2
3 Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de)
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; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 */
20
21
22#include "toplevel.h"
23
24#include <kapplication.h>
25#include <klocale.h>
26#include <kcmdlineargs.h>
27#include <kaboutdata.h>
28#include <kglobal.h>
29#include <kmessagebox.h>
30#include <qtimer.h>
31
32#include "levelset.h"
33
34
35static const char description[] =
36 I18N_NOOP("KDE Atomic Entertainment Game");
37
38static const char version[] = "3.0";
39
40// ##########################
41// # Main #
42// ##########################
43
44int main(int argc, char **argv)
45{
46 KAboutData aboutData( "katomic", 0, ki18n("KAtomic"),
47 version, ki18n(description), KAboutData::License_GPL,
48 ki18n("(c) 1998, Andreas Wuest\n(c) 2007-2009 Dmitry Suzdalev"), KLocalizedString(), "http://games.kde.org/katomic" );
49 aboutData.addAuthor(ki18n("Andreas Wuest"), ki18n("Original author"), "AndreasWuest@gmx.de");
50 aboutData.addAuthor(ki18n("Dmitry Suzdalev"), ki18n("Porting to KDE4. Current maintainer"), "dimsuz@gmail.com");
51 aboutData.addAuthor(ki18n("Stephan Kulow"), KLocalizedString(), "coolo@kde.org");
52 aboutData.addAuthor(ki18n("Cristian Tibirna"), KLocalizedString(), "tibirna@kde.org");
53 aboutData.addCredit(ki18n("Carsten Pfeiffer"), KLocalizedString(), "pfeiffer@kde.org");
54 aboutData.addCredit(ki18n("Dave Corrie"), KLocalizedString(), "kde@davecorrie.com");
55 aboutData.addCredit(ki18n("Kai Jung"), ki18n("6 new levels"), "jung@fh-fresenius.de");
56 aboutData.addCredit(ki18n("Danny Allen"), ki18n("Game graphics and application icon"), "danny@dannyallen.co.uk");
57 aboutData.addCredit(ki18n("Johann Ollivier Lapeyre"), ki18n("New great SVG artwork for KDE4"), "johann.ollivierlapeyre@gmail.com");
58 aboutData.addCredit(ki18n("Brian Croom"), ki18n("Port to use KGameRenderer"), "brian.s.croom@gmail.com");
59
60 KCmdLineArgs::init( argc, argv, &aboutData );
61
62 KCmdLineOptions options;
63 options.add("hackmode", ki18n( "Enable access to all levels" ));
64 KCmdLineArgs::addCmdLineOptions( options );
65
66 KApplication a;
67 KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
68
69 if (!LevelSet::isDefaultLevelsAvailable())
70 {
71 KMessageBox::error(0, i18n("KAtomic failed to find its default level set and will quit. Please check your installation."));
72 QTimer::singleShot(0, &a, SLOT(quit()));
73 }
74 else
75 {
76 if ( a.isSessionRestored() )
77 RESTORE(AtomTopLevel)
78 else {
79 AtomTopLevel *top = new AtomTopLevel;
80 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
81 if ( args->isSet( "hackmode" ) )
82 top->enableHackMode();
83 args->clear();
84 top->show();
85 }
86 }
87
88 return a.exec();
89}
90
91