on xenial help sign in
Command line parser works for mousetouch, and frameless
commit8b34afbf127b191a3ef4627886c1ed63683eab52 authorJosh Arenson <joshua.arenson@canonical.com> dateMon 21 Apr 2014, 16:22 (12 years ago) parent2b30e6e
1 file changed+15−6
src/main.cpp+15−6
src/main.cpp+15−6
@@ -46,13 +46,22 @@ int startShell(int argc, const char** argv, void* server)
4646 QGuiApplication *application;
4747
4848 QCommandLineParser parser;
49− parser.setApplicationDescription("Application Description Goes Here!");
49+ parser.setApplicationDescription("Description: Unity 8 Shell");
5050 parser.addHelpOption();
51−
52− QCommandLineOption fullscreenOption (QStringList() << "f" << "fullscreen",
53− "Run in fullscreen");
51+
52+ QCommandLineOption fullscreenOption ("fullscreen",
53+ QCoreApplication::translate("fullscreen","Run in fullscreen"));
5454 parser.addOption(fullscreenOption);
5555
56+ QCommandLineOption framelessOption ("frameless",
57+ QCoreApplication::translate("frameless","Run without window borders"));
58+ parser.addOption(framelessOption);
59+
60+ QCommandLineOption mousetouchOption ("mousetouch",
61+ QCoreApplication::translate("mousetouch","Allow the mouse to provide touch input"));
62+ parser.addOption(mousetouchOption);
63+
64+
5665 if (isUbuntuMirServer) {
5766 QLibrary unityMir("unity-mir", 1);
5867 unityMir.load();
@@ -106,14 +115,14 @@ int startShell(int argc, const char** argv, void* server)
106115 view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()));
107116 view->rootContext()->setContextProperty("applicationArguments", &qmlArgs);
108117 view->rootContext()->setContextProperty("indicatorProfile", indicatorProfile);
109− if (args.contains(QLatin1String("-frameless"))) {
118+ if (parser.isSet(framelessOption)) {
110119 view->setFlags(Qt::FramelessWindowHint);
111120 }
112121
113122 // You will need this if you want to interact with touch-only components using a mouse
114123 // Needed only when manually testing on a desktop.
115124 MouseTouchAdaptor *mouseTouchAdaptor = 0;
116− if (args.contains(QLatin1String("-mousetouch"))) {
125+ if (parser.isSet(mousetouchOption)) {
117126 mouseTouchAdaptor = new MouseTouchAdaptor;
118127 application->installNativeEventFilter(mouseTouchAdaptor);
119128 }