File indexing completed on 2024-09-29 10:38:40
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 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0043 app.setAttribute(Qt::AA_UseHighDpiPixmaps); 0044 #endif 0045 app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-bluetooth"))); 0046 app.setQuitOnLastWindowClosed(false); 0047 0048 KAboutData::setApplicationData(aboutData); 0049 KDBusService service(KDBusService::Unique); 0050 0051 QCommandLineParser parser; 0052 aboutData.setupCommandLine(&parser); 0053 0054 parser.process(app); 0055 aboutData.processCommandLine(&parser); 0056 0057 BlueWizard *wizard = new BlueWizard; 0058 0059 QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() { 0060 KWindowSystem::updateStartupId(wizard->windowHandle()); 0061 KWindowSystem::activateWindow(wizard->windowHandle()); 0062 }); 0063 0064 return app.exec(); 0065 }