main.cpp 2.61 KB
Newer Older
1
/*
Laurent Montel's avatar
Laurent Montel committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
   Copyright (C) 2013-2016 Montel Laurent <montel@kde.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
18 19 20
*/
#include "themeeditormainwindow.h"

Laurent Montel's avatar
Laurent Montel committed
21
#include "grantleeeditor-version.h"
Laurent Montel's avatar
Laurent Montel committed
22

23
#include <qapplication.h>
Laurent Montel's avatar
Laurent Montel committed
24
#include <QCommandLineParser>
25 26
#include <kaboutdata.h>
#include <KLocalizedString>
27
#include <Kdelibs4ConfigMigrator>
Laurent Montel's avatar
Laurent Montel committed
28
#include <KCrash>
29
#include <KDBusService>
30

Laurent Montel's avatar
Laurent Montel committed
31
int main(int argc, char **argv)
32
{
33
    QApplication app(argc, argv);
Laurent Montel's avatar
Laurent Montel committed
34
    app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
Laurent Montel's avatar
Laurent Montel committed
35
    app.setAttribute(Qt::AA_EnableHighDpiScaling);
Laurent Montel's avatar
Laurent Montel committed
36
    KCrash::initialize();
Laurent Montel's avatar
Laurent Montel committed
37 38 39
    Kdelibs4ConfigMigrator migrate(QStringLiteral("headerthemeeditor"));
    migrate.setConfigFiles(QStringList() << QStringLiteral("headerthemeeditorrc"));
    migrate.setUiFiles(QStringList() << QStringLiteral("headerthemeeditorui.rc"));
40
    migrate.migrate();
Laurent Montel's avatar
Minor  
Laurent Montel committed
41
    KLocalizedString::setApplicationDomain("headerthemeeditor");
Laurent Montel's avatar
Laurent Montel committed
42 43
    KAboutData aboutData(QStringLiteral("headerthemeeditor"),
                         i18n("Header Theme Editor"),
Laurent Montel's avatar
Laurent Montel committed
44
                         QStringLiteral(KDEPIM_VERSION),
Laurent Montel's avatar
Laurent Montel committed
45 46
                         i18n("Messageviewer Header Theme Editor"),
                         KAboutLicense::GPL_V2,
Laurent Montel's avatar
Laurent Montel committed
47
                         i18n("Copyright © 2013-2016 headerthemeeditor authors"));
48
    aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org"));
Laurent Montel's avatar
Laurent Montel committed
49
    QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
50 51
    aboutData.setOrganizationDomain(QByteArray("kde.org"));
    aboutData.setProductName(QByteArray("headerthemeeditor"));
Laurent Montel's avatar
Laurent Montel committed
52

53 54
    KAboutData::setApplicationData(aboutData);

Laurent Montel's avatar
Laurent Montel committed
55 56 57
    QCommandLineParser parser;
    parser.addVersionOption();
    parser.addHelpOption();
Laurent Montel's avatar
Laurent Montel committed
58
    aboutData.setupCommandLine(&parser);
Laurent Montel's avatar
Laurent Montel committed
59 60

    parser.process(app);
Laurent Montel's avatar
Laurent Montel committed
61
    aboutData.processCommandLine(&parser);
62

63
    KDBusService service;
Laurent Montel's avatar
Laurent Montel committed
64

65 66
    ThemeEditorMainWindow *mw = new ThemeEditorMainWindow();
    mw->show();
67 68
    const int ret = app.exec();
    return ret;
69
}