@@ -26,6 +26,7 @@
26#include <QLibrary>
26#include <QLibrary>
28#include <paths.h>
28#include <paths.h>
29+#include "../MouseTouchAdaptor.h"
30int main(int argc, const char *argv[])
31int main(int argc, const char *argv[])
@@ -35,10 +36,23 @@ int main(int argc, const char *argv[])
35 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
36 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
36 parser.addHelpOption();
37 parser.addHelpOption();
39+ QCommandLineOption mousetouchOption("mousetouch",
40+ "Allow the mouse to provide touch input");
41+ parser.addOption(mousetouchOption);
38 QCommandLineOption testabilityOption("testability",
43 QCommandLineOption testabilityOption("testability",
39 "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");
44 "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");
40 parser.addOption(testabilityOption);
45 parser.addOption(testabilityOption);
47+ QCommandLineOption desktopFileHintOption("desktop_file_hint",
48+ "The desktop_file_hint option for QtMir", "hint_file");
49+ parser.addOption(desktopFileHintOption);
51+ // Treat args with single dashes the same as arguments with two dashes
52+ // Ex: -fullscreen == --fullscreen
53+ parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
54+ parser.process(*application);
42 if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {
56 if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {
43 QLibrary testLib(QLatin1String("qttestability"));
57 QLibrary testLib(QLatin1String("qttestability"));
44 if (testLib.load()) {
58 if (testLib.load()) {
@@ -54,10 +68,20 @@ int main(int argc, const char *argv[])
71+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
57 QQuickView* view = new QQuickView();
73 QQuickView* view = new QQuickView();
58 view->setResizeMode(QQuickView::SizeRootObjectToView);
74 view->setResizeMode(QQuickView::SizeRootObjectToView);
59 view->setTitle("Unity Dash");
75 view->setTitle("Unity Dash");
77+ // You will need this if you want to interact with touch-only components using a mouse
78+ // Needed only when manually testing on a desktop.
79+ MouseTouchAdaptor *mouseTouchAdaptor = 0;
80+ if (parser.isSet(mousetouchOption)) {
81+ mouseTouchAdaptor = new MouseTouchAdaptor;
82+ application->installNativeEventFilter(mouseTouchAdaptor);
61 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
85 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
62 prependImportPaths(view->engine(), ::overrideImportPaths());
86 prependImportPaths(view->engine(), ::overrideImportPaths());
63 appendImportPaths(view->engine(), ::fallbackImportPaths());
87 appendImportPaths(view->engine(), ::fallbackImportPaths());