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"
|
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
#include <kapplication.h>
|
|
|
|
#include <kcmdlineargs.h>
|
2010-03-01 11:02:38 +00:00
|
|
|
#include <kmessagebox.h>
|
2010-03-21 10:50:44 +00:00
|
|
|
#include <kaboutdata.h>
|
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>
|
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2008-12-27 22:12:42 +00:00
|
|
|
KCmdLineArgs::init(argc, argv, createPartitionManagerAboutData());
|
2009-11-23 18:27:21 +00:00
|
|
|
KCmdLineOptions options;
|
|
|
|
options.add("dontsu", ki18nc("@info:shell", "Do not try to gain super user privileges"));
|
2010-06-02 21:39:25 +01:00
|
|
|
options.add("advconfig", ki18nc("@info:shell", "Show advanced tab in configuration dialog"));
|
2010-05-21 19:09:55 +01:00
|
|
|
options.add("+[device]", ki18nc("@info:shell", "Device(s) to manage"));
|
2009-11-23 18:27:21 +00:00
|
|
|
KCmdLineArgs::addCmdLineOptions(options);
|
2008-09-24 20:32:01 +01:00
|
|
|
|
|
|
|
KApplication app;
|
|
|
|
|
|
|
|
registerMetaTypes();
|
|
|
|
if (!checkPermissions())
|
|
|
|
return 0;
|
|
|
|
|
2010-03-09 17:13:22 +00:00
|
|
|
Config::instance("partitionmanagerrc");
|
|
|
|
|
2010-03-21 10:50:44 +00:00
|
|
|
if (!loadBackend())
|
2010-03-01 11:02:38 +00:00
|
|
|
return 0;
|
|
|
|
|
2011-08-29 11:51:42 +01:00
|
|
|
if (!checkAccessibleDevices())
|
|
|
|
return 0;
|
2014-05-17 03:34:51 +01:00
|
|
|
|
2008-09-24 20:32:01 +01:00
|
|
|
MainWindow* mainWindow = new MainWindow();
|
|
|
|
mainWindow->show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|