2015-02-07 00:32:25 +00:00
|
|
|
/*************************************************************************
|
|
|
|
* Copyright (C) 2008,2011 by Volker Lanz <vl@fidra.de> *
|
|
|
|
* *
|
|
|
|
* 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 3 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. If not, see <http://www.gnu.org/licenses/>.*
|
|
|
|
*************************************************************************/
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
#include "gui/mainwindow.h"
|
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <backend/corebackend.h>
|
|
|
|
#include <backend/corebackendmanager.h>
|
2010-03-01 11:02:38 +00:00
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <util/helpers.h>
|
2015-06-04 01:51:56 +01:00
|
|
|
#include "util/guihelpers.h"
|
2008-12-27 22:12:42 +00:00
|
|
|
|
2014-05-18 21:41:48 +01:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QCommandLineParser>
|
|
|
|
|
|
|
|
#include <KAboutData>
|
2015-12-05 19:25:04 +00:00
|
|
|
#include <KCrash>
|
2018-03-24 22:24:26 +00:00
|
|
|
#include <KDBusService>
|
2014-11-19 12:05:22 +00:00
|
|
|
#include <Kdelibs4ConfigMigrator>
|
2014-05-18 21:41:48 +01:00
|
|
|
#include <KMessageBox>
|
2014-05-13 23:53:37 +01:00
|
|
|
#include <KLocalizedString>
|
2008-09-24 20:32:01 +01:00
|
|
|
|
2018-03-22 20:13:58 +00:00
|
|
|
#include <config.h>
|
2010-03-09 17:13:22 +00:00
|
|
|
|
2014-05-18 21:41:48 +01:00
|
|
|
int Q_DECL_IMPORT main(int argc, char* argv[])
|
2008-09-24 20:32:01 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
QApplication app(argc, argv);
|
|
|
|
|
|
|
|
Kdelibs4ConfigMigrator migrate(QLatin1Literal("partitionmanager"));
|
2016-07-13 22:47:17 +01:00
|
|
|
migrate.setConfigFiles({ QLatin1Literal("partitionmanagerrc") });
|
|
|
|
migrate.setUiFiles({ QStringLiteral("partitionmanagerui.rc") });
|
2015-07-13 15:17:41 +01:00
|
|
|
migrate.migrate();
|
|
|
|
|
|
|
|
KLocalizedString::setApplicationDomain("partitionmanager");
|
2016-07-12 23:59:01 +01:00
|
|
|
KAboutData aboutData (
|
2015-07-13 15:17:41 +01:00
|
|
|
QStringLiteral("partitionmanager"),
|
|
|
|
xi18nc("@title", "<application>KDE Partition Manager</application>"),
|
|
|
|
QStringLiteral(VERSION),
|
2016-08-15 16:57:43 +01:00
|
|
|
xi18nc("@title", "Manage your disks, partitions and file systems"),
|
2015-07-13 15:17:41 +01:00
|
|
|
KAboutLicense::GPL_V3,
|
2017-01-02 11:37:24 +00:00
|
|
|
xi18nc("@info:credit", "© 2008-2013 Volker Lanz\n© 2012-2017 Andrius Štikonas"));
|
2016-07-12 23:59:01 +01:00
|
|
|
aboutData.setOrganizationDomain(QByteArray("kde.org"));
|
|
|
|
aboutData.setProductName(QByteArray("partitionmanager"));
|
2015-07-13 15:17:41 +01:00
|
|
|
|
2016-08-15 16:57:43 +01:00
|
|
|
aboutData.addAuthor(xi18nc("@info:credit", "Volker Lanz"), xi18nc("@info:credit", "Former maintainer"));
|
|
|
|
aboutData.addAuthor(xi18nc("@info:credit", "Andrius Štikonas"), xi18nc("@info:credit", "Maintainer"), QStringLiteral("andrius@stikonas.eu"));
|
2017-10-02 01:40:14 +01:00
|
|
|
aboutData.addCredit(xi18nc("@info:credit", "Teo Mrnjavac"), i18nc("@info:credit", "Former Calamares maintainer"), QStringLiteral("teo@kde.org"));
|
|
|
|
aboutData.addCredit(xi18nc("@info:credit", "Chantara Tith"), i18nc("@info:credit", "LVM support"), QStringLiteral("tith.chantara@gmail.com"));
|
|
|
|
aboutData.addCredit(xi18nc("@info:credit", "Pali Rohár"), i18nc("@info:credit", "UDF support"), QStringLiteral("pali.rohar@gmail.com"));
|
2016-07-12 23:59:01 +01:00
|
|
|
aboutData.setHomepage(QStringLiteral("https://www.kde.org/applications/system/kdepartitionmanager"));
|
2015-07-13 15:17:41 +01:00
|
|
|
|
2016-08-15 16:57:43 +01:00
|
|
|
aboutData.addCredit(i18n("Hugo Pereira Da Costa"), xi18nc("@info:credit", "Partition Widget Design"), QStringLiteral("hugo@oxygen-icons.org"));
|
2016-07-12 23:59:01 +01:00
|
|
|
KAboutData::setApplicationData(aboutData);
|
2015-07-13 15:17:41 +01:00
|
|
|
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
|
2015-12-05 19:25:04 +00:00
|
|
|
KCrash::initialize();
|
2015-07-13 15:17:41 +01:00
|
|
|
|
|
|
|
QCommandLineParser parser;
|
2016-07-12 23:59:01 +01:00
|
|
|
aboutData.setupCommandLine(&parser);
|
2018-01-16 14:14:18 +00:00
|
|
|
// FIXME parser.addPositionalArgument(QStringLiteral("device"), xi18nc("@info:shell", "Device(s) to manage"), QStringLiteral("[device...]"));
|
2015-07-13 15:17:41 +01:00
|
|
|
|
|
|
|
parser.process(app);
|
2016-07-12 23:59:01 +01:00
|
|
|
aboutData.processCommandLine(&parser);
|
2015-07-13 15:17:41 +01:00
|
|
|
|
2018-03-24 22:24:26 +00:00
|
|
|
KDBusService service(KDBusService::Unique);
|
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
registerMetaTypes();
|
|
|
|
|
|
|
|
Config::instance(QStringLiteral("partitionmanagerrc"));
|
|
|
|
|
|
|
|
if (!loadBackend())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
MainWindow* mainWindow = new MainWindow();
|
|
|
|
mainWindow->show();
|
|
|
|
|
|
|
|
return app.exec();
|
2008-09-24 20:32:01 +01:00
|
|
|
}
|