X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=HomeScreen%2Fsrc%2Fmain.cpp;h=47d4f1617c8067d49fbf5cd24d68bb41b7fae917;hb=09f2f0036f122e49aa49e6c446d723850192a725;hp=c1f951ef004bab3aa794a85cfaee32df4dd4517a;hpb=b0632b0a5cd7e31c79c4a81764ebed329114a983;p=staging%2FHomeScreen.git diff --git a/HomeScreen/src/main.cpp b/HomeScreen/src/main.cpp index c1f951e..47d4f16 100644 --- a/HomeScreen/src/main.cpp +++ b/HomeScreen/src/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,30 +14,45 @@ * limitations under the License. */ -#include "mainwindow.h" -#include +#include +#include #include #include #include #include -#include "../src2/applicationlauncher.h" -#include "../src2/statusbarmodel.h" #include "layouthandler.h" -#include "../src2/applicationmodel.h" #include "homescreencontrolinterface.h" +#include "applicationlauncher.h" +#include "statusbarmodel.h" +#include "applicationmodel.h" + +void noOutput(QtMsgType, const QMessageLogContext &, const QString &) +{ +} int main(int argc, char *argv[]) { - QApplication a(argc, argv); + QGuiApplication a(argc, argv); - // used for application settings (QSettings) QCoreApplication::setOrganizationDomain("LinuxFoundation"); QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); QCoreApplication::setApplicationName("HomeScreen"); - QCoreApplication::setApplicationVersion("0.6.0"); + QCoreApplication::setApplicationVersion("0.7.0"); + + QCommandLineParser parser; + parser.setApplicationDescription("AGL HomeScreen - see wwww... for more details"); + parser.addHelpOption(); + parser.addVersionOption(); + QCommandLineOption quietOption(QStringList() << "q" << "quiet", + QCoreApplication::translate("main", "Be quiet. No outputs.")); + parser.addOption(quietOption); + parser.process(a); - qDebug("%s, v%s", QCoreApplication::applicationName().toStdString().c_str(), QCoreApplication::applicationVersion().toStdString().c_str()); + if (parser.isSet(quietOption)) + { + qInstallMessageHandler(noOutput); + } qDBusRegisterMetaType(); qDBusRegisterMetaType >(); @@ -51,7 +66,6 @@ int main(int argc, char *argv[]) LayoutHandler* layoutHandler = new LayoutHandler(); HomeScreenControlInterface* hsci = new HomeScreenControlInterface(); - // QObject::connect(hsci, SIGNAL(newRequestGetAllSurfacesOfProcess(int)), layoutHandler, SLOT(requestGetAllSurfacesOfProcess(int))); QObject::connect(hsci, SIGNAL(newRequestGetSurfaceStatus(int)), layoutHandler, SLOT(requestGetSurfaceStatus(int))); QObject::connect(hsci, SIGNAL(newRequestsToBeVisibleApp(int)), layoutHandler, SLOT(makeMeVisible(int))); QObject::connect(hsci, SIGNAL(newRequestRenderSurfaceToArea(int, int)), layoutHandler, SLOT(requestRenderSurfaceToArea(int,int)));