File indexing completed on 2023-09-24 08:13:18

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 <kcrash.h>
0024 
0025 #include "version.h"
0026 #include "atlantik.h"
0027 #include "monopd.h"
0028 
0029 int main(int argc, char *argv[])
0030 {
0031     QApplication kapplication(argc, argv);
0032     KLocalizedString::setApplicationDomain("atlantik");
0033 
0034     KAboutData aboutData(
0035         QStringLiteral("atlantik"),
0036         i18n("Atlantik"), QStringLiteral(ATLANTIK_VERSION_STRING),
0037         i18n("The Atlantic board game"),
0038         KAboutLicense::GPL,
0039         i18n("(c) 1998-2004 Rob Kaper"),
0040         i18n("KDE client for playing Monopoly-like games on the monopd network."),
0041         QStringLiteral("http://unixcode.org/atlantik/")
0042         );
0043     aboutData.setDesktopFileName(QStringLiteral("org.kde.atlantik"));
0044 
0045     aboutData.addAuthor(i18n("Rob Kaper"), i18n("main author"), QStringLiteral("cap@capsi.com"), QStringLiteral("http://capsi.com/"));
0046 
0047     // Patches and artists
0048     aboutData.addCredit(i18n("Thiago Macieira"), i18n("KExtendedSocket support"), QStringLiteral("thiagom@wanadoo.fr"));
0049     aboutData.addCredit(i18n("Albert Astals Cid"), i18n("various patches"), QStringLiteral("tsdgeos@terra.es"));
0050 
0051     aboutData.addCredit(i18n("Bart Szyszka"), i18n("application icon"), QStringLiteral("bart@gigabee.com"), QStringLiteral("http://www.gigabee.com/"));
0052     aboutData.addCredit(i18n("Rob Malda"), i18n("token icons"), QString(), QStringLiteral("http://cmdrtaco.net/"));
0053     aboutData.addCredit(i18n("Elhay Achiam"), i18n("icons"), QStringLiteral("elhay_a@bezeqint.net"));
0054     aboutData.addCredit(i18n("Carlo Caneva"), i18n("icons"), QStringLiteral("webmaster@molecola.com"), QStringLiteral("http://www.molecola.com/"));
0055 
0056     KAboutData::setApplicationData(aboutData);
0057 
0058     kapplication.setWindowIcon(KDE::icon(QStringLiteral("atlantik")));
0059 
0060     KCrash::initialize();
0061 
0062     QCommandLineParser parser;
0063     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("host"), i18n("Connect to this host"), i18n("host")));
0064     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("p") << QStringLiteral("port"), i18n("Connect at this port"), i18n("port"), QString::number(MONOPD_PORT)));
0065     parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("g") << QStringLiteral("game"), i18n("Join this game"), i18n("game")));
0066     aboutData.setupCommandLine(&parser);
0067     parser.process(kapplication);
0068     aboutData.processCommandLine(&parser);
0069 
0070     if (kapplication.isSessionRestored())
0071         kRestoreMainWindows<Atlantik>();
0072     else
0073     {
0074         Atlantik *atlantik = new Atlantik(&parser);
0075         atlantik->setMinimumSize(640, 480);
0076         atlantik->setCaption(i18n("The Atlantic Board Game"));
0077         atlantik->show();
0078     }
0079 
0080     return kapplication.exec();
0081 }