2008-09-24 20:32:01 +01:00
|
|
|
/***************************************************************************
|
2011-08-28 19:35:03 +01:00
|
|
|
* Copyright (C) 2008,2011 by Volker Lanz <vl@fidra.de> *
|
2008-09-24 20:32:01 +01:00
|
|
|
* *
|
|
|
|
* 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; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "gui/mainwindow.h"
|
|
|
|
|
2010-03-01 11:02:38 +00:00
|
|
|
#include "backend/corebackend.h"
|
2010-03-21 10:50:44 +00:00
|
|
|
#include "backend/corebackendmanager.h"
|
2010-03-01 11:02:38 +00:00
|
|
|
|
2008-12-27 22:12:42 +00:00
|
|
|
#include "util/helpers.h"
|
|
|
|
|
2014-05-18 21:41:48 +01:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QCommandLineParser>
|
|
|
|
|
|
|
|
#include <KAboutData>
|
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
|
|
|
|
2010-03-09 17:13:22 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
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
|
|
|
{
|
2014-11-14 21:56:44 +00:00
|
|
|
Kdelibs4ConfigMigrator migrate(QLatin1Literal("partitionmanager"));
|
|
|
|
migrate.setConfigFiles(QStringList() << QLatin1Literal("partitionmanagerrc"));
|
2014-11-19 12:05:22 +00:00
|
|
|
migrate.setUiFiles(QStringList() << QStringLiteral("partitionmanagerui.rc"));
|
2014-11-14 21:56:44 +00:00
|
|
|
migrate.migrate();
|
|
|
|
|
2014-05-18 21:41:48 +01:00
|
|
|
QApplication app(argc, argv);
|
2014-10-19 15:55:29 +01:00
|
|
|
KLocalizedString::setApplicationDomain("partitionmanager");
|
2014-05-18 21:41:48 +01:00
|
|
|
KAboutData *aboutData = createPartitionManagerAboutData();
|
|
|
|
KAboutData::setApplicationData(*aboutData);
|
|
|
|
|
|
|
|
QCommandLineParser parser;
|
|
|
|
parser.setApplicationDescription( aboutData->shortDescription() );
|
|
|
|
parser.addHelpOption();
|
|
|
|
parser.addVersionOption();
|
|
|
|
parser.addOption( QCommandLineOption( QLatin1Literal("dontsu"), i18nc("@info:shell", "Do not try to gain super user privileges")));
|
|
|
|
parser.addOption( QCommandLineOption( QLatin1Literal("advconfig"), i18nc("@info:shell", "Show advanced tab in configuration dialog")));
|
|
|
|
parser.addPositionalArgument( QStringLiteral("device"), i18nc("@info:shell", "Device(s) to manage"), QStringLiteral("[device...]") );
|
|
|
|
|
|
|
|
parser.process(app);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
registerMetaTypes();
|
|
|
|
if (!checkPermissions())
|
|
|
|
return 0;
|
|
|
|
|
2014-05-20 22:33:02 +01:00
|
|
|
Config::instance(QStringLiteral("partitionmanagerrc"));
|
2010-03-09 17:13:22 +00:00
|
|
|
|
2010-03-21 10:50:44 +00:00
|
|
|
if (!loadBackend())
|
2010-03-01 11:02:38 +00:00
|
|
|
return 0;
|
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
MainWindow* mainWindow = new MainWindow();
|
|
|
|
mainWindow->show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|