File indexing completed on 2024-03-24 05:50:38
0001 /******************************************************************************* 0002 * Copyright (C) 2016 Ragnar Thomsen <rthomsen6@gmail.com> * 0003 * * 0004 * This program is free software: you can redistribute it and/or modify it * 0005 * under the terms of the GNU General Public License as published by the Free * 0006 * Software Foundation, either version 2 of the License, or (at your option) * 0007 * any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, but WITHOUT * 0010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 0011 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * 0012 * more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License along * 0015 * with this program. If not, see <http://www.gnu.org/licenses/>. * 0016 *******************************************************************************/ 0017 0018 #include "systemdgenie_version.h" 0019 #include "mainwindow.h" 0020 0021 #include <QApplication> 0022 #include <QCommandLineParser> 0023 #include <QDebug> 0024 0025 #include <KAboutData> 0026 #include <KCrash> 0027 #include <KLocalizedString> 0028 0029 int main(int argc, char *argv[]) 0030 { 0031 QApplication application(argc, argv); 0032 0033 /** 0034 * enable high dpi support 0035 */ 0036 application.setAttribute(Qt::AA_UseHighDpiPixmaps, true); 0037 0038 KCrash::initialize(); 0039 0040 KLocalizedString::setApplicationDomain("systemdgenie"); 0041 0042 KAboutData aboutData(QStringLiteral("systemdgenie"), 0043 i18n("SystemdGenie"), 0044 QStringLiteral(SYSTEMDGENIE_VERSION_STRING), 0045 i18n("Systemd management utility"), 0046 KAboutLicense::GPL, 0047 i18n("(c) 2016, Ragnar Thomsen"), 0048 QString(), 0049 QString() 0050 ); 0051 0052 aboutData.setOrganizationDomain("kde.org"); 0053 0054 aboutData.addAuthor(i18n("Ragnar Thomsen"), 0055 i18n("Maintainer"), 0056 QStringLiteral("rthomsen6@gmail.com")); 0057 0058 application.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop"))); 0059 0060 QCommandLineParser parser; 0061 parser.setApplicationDescription(aboutData.shortDescription()); 0062 parser.addHelpOption(); 0063 parser.addVersionOption(); 0064 0065 aboutData.setupCommandLine(&parser); 0066 0067 KAboutData::setApplicationData(aboutData); 0068 0069 // Do the command line parsing. 0070 parser.process(application); 0071 0072 // Handle standard options. 0073 aboutData.processCommandLine(&parser); 0074 0075 MainWindow *window = new MainWindow; 0076 window->show(); 0077 0078 qDebug() << "Entering application loop"; 0079 return application.exec(); 0080 }