SVN_SILENT made messages (after extraction)
[kdepim.git] / accountwizard / main.cpp
blobc70398ab274b113a8c0aa783169c28e47f2ea20f
1 /*
2 Copyright (c) 2009 Volker Krause <vkrause@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
20 #include "dialog.h"
21 #include "global.h"
23 #include <controlgui.h>
25 #include <kaboutdata.h>
26 #include <qapplication.h>
27 #include <QUrl>
29 #include <KDBusService>
30 #include <KLocalizedString>
31 #include <stdio.h>
32 #include <QCommandLineParser>
33 #include <QCommandLineOption>
34 #include <QIcon>
35 int main(int argc, char **argv)
37 QApplication app(argc, argv);
38 app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
39 #if QT_VERSION >= 0x050600
40 app.setAttribute(Qt::AA_EnableHighDpiScaling);
41 #endif
42 KLocalizedString::setApplicationDomain("accountwizard");
44 KAboutData aboutData(QStringLiteral("accountwizard"),
45 i18n("Account Assistant"),
46 QStringLiteral("0.2"),
47 i18n("Helps setting up PIM accounts"),
48 KAboutLicense::LGPL,
49 i18n("(c) 2009-2016 the Akonadi developers"),
50 QStringLiteral("http://pim.kde.org/akonadi/"));
51 aboutData.addAuthor(i18n("Volker Krause"), i18n("Author"), QStringLiteral("vkrause@kde.org"));
52 aboutData.addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
54 app.setOrganizationDomain(QStringLiteral("kde.org"));
55 app.setWindowIcon(QIcon::fromTheme(QStringLiteral("akonadi")));
56 QCommandLineParser parser;
57 KAboutData::setApplicationData(aboutData);
58 parser.addVersionOption();
59 parser.addHelpOption();
60 parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("type"), i18n("Only offer accounts that support the given type."), QStringLiteral("type")));
61 parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("assistant"), i18n("Run the specified assistant."), QStringLiteral("assistant")));
62 parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("package"), i18n("unpack fullpath on startup and launch that assistant"), QStringLiteral("fullpath")));
64 aboutData.setupCommandLine(&parser);
65 parser.process(app);
66 aboutData.processCommandLine(&parser);
67 KDBusService service(KDBusService::Unique);
69 Akonadi::ControlGui::start(0);
71 const QString packageArgument = parser.value(QStringLiteral("package"));
72 if (!packageArgument.isEmpty()) {
73 Global::setAssistant(Global::unpackAssistant(QUrl::fromLocalFile(packageArgument)));
74 } else {
75 Global::setAssistant(parser.value(QStringLiteral("assistant")));
78 QString typeValue = parser.value(QStringLiteral("type"));
79 if (!typeValue.isEmpty()) {
80 Global::setTypeFilter(typeValue.split(QLatin1Char(',')));
83 Dialog dlg(0);
84 dlg.show();
86 return app.exec();