File indexing completed on 2024-02-25 03:46:29

0001 /*
0002     KBruch.cpp  -  Main File of KBruch
0003     SPDX-FileCopyrightText: 2001 Sebastian Stein <seb.kde@hpfsc.de>
0004     SPDX-FileCopyrightText: 2008 Tiago Porangaba <tiago.porangaba@ltia.fc.unesp.br>
0005     SPDX-FileCopyrightText: 2008 Tadeu Araujo <tadeu.araujo@ltia.fc.unesp.br>
0006     SPDX-FileCopyrightText: 2008 Danilo Balzaque <danilo.balzaque@ltia.fc.unesp.br>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #include "KBruch.h"
0012 
0013 #include "kbruch_version.h"
0014 
0015 /* standard C++ library includes */
0016 #include <ctime>
0017 
0018 /* these includes are needed for KDE support */
0019 #include <KAboutData>
0020 #include <KCrash>
0021 #include <KLocalizedString>
0022 
0023 /* these includes are needed for Qt support */
0024 #include <QApplication>
0025 #include <QCommandLineParser>
0026 #include <QObject>
0027 
0028 /* the main program */
0029 int main(int argc, char * argv[])
0030 {
0031     QApplication app(argc, argv);
0032     KLocalizedString::setApplicationDomain(QByteArrayLiteral("kbruch"));
0033 
0034     /* fill the about data; the common KDE about dialog will show it to the
0035      * user */
0036     KAboutData aboutData(QStringLiteral("kbruch"), i18n("KBruch"),
0037                          QStringLiteral(KBRUCH_VERSION_STRING),
0038                          i18n("Learn calculating with fractions"),
0039                          KAboutLicense::GPL,
0040                          i18n("© 2002-2011, Sebastian Stein"));
0041     aboutData.addAuthor(i18n("Sebastian Stein"), i18n("Current maintainer, original author"), QStringLiteral("seb.kde@hpfsc.de"));
0042     aboutData.addAuthor(i18n("Paulo Cattai"), i18n("New interface design and usability improvements"), QStringLiteral("paulo.cattai@ltia.fc.unesp.br"));
0043     aboutData.addAuthor(i18n("Danilo Balzaque"), i18n("New interface design and usability improvements"), QStringLiteral("danilo.balzaque@ltia.fc.unesp.br"));
0044     aboutData.addAuthor(i18n("Roberto Cunha"), i18n("New interface design and usability improvements"), QStringLiteral("roberto.cunha@ltia.fc.unesp.br"));
0045     aboutData.addAuthor(i18n("Tadeu Araujo"), i18n("New interface design and usability improvements"), QStringLiteral("tadeu.araujo@ltia.fc.unesp.br"));
0046     aboutData.addAuthor(i18n("Tiago Porangaba"), i18n("New interface design and usability improvements"), QStringLiteral("tiago.porangaba@ltia.fc.unesp.br"));
0047     aboutData.setHomepage(QStringLiteral("https://edu.kde.org/kbruch/"));
0048 
0049     QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kbruch")));
0050 
0051     KCrash::initialize();
0052 
0053     QCommandLineParser parser;
0054     KAboutData::setApplicationData(aboutData);
0055     aboutData.setupCommandLine(&parser);
0056     parser.process(app);
0057     aboutData.processCommandLine(&parser);
0058 
0059     QObject::connect(&app, &QApplication::lastWindowClosed, &app, &QApplication::quit);
0060 
0061     AppMenuWidget * kbruchApp = new AppMenuWidget();
0062     kbruchApp->show();
0063 
0064     /* lets execute the Qt GUI; it will handle all cmd options which are left */
0065     return app.exec();
0066 }