on xenial help sign in
Fixes for dash as app
f60bab3Albert Astals
qml/Dash/DashApplication.qml+6
@@ -23,6 +23,12 @@ MainView {
23
23
24 useDeprecatedToolbar: false
24 useDeprecatedToolbar: false
25
25
26+ Binding {
27+ target: i18n
28+ property: "domain"
29+ value: "unity8"
30+ }
31+
26 Dash {
32 Dash {
27 anchors.fill: parent
33 anchors.fill: parent
28 }
34 }
src/Dash/CMakeLists.txt+1
@@ -1,5 +1,6 @@
1set(DASH_SRCS
1set(DASH_SRCS
2 main.cpp
2 main.cpp
3+ ../MouseTouchAdaptor.cpp
3)
4)
4
5
5add_executable(unity8-dash ${DASH_SRCS})
6add_executable(unity8-dash ${DASH_SRCS})
src/Dash/main.cpp+24
@@ -26,6 +26,7 @@
26#include <QLibrary>
26#include <QLibrary>
27
27
28#include <paths.h>
28#include <paths.h>
29+#include "../MouseTouchAdaptor.h"
29
30
30int main(int argc, const char *argv[])
31int main(int argc, const char *argv[])
31{
32{
@@ -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();
37
38
39+ QCommandLineOption mousetouchOption("mousetouch",
40+ "Allow the mouse to provide touch input");
41+ parser.addOption(mousetouchOption);
42+
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);
41
46
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+
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[])
54 }
68 }
55 }
69 }
56
70
71+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
72+
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");
60
76
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+
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());