File indexing completed on 2024-10-06 07:57:37

0001 /*
0002  *   SPDX-FileCopyrightText: 2010-2013 Alejandro Fiestas Olivares <afiestas@kde.org>
0003  *   SPDX-FileCopyrightText: 2010 UFO Coders <info@ufocoders.com>
0004  *
0005  *   SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #include "bluewizard.h"
0009 #include "version.h"
0010 
0011 #include <QApplication>
0012 #include <QCommandLineParser>
0013 #include <QIcon>
0014 #include <QUrl>
0015 
0016 #include <KAboutData>
0017 #include <KDBusService>
0018 #include <KLocalizedString>
0019 #include <KWindowSystem>
0020 
0021 int main(int argc, char *argv[])
0022 {
0023     QApplication app(argc, argv);
0024 
0025     KAboutData aboutData(QStringLiteral("bluedevilwizard"),
0026                          i18n("Add Bluetooth Device"),
0027                          QStringLiteral(BLUEDEVIL_VERSION_STRING),
0028                          i18n("Add Bluetooth Device"),
0029                          KAboutLicense::GPL,
0030                          i18n("(c) 2010, UFO Coders"));
0031 
0032     aboutData.addAuthor(QStringLiteral("David Rosca"), //
0033                         i18n("Maintainer"),
0034                         QStringLiteral("nowrep@gmail.com"),
0035                         QStringLiteral("http://david.rosca.cz"));
0036 
0037     aboutData.addAuthor(QStringLiteral("Alejandro Fiestas Olivares"),
0038                         i18n("Previous Maintainer"),
0039                         QStringLiteral("afiestas@kde.org"),
0040                         QStringLiteral("http://www.afiestas.org/"));
0041 
0042     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth")));
0043     app.setQuitOnLastWindowClosed(false);
0044 
0045     KAboutData::setApplicationData(aboutData);
0046     KDBusService service(KDBusService::Unique);
0047 
0048     QCommandLineParser parser;
0049     aboutData.setupCommandLine(&parser);
0050 
0051     parser.process(app);
0052     aboutData.processCommandLine(&parser);
0053 
0054     BlueWizard *wizard = new BlueWizard;
0055 
0056     QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() {
0057         KWindowSystem::updateStartupId(wizard->windowHandle());
0058         KWindowSystem::activateWindow(wizard->windowHandle());
0059     });
0060 
0061     return app.exec();
0062 }