Report error conditions instead of just doing nothing.
[tagua/yd.git] / src / main.cpp
blobc1d910a83e8ee07f445cce8461243dc542efc3e0
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
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 */
11 #include <kapplication.h>
12 #include <kaboutdata.h>
13 #include <kcmdlineargs.h>
14 #include <kglobal.h>
15 #include <klocale.h>
16 #include <kstandarddirs.h>
17 #include <kiconloader.h>
18 #include <klocale.h>
20 #include "mainwindow.h"
21 #include "crash.h"
23 static const char description[] = "A generic board game interface";
25 static const char version[] = "0.9.1";
27 void trap() {
28 printf("Press enter to quit.\n");
30 char dummy[4096];
31 fgets(dummy, 4096, stdin);
34 int main(int argc, char **argv) {
35 KAboutData about( "tagua", 0, ki18n("Tagua"),
36 version, ki18n(description), KAboutData::License_GPL,
37 ki18n("(C) 2006 Paolo Capriotti, Maurizio Monge") );
38 about.addAuthor(ki18n("Paolo Capriotti"), KLocalizedString(), "p.capriotti@gmail.com");
39 about.addAuthor(ki18n("Maurizio Monge"), KLocalizedString(), "p.capriotti@gmail.com");
40 about.addCredit(ki18n("Jani Huhtanen"), ki18n("Gaussian blur code"));
41 about.addCredit(ki18n("Rici Lake"), ki18n("funclib lua library"));
42 about.addCredit(ki18n("Riccardo Iaconelli"), ki18n("Various fixes and cleanups"));
43 about.addCredit(ki18n("Yann Dirson"), ki18n("Shogi related patches"));
44 about.addCredit(ki18n("Pieter Stouten"), ki18n("Allowed free use of images on shogi.net"));
46 KCmdLineOptions options;
47 options.add("+variant", ki18n("Initial variant"));
49 KCmdLineArgs::init(argc, argv, &about);
50 KCmdLineArgs::addCmdLineOptions(options);
52 KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
54 QString variant = args->count() > 0 ? args->arg(0) : "chess";
55 KApplication app;
57 MainWindow* widget = new MainWindow(variant);
58 widget->show();
60 return app.exec();