main.cpp 3.38 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/***************************************************************************
                          main.cpp  -  description
                             -------------------
    begin                : mer jui 11 22:27:28 EDT 2001
    copyright            : (C) 2001 by Gaël de Chalendar
    email                : Gael.de.Chalendar@free.fr

This is the standard main function of a KDE application simplified for KsirK

 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "kgamewin.h"
#include "GameLogic/gameautomaton.h"
Nemanja Hiršl's avatar
Nemanja Hiršl committed
23
24
25
26
#include <KAboutData>
#include <QDebug>
#include <QApplication>
#include <QCommandLineParser>
27
28
29

int main(int argc, char *argv[])
{
Nemanja Hiršl's avatar
Nemanja Hiršl committed
30
31
32
33
34
35
36
37
38
39
  qDebug() << "Hello KsirK";

  KAboutData aboutData(QStringLiteral("ksirk"),
                       i18n("KsirK"),
                       QStringLiteral("5.0.0"),
                       i18n("KsirK - World Domination Strategy Game"),
                       KAboutLicense::GPL,
                       i18n("(c) 2002-2015, Gaël de Chalendar\n"),
                       i18n("For help and user manual, please see\nthe KsirK web site."),
                       QStringLiteral("http://games.kde.org/game.php?game=ksirk"));
40

Nemanja Hiršl's avatar
Nemanja Hiršl committed
41
42
43
44
45
46
47
  aboutData.addAuthor(i18n("Gael de Chalendar aka Kleag"),QStringLiteral(), QStringLiteral("kleag@free.fr"));
  aboutData.addAuthor(i18n("Nemanja Hirsl"),i18n("Current maintainer"), QStringLiteral("nemhirsl@gmail.com"));
  aboutData.addAuthor(i18n("Robin Doer"));
  aboutData.addAuthor(i18n("Albert Astals Cid"));
  aboutData.addAuthor(i18n("Michal Golunski (Polish translation)"),QStringLiteral(), QStringLiteral("michalgolunski@o2.pl"));
  aboutData.addAuthor(i18n("French students of the 'IUP ISI 2007-2008':"));
  aboutData.addAuthor(i18n("&nbsp;&nbsp;Anthony Rey<br/>&nbsp;&nbsp;Benjamin Lucas<br/>&nbsp;&nbsp;Benjamin Moreau<br/>&nbsp;&nbsp;Gaël Clouet<br/>&nbsp;&nbsp;Guillaume Pelouas<br/>&nbsp;&nbsp;Joël Marco<br/>&nbsp;&nbsp;Laurent Dang<br/>&nbsp;&nbsp;Nicolas Linard<br/>&nbsp;&nbsp;Vincent Sac"));
48

Nemanja Hiršl's avatar
Nemanja Hiršl committed
49
50
51
52
  aboutData.setOrganizationDomain(QByteArray("kde.org"));
  aboutData.setProductName(QByteArray("ksirk"));

  QApplication app(argc, argv);
53
54
55

  KLocalizedString::setApplicationDomain("ksirk");

Nemanja Hiršl's avatar
Nemanja Hiršl committed
56
57
58
59
60
61
62
63
64
  app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksirk")));
  KAboutData::setApplicationData(aboutData);

  QCommandLineParser parser;
  parser.addVersionOption();
  parser.addHelpOption();
  aboutData.setupCommandLine(&parser);
  parser.process(app);
  aboutData.processCommandLine(&parser);
65

66
67
68
69
70
71
  if (app.isSessionRestored())
  {
      RESTORE(Ksirk::KGameWindow);
  }
  else
  {
Nemanja Hiršl's avatar
Nemanja Hiršl committed
72
    qDebug() << "Creating main window";
73
    Ksirk::KGameWindow *ksirk = new Ksirk::KGameWindow();
Nemanja Hiršl's avatar
Nemanja Hiršl committed
74
    ksirk->show();
75
  }
Nemanja Hiršl's avatar
Nemanja Hiršl committed
76

Frederik Schwarzer's avatar
Frederik Schwarzer committed
77
78
  app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksirk")));

Nemanja Hiršl's avatar
Nemanja Hiršl committed
79
80
81
  qDebug() << "Executing app";
  return app.exec();
}