File indexing completed on 2024-04-21 15:07:58

0001 // Copyright (c) 2002-2003 Rob Kaper <cap@capsi.com>
0002 //
0003 // This program is free software; you can redistribute it and/or
0004 // modify it under the terms of the GNU General Public License
0005 // version 2 as published by the Free Software Foundation.
0006 //
0007 // This program is distributed in the hope that it will be useful,
0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0010 // General Public License for more details.
0011 //
0012 // You should have received a copy of the GNU General Public License
0013 // along with this program; see the file COPYING.  If not, write to
0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0015 // Boston, MA 02110-1301, USA.
0016 
0017 #include <QApplication>
0018 #include <QCommandLineParser>
0019 
0020 #include <kaboutdata.h>
0021 #include <klocalizedstring.h>
0022 #include <kiconloader.h>
0023 #include <kdbusservice.h>
0024 #include <kcrash.h>
0025 
0026 #include "version.h"
0027 #include "atlantik.h"
0028 #include "monopd.h"
0029 
0030 int main(int argc, char *argv[])
0031 {
0032     QApplication kapplication(argc, argv);
0033 
0034     KLocalizedString::setApplicationDomain(QByteArrayLiteral("atlantik"));
0035 
0036     KAboutData aboutData(
0037         QStringLiteral("atlantik"),
0038         i18n("Atlantik"), QStringLiteral(ATLANTIK_VERSION_STRING),
0039         i18n("The Atlantic board game"),
0040         KAboutLicense::GPL,
0041         i18n("(c) 1998-2004 Rob Kaper"),
0042         i18n("KDE client for playing Monopoly-like games on the monopd network."),
0043         QStringLiteral("http://unixcode.org/atlantik/")
0044         );
0045     aboutData.setDesktopFileName(QStringLiteral("org.kde.atlantik"));
0046 
0047     aboutData.addAuthor(i18n("Rob Kaper"), i18n("main author"), QStringLiteral("cap@capsi.com"), QStringLiteral("http://capsi.com/"));
0048 
0049     // Patches and artists
0050     aboutData.addCredit(i18n("Thiago Macieira"), i18n("KExtendedSocket support"), QStringLiteral("thiagom@wanadoo.fr"));
0051     aboutData.addCredit(i18n("Albert Astals Cid"), i18n("various patches"), QStringLiteral("tsdgeos@terra.es"));
0052 
0053     aboutData.addCredit(i18n("Bart Szyszka"), i18n("application icon"), QStringLiteral("bart@gigabee.com"), QStringLiteral("http://www.gigabee.com/"));
0054     aboutData.addCredit(i18n("Rob Malda"), i18n("token icons"), QString(), QStringLiteral("http://cmdrtaco.net/"));
0055     aboutData.addCredit(i18n("Elhay Achiam"), i18n("icons"), QStringLiteral("elhay_a@bezeqint.net"));
0056     aboutData.addCredit(i18n("Carlo Caneva"), i18n("icons"), QStringLiteral("webmaster@molecola.com"), QStringLiteral("http://www.molecola.com/"));
0057 
0058     KAboutData::setApplicationData(aboutData);
0059 
0060     kapplication.setWindowIcon(KDE::icon(QStringLiteral("atlantik")));
0061 
0062     KCrash::initialize();
0063 
0064     QCommandLineParser parser;
0065     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("host"), i18n("Connect to this host"), i18n("host")));
0066     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("p") << QStringLiteral("port"), i18n("Connect at this port"), i18n("port"), QString::number(MONOPD_PORT)));
0067     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("g") << QStringLiteral("game"), i18n("Join this game"), i18n("game")));
0068     aboutData.setupCommandLine(&parser);
0069     parser.process(kapplication);
0070     aboutData.processCommandLine(&parser);
0071 
0072     KDBusService service;
0073 
0074     if (kapplication.isSessionRestored())
0075         kRestoreMainWindows<Atlantik>();
0076     else
0077     {
0078         Atlantik *atlantik = new Atlantik(&parser);
0079         atlantik->setMinimumSize(640, 480);
0080         atlantik->setCaption(i18n("The Atlantic Board Game"));
0081         atlantik->show();
0082     }
0083 
0084     return kapplication.exec();
0085 }