#include <kapplication.h>
#include <kaboutdata.h>
#include <klocale.h>
#include <kcmdlineargs.h>

#include "config.h"
#include "toplevel.h"

static const KCmdLineOptions options[] =
{
#ifdef WITH_GGZ
	{"ggz", I18N_NOOP("Request GGZ game explicitely"), 0},
#endif
	{"theme", I18N_NOOP("Select UI theme"), 0},
	{0, 0, 0}
};

int main(int argc, char **argv)
{
	KApplication *app;
	KAboutData *about;
	KCmdLineArgs *args;
	int ggzmode;

	about = new KAboutData("kamikaze",
		I18N_NOOP("Kamikaze"),
		VERSION,
		I18N_NOOP("Multiplayer action game for KDE"),
		KAboutData::License_GPL_V2,
		"Copyright (C) 2001 - 2006 Josef Spillner",
		I18N_NOOP("Kamikaze is a not so harmless action game for 1-8 players."),
		"http://kamikaze.coolprojects.org/",
		"spillner@kde.org");
	about->addAuthor("Josef Spillner", I18N_NOOP("Maintainer, GGZ support, ..."), "spillner@kde.org");
	about->addAuthor("Tobias König", I18N_NOOP("AI, Gameplay, ..."), "tokoe@kde.org");
	about->setTranslator(I18N_NOOP("TRANSLATOR-NAME"), I18N_NOOP("TRANSLATOR-EMAIL"));

	KCmdLineArgs::init(argc, argv, about);
	KCmdLineArgs::addCmdLineOptions(options);
	args = KCmdLineArgs::parsedArgs();
#ifdef WITH_GGZ
	ggzmode = args->isSet("ggz");
#else
	ggzmode = 0;
#endif

	app = new KApplication();

	TopLevel *toplevel = new TopLevel(ggzmode);
	toplevel->show();

	if(args->isSet("theme"))
	{
		toplevel->setTheme(args->getOption("theme"));
	}

	app->setMainWidget(toplevel);

	return app->exec();
}

