2 Copyright (c) 2012-2016 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #include <kaboutdata.h>
19 #include <KDBusService>
20 #include <KLocalizedString>
21 #include <Kdelibs4ConfigMigrator>
22 #include <QApplication>
24 #include "importwizard.h"
26 #include "kdepim-version.h"
28 #include <QCommandLineParser>
31 int main(int argc
, char *argv
[])
33 QApplication
app(argc
, argv
);
34 app
.setAttribute(Qt::AA_UseHighDpiPixmaps
, true);
35 #if QT_VERSION >= 0x050600
36 app
.setAttribute(Qt::AA_EnableHighDpiScaling
);
38 Kdelibs4ConfigMigrator
migrate(QStringLiteral("importwizard"));
39 migrate
.setConfigFiles(QStringList() << QStringLiteral("importwizardrc"));
42 KLocalizedString::setApplicationDomain("importwizard");
43 //FIXME: "wizards" are "assistents" in new KDE slang
45 KAboutData
aboutData(QStringLiteral("importwizard"),
46 i18n("PIM Import Tool"),
47 QStringLiteral(KDEPIM_VERSION
),
48 i18n("PIM Import Tool"),
49 KAboutLicense::GPL_V2
,
50 i18n("Copyright © 2012-2016 importwizard authors"));
52 aboutData
.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org"));
53 QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kontact-import-wizard")));
54 aboutData
.setOrganizationDomain(QByteArray("kde.org"));
55 aboutData
.setProductName(QByteArray("importwizard"));
56 KAboutData::setApplicationData(aboutData
);
58 QCommandLineParser parser
;
59 parser
.addOption(QCommandLineOption(QStringList() << QStringLiteral("mode"), i18n("Mode")));
60 parser
.addVersionOption();
61 parser
.addHelpOption();
62 aboutData
.setupCommandLine(&parser
);
64 aboutData
.processCommandLine(&parser
);
66 KDBusService
service(KDBusService::Unique
);
68 ImportWizard::WizardMode mode
= ImportWizard::AutoDetect
;
69 if (parser
.isSet(QStringLiteral("mode"))) {
70 if (!parser
.positionalArguments().isEmpty()) {
71 const QString modeStr
= parser
.positionalArguments().at(0);
72 if (modeStr
== QLatin1String("manual")) {
73 mode
= ImportWizard::Manual
;
78 ImportWizard
*wizard
= new ImportWizard(mode
);
80 const int ret
= app
.exec();