@@ -24,8 +24,10 @@
2424#include <QDebug>
2525#include <QCommandLineParser>
2626#include <QLibrary>
27+#include <libintl.h>
2728
2829#include <paths.h>
30+#include "../MouseTouchAdaptor.h"
2931
3032int main(int argc, const char *argv[])
3133{
@@ -35,11 +37,21 @@ int main(int argc, const char *argv[])
3537 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
3638 parser.addHelpOption();
3739
38− QCommandLineOption testabilityOption("testability",
39− "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");
40− parser.addOption(testabilityOption);
40+ QCommandLineOption mousetouchOption("mousetouch",
41+ "Allow the mouse to provide touch input");
42+ parser.addOption(mousetouchOption);
4143
42− if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {
44+ // FIXME Remove once we drop the need of the hint
45+ QCommandLineOption desktopFileHintOption("desktop_file_hint",
46+ "The desktop_file_hint option for QtMir", "hint_file");
47+ parser.addOption(desktopFileHintOption);
48+
49+ // Treat args with single dashes the same as arguments with two dashes
50+ // Ex: -fullscreen == --fullscreen
51+ parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
52+ parser.process(*application);
53+
54+ if (getenv("QT_LOAD_TESTABILITY")) {
4355 QLibrary testLib(QLatin1String("qttestability"));
4456 if (testLib.load()) {
4557 typedef void (*TasInitialize)(void);
@@ -54,10 +66,20 @@ int main(int argc, const char *argv[])
5466 }
5567 }
5668
69+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
70+
5771 QQuickView* view = new QQuickView();
5872 view->setResizeMode(QQuickView::SizeRootObjectToView);
5973 view->setTitle("Unity Dash");
6074
75+ // You will need this if you want to interact with touch-only components using a mouse
76+ // Needed only when manually testing on a desktop.
77+ MouseTouchAdaptor *mouseTouchAdaptor = 0;
78+ if (parser.isSet(mousetouchOption)) {
79+ mouseTouchAdaptor = new MouseTouchAdaptor;
80+ application->installNativeEventFilter(mouseTouchAdaptor);
81+ }
82+
6183 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
6284 prependImportPaths(view->engine(), ::overrideImportPaths());
6385 appendImportPaths(view->engine(), ::fallbackImportPaths());