on xenial help sign in
Merge from dash-app-fixes
commitf80968c6730685638e5851a8b485dc7c4ae44f26 authorMichael Terry <michael.terry@canonical.com> dateWed 6 Aug 2014, 10:04 (12 years ago) parent4b6a6fbfefbcf0
3 files changed+33−4
qml/Dash/DashApplication.qml+6 src/Dash/CMakeLists.txt+1 src/Dash/main.cpp+26−4
qml/Dash/DashApplication.qml+6
@@ -23,6 +23,12 @@ MainView {
2323
2424 useDeprecatedToolbar: false
2525
26+ Binding {
27+ target: i18n
28+ property: "domain"
29+ value: "unity8"
30+ }
31+
2632 Dash {
2733 anchors.fill: parent
2834 }
src/Dash/CMakeLists.txt+1
@@ -1,5 +1,6 @@
11set(DASH_SRCS
22 main.cpp
3+ ../MouseTouchAdaptor.cpp
34)
45
56add_executable(unity8-dash ${DASH_SRCS})
src/Dash/main.cpp+26−4
@@ -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());