Moved global.* to mastersettings.*, and converted many error messages to use the...
[tagua/yd.git] / src / main.cpp
bloba766c9d3e06cb2fde0e8b51e8f63fe9ae62fb5b1
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
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"
22 #include "common.h"
24 static const char description[] = "A generic board game interface";
26 static const char version[] = "0.9.1";
28 void trap() {
29 printf("Press enter to quit.\n");
31 char dummy[4096];
32 fgets(dummy, 4096, stdin);
35 int main(int argc, char **argv) {
36 KAboutData about( "kboard", 0, ki18n("KBoard"),
37 version, ki18n(description), KAboutData::License_GPL,
38 ki18n("(C) 2006 Paolo Capriotti, Maurizio Monge") );
39 about.addAuthor(ki18n("Paolo Capriotti"), KLocalizedString(), "p.capriotti@gmail.com");
40 about.addAuthor(ki18n("Maurizio Monge"), KLocalizedString(), "p.capriotti@gmail.com");
41 about.addCredit(ki18n("Jani Huhtanen"), KLocalizedString(), I18N_NOOP("Gaussian blur code") );
42 about.addCredit(ki18n("Rici Lake"), KLocalizedString(), I18N_NOOP("funclib lua library") );
44 KCmdLineOptions options;
45 KCmdLineArgs::init(argc, argv, &about);
46 KCmdLineArgs::addCmdLineOptions(options);
47 KApplication app;
49 installCrashHander();
50 atexit(trap);
52 QString data_dir = qgetenv("KBOARD_DATA");
53 if (data_dir.isEmpty()) data_dir = "data";
55 KGlobal::dirs()->addResourceDir("appdata", data_dir);
56 KGlobal::dirs()->addResourceDir("icon", data_dir + "/pics");
57 KIconLoader::global()->reconfigure(about.appName(), KGlobal::dirs());
59 MainWindow* widget = new MainWindow;
60 widget->show();
62 return app.exec();