Merge lp:~aacid/unity8/dash-app-fixes into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1119
Merged at revision: 1129
Proposed branch: lp:~aacid/unity8/dash-app-fixes
Merge into: lp:unity8
Diff against target: 268 lines (+61/-43)
7 files modified
qml/Components/EdgeDemo.qml (+15/-15)
qml/Dash/Dash.qml (+8/-0)
qml/Dash/DashApplication.qml (+6/-0)
qml/Greeter/Greeter.qml (+1/-1)
qml/Shell.qml (+3/-22)
src/Dash/CMakeLists.txt (+1/-0)
src/Dash/main.cpp (+27/-5)
To merge this branch: bzr merge lp:~aacid/unity8/dash-app-fixes
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+229745@code.launchpad.net

Commit message

Fixes for dash as app

Load i18n catalog
Process command line options
Add the posibility to have a mouse touch adaptor

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
lp:~aacid/unity8/dash-app-fixes updated
1115. By Albert Astals Cid

Build

Revision history for this message
Michał Sawicz (saviq) wrote :

Let's drop the --testability option, we only want to support QT_LOAD_TESTABILITY anyway.

review: Needs Fixing
lp:~aacid/unity8/dash-app-fixes updated
1116. By Albert Astals Cid

Fixme as requested by Saviq

1117. By Albert Astals Cid

drop -testability support

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Let's drop the --testability option, we only want to support
> QT_LOAD_TESTABILITY anyway.

Done.

lp:~aacid/unity8/dash-app-fixes updated
1118. By Albert Astals Cid

Bring the dash background from the shell to the dash

1119. By Albert Astals Cid

Merge lp:~mterry/unity8/dash-app-demo-fixes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes.

 * Did CI run pass? If not, please explain why.
Passed locally.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/EdgeDemo.qml'
2--- qml/Components/EdgeDemo.qml 2014-07-23 10:16:29 +0000
3+++ qml/Components/EdgeDemo.qml 2014-08-06 14:41:59 +0000
4@@ -24,13 +24,13 @@
5 property Item greeter
6 property Item launcher
7 property Item indicators
8- property Item underlay
9+ property Item stages
10
11 property bool launcherEnabled: true
12- property bool dashEnabled: true
13+ property bool stagesEnabled: true
14 property bool panelEnabled: true
15 property bool panelContentEnabled: true
16- property bool running: !launcherEnabled || !dashEnabled || !panelEnabled || !panelContentEnabled
17+ property bool running: !launcherEnabled || !stagesEnabled || !panelEnabled || !panelContentEnabled
18
19 property bool paused: false
20
21@@ -58,7 +58,7 @@
22
23 function stopDemo() {
24 launcherEnabled = true
25- dashEnabled = true
26+ stagesEnabled = true
27 panelEnabled = true
28 panelContentEnabled = true
29 if (d.rightEdgeDemo) d.rightEdgeDemo.destroy()
30@@ -74,11 +74,11 @@
31 }
32
33 launcherEnabled = false;
34- dashEnabled = false;
35+ stagesEnabled = false;
36 panelEnabled = false;
37 panelContentEnabled = false;
38
39- // Begin with either greeter or dash, depending on which is visible
40+ // Begin with either greeter or top, depending on which is visible
41 if (greeter && greeter.shown) {
42 startRightEdgeDemo()
43 } else {
44@@ -138,12 +138,12 @@
45
46 function startTopEdgeDemo() {
47 demo.panelEnabled = true;
48- if (demo.dash && demo.underlay) {
49- d.topEdgeDemo = d.overlay.createObject(demo.underlay, {
50+ if (demo.stages) {
51+ d.topEdgeDemo = d.overlay.createObject(demo.stages, {
52 "edge": "top",
53 "title": i18n.tr("Top edge"),
54 "text": i18n.tr("Try swiping from the top edge to access the indicators"),
55- "anchors.fill": demo.underlay,
56+ "anchors.fill": demo.stages,
57 });
58 }
59 if (d.topEdgeDemo) {
60@@ -192,12 +192,12 @@
61 function startLeftEdgeDemo() {
62 demo.panelEnabled = false;
63 demo.launcherEnabled = true;
64- if (demo.underlay) {
65- d.leftEdgeDemo = d.overlay.createObject(demo.underlay, {
66+ if (demo.stages) {
67+ d.leftEdgeDemo = d.overlay.createObject(demo.stages, {
68 "edge": "left",
69 "title": i18n.tr("Left edge"),
70 "text": i18n.tr("Swipe from the left to reveal the launcher for quick access to apps"),
71- "anchors.fill": demo.underlay,
72+ "anchors.fill": demo.stages,
73 });
74 }
75 if (d.leftEdgeDemo) {
76@@ -220,12 +220,12 @@
77
78 function startFinalEdgeDemo() {
79 demo.launcherEnabled = false;
80- if (demo.underlay) {
81- d.finalEdgeDemo = d.overlay.createObject(demo.underlay, {
82+ if (demo.stages) {
83+ d.finalEdgeDemo = d.overlay.createObject(demo.stages, {
84 "edge": "none",
85 "title": i18n.tr("Well done"),
86 "text": i18n.tr("You have now mastered the edge gestures and can start using the phone<br><br>Tap on the screen to start"),
87- "anchors.fill": demo.underlay,
88+ "anchors.fill": demo.stages,
89 "showSkip": false,
90 });
91 }
92
93=== modified file 'qml/Dash/Dash.qml'
94--- qml/Dash/Dash.qml 2014-07-29 11:35:10 +0000
95+++ qml/Dash/Dash.qml 2014-08-06 14:41:59 +0000
96@@ -74,6 +74,14 @@
97 filterRegExp: RegExp("^true$")
98 }
99
100+ Image {
101+ anchors.fill: parent
102+ source: parent.width > parent.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
103+ fillMode: Image.PreserveAspectCrop
104+ horizontalAlignment: Image.AlignRight
105+ verticalAlignment: Image.AlignTop
106+ }
107+
108 DashContent {
109 id: dashContent
110 objectName: "dashContent"
111
112=== modified file 'qml/Dash/DashApplication.qml'
113--- qml/Dash/DashApplication.qml 2014-07-29 14:28:16 +0000
114+++ qml/Dash/DashApplication.qml 2014-08-06 14:41:59 +0000
115@@ -23,6 +23,12 @@
116
117 useDeprecatedToolbar: false
118
119+ Binding {
120+ target: i18n
121+ property: "domain"
122+ value: "unity8"
123+ }
124+
125 Dash {
126 anchors.fill: parent
127 }
128
129=== modified file 'qml/Greeter/Greeter.qml'
130--- qml/Greeter/Greeter.qml 2014-07-22 14:46:01 +0000
131+++ qml/Greeter/Greeter.qml 2014-08-06 14:41:59 +0000
132@@ -70,7 +70,7 @@
133 DraggingArea {
134 id: dragHandle
135 anchors.fill: parent
136- enabled: (greeter.narrowMode || !greeter.locked) && greeter.enabled
137+ enabled: (greeter.narrowMode || !greeter.locked) && greeter.enabled && greeter.shown
138 orientation: Qt.Horizontal
139 propagateComposedEvents: true
140
141
142=== modified file 'qml/Shell.qml'
143--- qml/Shell.qml 2014-08-05 12:06:16 +0000
144+++ qml/Shell.qml 2014-08-06 14:41:59 +0000
145@@ -113,25 +113,6 @@
146 }
147
148 Item {
149- id: underlay
150- objectName: "underlay"
151- anchors.fill: parent
152-
153- // Whether the underlay is fully covered by opaque UI elements.
154- property bool fullyCovered: (panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
155- || stages.fullyShown || greeterWrapper.fullyShown
156- visible: !fullyCovered
157-
158- Image {
159- anchors.fill: underlay
160- source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
161- fillMode: Image.PreserveAspectCrop
162- horizontalAlignment: Image.AlignRight
163- verticalAlignment: Image.AlignTop
164- }
165- }
166-
167- Item {
168 id: stages
169 objectName: "stages"
170 width: parent.width
171@@ -186,12 +167,12 @@
172 Binding {
173 target: applicationsDisplayLoader.item
174 property: "interactive"
175- value: !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0
176+ value: edgeDemo.stagesEnabled && !greeter.shown && !lockscreen.shown && panel.indicators.fullyClosed && launcher.progress == 0
177 }
178 Binding {
179 target: applicationsDisplayLoader.item
180 property: "spreadEnabled"
181- value: greeter.fakeActiveForApp === "" // to support emergency dialer hack
182+ value: edgeDemo.stagesEnabled && greeter.fakeActiveForApp === "" // to support emergency dialer hack
183 }
184 Binding {
185 target: applicationsDisplayLoader.item
186@@ -580,7 +561,7 @@
187 greeter: greeter
188 launcher: launcher
189 indicators: panel.indicators
190- underlay: underlay
191+ stages: stages
192 }
193
194 Connections {
195
196=== modified file 'src/Dash/CMakeLists.txt'
197--- src/Dash/CMakeLists.txt 2014-07-23 06:54:10 +0000
198+++ src/Dash/CMakeLists.txt 2014-08-06 14:41:59 +0000
199@@ -1,5 +1,6 @@
200 set(DASH_SRCS
201 main.cpp
202+ ../MouseTouchAdaptor.cpp
203 )
204
205 add_executable(unity8-dash ${DASH_SRCS})
206
207=== modified file 'src/Dash/main.cpp'
208--- src/Dash/main.cpp 2014-07-29 11:35:10 +0000
209+++ src/Dash/main.cpp 2014-08-06 14:41:59 +0000
210@@ -24,8 +24,10 @@
211 #include <QDebug>
212 #include <QCommandLineParser>
213 #include <QLibrary>
214+#include <libintl.h>
215
216 #include <paths.h>
217+#include "../MouseTouchAdaptor.h"
218
219 int main(int argc, const char *argv[])
220 {
221@@ -35,11 +37,21 @@
222 parser.setApplicationDescription("Description: Unity 8 Shell Dash");
223 parser.addHelpOption();
224
225- QCommandLineOption testabilityOption("testability",
226- "Load the testability driver (Alternatively export QT_LOAD_TESTABILITY");
227- parser.addOption(testabilityOption);
228-
229- if (parser.isSet(testabilityOption) || getenv("QT_LOAD_TESTABILITY")) {
230+ QCommandLineOption mousetouchOption("mousetouch",
231+ "Allow the mouse to provide touch input");
232+ parser.addOption(mousetouchOption);
233+
234+ // FIXME Remove once we drop the need of the hint
235+ QCommandLineOption desktopFileHintOption("desktop_file_hint",
236+ "The desktop_file_hint option for QtMir", "hint_file");
237+ parser.addOption(desktopFileHintOption);
238+
239+ // Treat args with single dashes the same as arguments with two dashes
240+ // Ex: -fullscreen == --fullscreen
241+ parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
242+ parser.process(*application);
243+
244+ if (getenv("QT_LOAD_TESTABILITY")) {
245 QLibrary testLib(QLatin1String("qttestability"));
246 if (testLib.load()) {
247 typedef void (*TasInitialize)(void);
248@@ -54,10 +66,20 @@
249 }
250 }
251
252+ bindtextdomain("unity8", translationDirectory().toUtf8().data());
253+
254 QQuickView* view = new QQuickView();
255 view->setResizeMode(QQuickView::SizeRootObjectToView);
256 view->setTitle("Unity Dash");
257
258+ // You will need this if you want to interact with touch-only components using a mouse
259+ // Needed only when manually testing on a desktop.
260+ MouseTouchAdaptor *mouseTouchAdaptor = 0;
261+ if (parser.isSet(mousetouchOption)) {
262+ mouseTouchAdaptor = new MouseTouchAdaptor;
263+ application->installNativeEventFilter(mouseTouchAdaptor);
264+ }
265+
266 QUrl source(::qmlDirectory()+"Dash/DashApplication.qml");
267 prependImportPaths(view->engine(), ::overrideImportPaths());
268 appendImportPaths(view->engine(), ::fallbackImportPaths());

Subscribers

People subscribed via source and target branches