File indexing completed on 2022-08-04 15:10:12

0001 /*
0002  *  ksokoban - a Sokoban game by KDE
0003  *  Copyright (C) 1998-2000  Anders Widell  <awl@passagen.se>
0004  *
0005  *  This program is free software; you can redistribute it and/or modify
0006  *  it under the terms of the GNU General Public License as published by
0007  *  the Free Software Foundation; either version 2 of the License, or
0008  *  (at your option) any later version.
0009  *
0010  *  This program is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  *  GNU General Public License for more details.
0014  *
0015  *  You should have received a copy of the GNU General Public License
0016  *  along with this program; if not, write to the Free Software
0017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0018  */
0019 
0020 
0021 #include <QApplication>
0022 #include <QCommandLineParser>
0023 #include <QCommandLineOption>
0024 
0025 #include <KAboutData>
0026 #include <KLocalizedString>
0027 
0028 #include "MainWindow.h"
0029 
0030 
0031 static const char version[] = "0.5.0";
0032 
0033 
0034 int
0035 main (int argc, char **argv)
0036 {
0037   QApplication app(argc, argv);
0038   KLocalizedString::setApplicationDomain("ksokoban");
0039 
0040   KAboutData aboutData(QStringLiteral("ksokoban"), i18n("KSokoban"),
0041                version,
0042                i18n("The japanese warehouse keeper game"),
0043                KAboutLicense::GPL,
0044                i18n("(c) 1998 Anders Widell <awl@hem.passagen.se>\n(c) 2012 Lukasz Kalamlacki"),
0045                QString(),
0046                QStringLiteral("http://www.shlomifish.org/open-source/projects/ksokoban/")
0047                );
0048   aboutData.addAuthor(i18n("Shlomi Fish"), i18n("For porting to Qt5/KF5 and doing other cleanups"),
0049               QStringLiteral("shlomif@cpan.org"),
0050               QStringLiteral("http://www.shlomifish.org/"));
0051   aboutData.addAuthor(i18n("Lukasz Kalamlacki"), i18n("For rewriting the original ksokoban game from kde3 to kde4"),
0052               QStringLiteral("kalamlacki@gmail.com"),
0053               QStringLiteral("http://sf.net/projects/ksokoban"));
0054   aboutData.addAuthor(i18n("Anders Widell"), i18n("For writing the original ksokoban game"),
0055               QStringLiteral("awl@hem.passagen.se"),
0056               QStringLiteral("http://hem.passagen.se/awl/ksokoban/"));
0057   aboutData.addCredit(i18n("David W. Skinner"),
0058               i18n("For contributing the Sokoban levels included in this game"),
0059               QStringLiteral("sasquatch@bentonrea.com"),
0060               QStringLiteral("http://users.bentonrea.com/~sasquatch/"));
0061 
0062   aboutData.setOrganizationDomain(QByteArray("kde.org"));
0063   aboutData.setDesktopFileName(QStringLiteral("org.kde.ksokoban"));
0064 
0065   KAboutData::setApplicationData(aboutData);
0066 
0067   app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksokoban")));
0068 
0069   QCommandLineParser parser;
0070   parser.addPositionalArgument(i18n("[file]"), i18n("Level collection file to load"));
0071   aboutData.setupCommandLine(&parser);
0072   parser.process(app);
0073   aboutData.processCommandLine(&parser);
0074 
0075 
0076   MainWindow *widget = new MainWindow();
0077   widget->show();
0078 
0079   if (parser.positionalArguments().count() > 0) {
0080     widget->openURL(parser.positionalArguments().at(0));
0081   }
0082 
0083 
0084   QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
0085 
0086 
0087   return app.exec();
0088 }