From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- knetwalk/src/main.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 knetwalk/src/main.cpp (limited to 'knetwalk/src/main.cpp') diff --git a/knetwalk/src/main.cpp b/knetwalk/src/main.cpp new file mode 100644 index 00000000..72aaa4f3 --- /dev/null +++ b/knetwalk/src/main.cpp @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2005, Thomas Nagy * + * tnagyemail-mail@yahoo@fr * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License version 2 * + * as published by the Free Software Foundation (see COPYING) * + * * + * 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 +#include +#include +#include +#include +#include + +#include "highscores.h" +#include "settings.h" +#include "mainwindow.h" + +static const char description[] = +I18N_NOOP("KNetWalk, a game for system administrators."); + +static const char version[] = "1.0"; + +static KCmdLineOptions options[] = +{ + { "Novice", I18N_NOOP( "Start in novice mode" ), 0 }, + { "Normal", I18N_NOOP( "Start in normal mode" ), 0 }, + { "Expert", I18N_NOOP( "Start in expert mode" ), 0 }, + { "Master", I18N_NOOP( "Start in master mode" ), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char ** argv) +{ + KAboutData about("knetwalk", I18N_NOOP("knetwalk"), version, description, + KAboutData::License_GPL, I18N_NOOP("(C) 2004, 2005 Andi Peredri, ported to KDE by Thomas Nagy"), 0, + "tnagyemail-mail@yahoo.fr"); + about.addAuthor( "Andi Peredri", 0, "andi@ukr.net" ); + about.addAuthor( "Thomas Nagy", 0, "tnagy2^8@yahoo.fr" ); + + KCmdLineArgs::init(argc, argv, &about); + KCmdLineArgs::addCmdLineOptions(options); + + KApplication app; + + KGlobal::locale()->insertCatalogue("libkdegames"); + + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); + if (args->isSet("Novice")) Settings::setSkill(Settings::EnumSkill::Novice); + if (args->isSet("Normal")) Settings::setSkill(Settings::EnumSkill::Normal); + if (args->isSet("Expert")) Settings::setSkill(Settings::EnumSkill::Expert); + if (args->isSet("Master")) Settings::setSkill(Settings::EnumSkill::Master); + args->clear(); + + KHighscore::init("knetwalk"); + KExtHighscore::ExtManager manager; + + + MainWindow* wi = new MainWindow; + app.setMainWidget(wi); + wi->show(); + + return app.exec(); +} + -- cgit v1.2.1