2018-12-06 15:06:06 +00:00
|
|
|
/*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nicolas Fella <nicolas.fella@gmx.de>
|
2018-12-06 15:06:06 +00:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2018-12-06 15:06:06 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QApplication>
|
2020-03-21 20:26:42 +00:00
|
|
|
#include <QCommandLineParser>
|
2020-08-17 19:06:36 +01:00
|
|
|
#include <QStyle>
|
2020-11-11 11:58:37 +00:00
|
|
|
#include <QStandardPaths>
|
2018-12-06 15:06:06 +00:00
|
|
|
|
|
|
|
#include <KCMultiDialog>
|
|
|
|
#include <KAboutData>
|
|
|
|
#include <KLocalizedString>
|
2020-01-17 00:31:53 +00:00
|
|
|
#include <KDBusService>
|
2018-12-06 15:06:06 +00:00
|
|
|
#include "kdeconnect-version.h"
|
|
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2021-07-27 22:03:51 +01:00
|
|
|
QIcon::setFallbackThemeName(QStringLiteral("breeze"));
|
|
|
|
|
2018-12-06 15:06:06 +00:00
|
|
|
QApplication app(argc, argv);
|
2021-05-23 06:12:29 +01:00
|
|
|
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("kdeconnect")));
|
2019-06-10 15:40:28 +01:00
|
|
|
KAboutData about(QStringLiteral("kdeconnect-settings"),
|
2018-12-06 15:06:06 +00:00
|
|
|
i18n("KDE Connect Settings"),
|
|
|
|
QStringLiteral(KDECONNECT_VERSION_STRING),
|
|
|
|
i18n("KDE Connect Settings"),
|
|
|
|
KAboutLicense::GPL,
|
2020-01-17 00:31:53 +00:00
|
|
|
i18n("(C) 2018-2020 Nicolas Fella"));
|
2018-12-06 15:06:06 +00:00
|
|
|
KAboutData::setApplicationData(about);
|
|
|
|
|
2020-03-21 20:26:42 +00:00
|
|
|
QCommandLineParser parser;
|
|
|
|
parser.addOption(QCommandLineOption(QStringLiteral("args"), i18n("Arguments for the config module"), QStringLiteral("args")));
|
|
|
|
|
|
|
|
about.setupCommandLine(&parser);
|
|
|
|
parser.process(app);
|
|
|
|
about.processCommandLine(&parser);
|
|
|
|
|
2020-01-17 00:31:53 +00:00
|
|
|
KDBusService dbusService(KDBusService::Unique);
|
|
|
|
|
2018-12-06 15:06:06 +00:00
|
|
|
KCMultiDialog* dialog = new KCMultiDialog;
|
2021-11-18 09:53:44 +00:00
|
|
|
dialog->addModule(KPluginMetaData(QStringLiteral("kcm_kdeconnect")), {parser.value(QStringLiteral("args"))});
|
2020-08-17 19:06:36 +01:00
|
|
|
|
|
|
|
auto style = dialog->style();
|
|
|
|
dialog->setContentsMargins(style->pixelMetric(QStyle::PM_LayoutLeftMargin),
|
|
|
|
style->pixelMetric(QStyle::PM_LayoutTopMargin),
|
|
|
|
style->pixelMetric(QStyle::PM_LayoutRightMargin),
|
|
|
|
style->pixelMetric(QStyle::PM_LayoutBottomMargin));
|
|
|
|
|
2018-12-06 15:06:06 +00:00
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->show();
|
|
|
|
|
|
|
|
app.setQuitOnLastWindowClosed(true);
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|
|
|
|
|