SVN_SILENT: minor refactoring
[kdegames.git] / knetwalk / src / main.cpp
blob194f2b9d37ae1d967776c498ac433e03ee2c2870
1 /*
2 Copyright 2005 Thomas Nagy <tnagyemail-mail@yahoo.fr>
3 Copyright 2007-2008 Fela Winkelmolen <fela.kde@gmail.com>
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.
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.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <KApplication>
20 #include <KAboutData>
21 #include <KCmdLineArgs>
22 #include <KLocale>
23 #include <KDebug>
24 #include <KHighscore>
25 #include <KGlobal>
27 #include "settings.h"
28 #include "mainwindow.h"
30 static const char description[] =
31 I18N_NOOP("KNetWalk, a game for system administrators.");
33 static const char version[] = "2.5.0";
35 int main(int argc, char ** argv)
37 KAboutData about("knetwalk", 0, ki18n("KNetWalk"), version,
38 ki18n(description), KAboutData::License_GPL,
39 ki18n("(C) 2004-2005 Andi Peredri, ported to KDE by Thomas Nagy\n"
40 "(C) 2007-2008 Fela Winkelmolen"));
42 about.addAuthor(ki18n("Fela Winkelmolen"),
43 ki18n("current maintainer"),
44 "fela.kde@gmail.com");
46 about.addAuthor(ki18n("Andi Peredri"),
47 ki18n("original author"),
48 "andi@ukr.net");
50 about.addAuthor(ki18n("Thomas Nagy"),
51 ki18n("KDE port"),
52 "tnagy2^8@yahoo.fr");
54 KCmdLineArgs::init(argc, argv, &about);
56 KCmdLineOptions options;
57 options.add("Easy", ki18n("Start with Easy difficulty level"));
58 options.add("Medium", ki18n("Start with Medium difficulty level"));
59 options.add("Hard", ki18n("Start with Hard difficulty level"));
60 options.add("VeryHard", ki18n("Start with Very Hard difficulty level"));
61 KCmdLineArgs::addCmdLineOptions(options);
63 KApplication application;
64 KGlobal::locale()->insertCatalog("libkdegames");
66 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
67 if (args->isSet("Easy")) {
68 Settings::setSkill(Settings::EnumSkill::Easy);
70 if (args->isSet("Medium")) {
71 Settings::setSkill(Settings::EnumSkill::Medium);
73 if (args->isSet("Hard")) {
74 Settings::setSkill(Settings::EnumSkill::Hard);
76 if (args->isSet("VeryHard")) {
77 Settings::setSkill(Settings::EnumSkill::VeryHard);
79 args->clear();
82 MainWindow* window = new MainWindow;
83 window->show();
85 return application.exec();