File indexing completed on 2024-05-05 05:56:58

0001 /*
0002   SPDX-FileCopyrightText: 2008-2014 Eike Hein <hein@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include "mainwindow.h"
0008 
0009 #include <KAboutData>
0010 #include <KCrash>
0011 #include <KDBusService>
0012 #include <KLocalizedString>
0013 
0014 #include <QApplication>
0015 #include <QCommandLineParser>
0016 
0017 int main(int argc, char *argv[])
0018 {
0019     QApplication app(argc, argv);
0020     app.setQuitOnLastWindowClosed(false);
0021 
0022     KLocalizedString::setApplicationDomain(QByteArrayLiteral("yakuake"));
0023 
0024     KAboutData aboutData(QStringLiteral("yakuake"),
0025                          xi18nc("@title", "<application>Yakuake</application>"),
0026                          QStringLiteral(YAKUAKE_VERSION),
0027                          xi18nc("@title", "A drop-down terminal emulator based on KDE Konsole technology."),
0028                          KAboutLicense::GPL,
0029                          xi18nc("@info:credit", "(c) 2008-2018 The Yakuake Team"),
0030                          QString(),
0031                          QStringLiteral("https://apps.kde.org/yakuake/"));
0032 
0033     aboutData.setOrganizationDomain(QByteArray("kde.org"));
0034     aboutData.setProductName(QByteArray("yakuake"));
0035 
0036     aboutData.addAuthor(xi18nc("@info:credit", "Eike Hein"), xi18nc("@info:credit", "Maintainer, Lead Developer"), QStringLiteral("hein@kde.org"));
0037     aboutData.addAuthor(xi18nc("@info:credit", "Francois Chazal"), xi18nc("@info:credit", "Project Founder, Legacy skin (Inactive)"));
0038     aboutData.addCredit(xi18nc("@info:credit", "Daniel 'suslik' D."), xi18nc("@info:credit", "Plastik skin"), QStringLiteral("dd@accentsolution.com"));
0039     aboutData.addCredit(xi18nc("@info:credit", "Juan Carlos Torres"),
0040                         xi18nc("@info:credit", "Tab bar drag and drop support, Prevent Closing toggle"),
0041                         QStringLiteral("carlosdgtorres@gmail.com"));
0042     aboutData.addCredit(xi18nc("@info:credit", "Gustavo Ribeiro Croscato"),
0043                         xi18nc("@info:credit", "Icon on tabs with Prevent Closing enabled"),
0044                         QStringLiteral("croscato@gmail.com"));
0045     aboutData.addCredit(xi18nc("@info:credit", "Danilo Cesar Lemes de Paula"),
0046                         xi18nc("@info:credit", "Actions to grow terminals"),
0047                         QStringLiteral("danilo.eu@gmail.com"));
0048 
0049     aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
0050 
0051     KAboutData::setApplicationData(aboutData);
0052     QCommandLineParser parser;
0053 
0054     aboutData.setupCommandLine(&parser);
0055     parser.process(app);
0056     aboutData.processCommandLine(&parser);
0057 
0058     app.setApplicationName(aboutData.componentName());
0059     app.setApplicationDisplayName(aboutData.displayName());
0060     app.setOrganizationDomain(aboutData.organizationDomain());
0061     app.setApplicationVersion(aboutData.version());
0062     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("yakuake")));
0063 
0064     KDBusService service(KDBusService::Unique);
0065 
0066     KCrash::initialize();
0067     MainWindow mainWindow;
0068     mainWindow.hide();
0069     QObject::connect(&service, &KDBusService::activateRequested, &mainWindow, &MainWindow::toggleWindowState);
0070 
0071     return app.exec();
0072 }