@@ -26,6 +26,7 @@
2626#include <QLibrary>
2727
2828#include <paths.h>
29+#include "../MouseTouchAdaptor.h"
2930
3031int main(int argc, const char *argv[])
3132{
@@ -35,10 +36,23 @@ int main(int argc, const char *argv[])
3536 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
3637 parser.addHelpOption();
3738
39+ QCommandLineOption mousetouchOption("mousetouch",
40+ "Allow the mouse to provide touch input");
41+ parser.addOption(mousetouchOption);
42+
3843 QCommandLineOption testabilityOption("testability",
3944 "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");
4045 parser.addOption(testabilityOption);
4146
47+ QCommandLineOption desktopFileHintOption("desktop_file_hint",
48+ "The desktop_file_hint option for QtMir", "hint_file");
49+ parser.addOption(desktopFileHintOption);
50+
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);
55+
4256 if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {
4357 QLibrary testLib(QLatin1String("qttestability"));
4458 if (testLib.load()) {
@@ -54,10 +68,20 @@ int main(int argc, const char *argv[])
5468 }
5569 }
5670
71+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
72+
5773 QQuickView* view = new QQuickView();
5874 view->setResizeMode(QQuickView::SizeRootObjectToView);
5975 view->setTitle("Unity Dash");
6076
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);
83+ }
84+
6185 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
6286 prependImportPaths(view->engine(), ::overrideImportPaths());
6387 appendImportPaths(view->engine(), ::fallbackImportPaths());