on xenial help sign in
Releasing 8.02+15.04.20150216.1-0ubuntu1.
61022bcRobert Bruce Park
CMakeLists.txt+1
@@ -54,6 +54,7 @@ find_package(Qt5Quick 5.2 REQUIRED)
54find_package(Qt5Gui 5.2 REQUIRED)
54find_package(Qt5Gui 5.2 REQUIRED)
55find_package(Qt5DBus 5.2 REQUIRED)
55find_package(Qt5DBus 5.2 REQUIRED)
56find_package(Qt5Concurrent 5.2 REQUIRED)
56find_package(Qt5Concurrent 5.2 REQUIRED)
57+find_package(Qt5Sql 5.2 REQUIRED)
57
58
58# Standard install paths
59# Standard install paths
59include(GNUInstallDirs)
60include(GNUInstallDirs)
debian/changelog+20
@@ -1,3 +1,23 @@
1+unity8 (8.02+15.04.20150216.1-0ubuntu1) vivid; urgency=medium
2+
3+ [ Andrea Cimitan ]
4+ * Fix temp scopes opening temp scopes, correctly close previously
5+ opened temp scope with its preview (LP: #1410337)
6+ * Set sourcesize for scopes images in manage dash
7+
8+ [ CI Train Bot ]
9+ * Resync trunk
10+
11+ [ Albert Astals Cid ]
12+ * Test for bug #1316660 (LP: #1316660)
13+ * Hardcode tranlsation for internal.location field (LP: #1393438)
14+ * Make sure the height it's the height it will have
15+
16+ [ Michael Zanetti ]
17+ * Cleanup cmake warning about missing Qt5Sql module
18+
19+ -- CI Train Bot <ci-train-bot@canonical.com> Mon, 16 Feb 2015 13:14:26 +0000
20+
1unity8 (8.02+15.04.20150211-0ubuntu2) vivid; urgency=medium
21unity8 (8.02+15.04.20150211-0ubuntu2) vivid; urgency=medium
2
22
3 * No-change rebuild against Qt 5.4.0.
23 * No-change rebuild against Qt 5.4.0.
debian/control+2−2
@@ -27,7 +27,7 @@ Build-Depends: cmake,
27 libqmenumodel-dev (>= 0.2.9),
27 libqmenumodel-dev (>= 0.2.9),
28 libqt5xmlpatterns5-dev,
28 libqt5xmlpatterns5-dev,
29 libsystemsettings-dev,
29 libsystemsettings-dev,
30− libunity-api-dev (>= 7.95),
30+ libunity-api-dev (>= 7.96),
31 libusermetricsoutput1-dev,
31 libusermetricsoutput1-dev,
32 libxcb1-dev,
32 libxcb1-dev,
33 pkg-config,
33 pkg-config,
@@ -126,7 +126,7 @@ Depends: qml-module-qtquick-layouts,
126 unity-application-impl-4,
126 unity-application-impl-4,
127 unity-notifications-impl-3,
127 unity-notifications-impl-3,
128 unity-plugin-scopes | unity-scopes-impl,
128 unity-plugin-scopes | unity-scopes-impl,
129− unity-scopes-impl-4,
129+ unity-scopes-impl-6,
130 unity8-fake-env | unity-application-impl,
130 unity8-fake-env | unity-application-impl,
131 ${misc:Depends},
131 ${misc:Depends},
132Breaks: unity8 (<< 7.86),
132Breaks: unity8 (<< 7.86),
po/unity8.pot+83−73
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2015-01-22 11:09+0100\n"
11+"POT-Creation-Date: 2015-02-13 11:45+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,7 +18,7 @@ msgstr ""
18"Content-Transfer-Encoding: 8bit\n"
18"Content-Transfer-Encoding: 8bit\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
20
21−#: plugins/LightDM/Greeter.cpp:130
21+#: plugins/LightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
23msgstr ""
23msgstr ""
24
24
@@ -106,52 +106,6 @@ msgstr ""
106msgid "Cancel"
106msgid "Cancel"
107msgstr ""
107msgstr ""
108
108
109−#: qml/Components/EdgeDemoOverlay.qml:151
110−msgid "Skip intro"
111−msgstr ""
112−
113−#: qml/Components/EdgeDemo.qml:125
114−msgid "Right edge"
115−msgstr ""
116−
117−#: qml/Components/EdgeDemo.qml:126
118−msgid "Try swiping from the right edge to unlock the phone"
119−msgstr ""
120−
121−#: qml/Components/EdgeDemo.qml:157
122−msgid "Top edge"
123−msgstr ""
124−
125−#: qml/Components/EdgeDemo.qml:158
126−msgid "Try swiping from the top edge to access the indicators"
127−msgstr ""
128−
129−#: qml/Components/EdgeDemo.qml:183
130−msgid "Close"
131−msgstr ""
132−
133−#: qml/Components/EdgeDemo.qml:184
134−msgid "Swipe up again to close the settings screen"
135−msgstr ""
136−
137−#: qml/Components/EdgeDemo.qml:214
138−msgid "Left edge"
139−msgstr ""
140−
141−#: qml/Components/EdgeDemo.qml:215
142−msgid "Swipe from the left to reveal the launcher for quick access to apps"
143−msgstr ""
144−
145−#: qml/Components/EdgeDemo.qml:242
146−msgid "Well done"
147−msgstr ""
148−
149−#: qml/Components/EdgeDemo.qml:243
150−msgid ""
151−"You have now mastered the edge gestures and can start using the "
152−"phone<br><br>Tap on the screen to start"
153−msgstr ""
154−
155#: qml/Components/Lockscreen.qml:238
109#: qml/Components/Lockscreen.qml:238
156msgid "Return to Call"
110msgid "Return to Call"
157msgstr ""
111msgstr ""
@@ -164,32 +118,32 @@ msgstr ""
164msgid "OK"
118msgid "OK"
165msgstr ""
119msgstr ""
166
120
167−#: qml/Dash/GenericScopeView.qml:485 qml/Dash/GenericScopeView.qml:642
121+#: qml/Dash/GenericScopeView.qml:528 qml/Dash/GenericScopeView.qml:686
168msgid "See less"
122msgid "See less"
169msgstr ""
123msgstr ""
170
124
171−#: qml/Dash/GenericScopeView.qml:485
125+#: qml/Dash/GenericScopeView.qml:528
172msgid "See all"
126msgid "See all"
173msgstr ""
127msgstr ""
174
128
175−#: qml/Dash/GenericScopeView.qml:547 qml/Dash/PageHeader.qml:274
129+#: qml/Dash/GenericScopeView.qml:590 qml/Dash/PageHeader.qml:276
176#: qml/Panel/SearchIndicator.qml:27
130#: qml/Panel/SearchIndicator.qml:27
177msgid "Search"
131msgid "Search"
178msgstr ""
132msgstr ""
179
133
180−#: qml/Dash/PageHeader.qml:267
134+#: qml/Dash/PageHeader.qml:269
181msgid "Store"
135msgid "Store"
182msgstr ""
136msgstr ""
183
137
184−#: qml/Dash/PageHeader.qml:284
138+#: qml/Dash/PageHeader.qml:286
185msgid "Settings"
139msgid "Settings"
186msgstr ""
140msgstr ""
187
141
188−#: qml/Dash/PageHeader.qml:291
142+#: qml/Dash/PageHeader.qml:293
189msgid "Remove from Favorites"
143msgid "Remove from Favorites"
190msgstr ""
144msgstr ""
191
145
192−#: qml/Dash/PageHeader.qml:291
146+#: qml/Dash/PageHeader.qml:293
193msgid "Add to Favorites"
147msgid "Add to Favorites"
194msgstr ""
148msgstr ""
195
149
@@ -221,6 +175,10 @@ msgstr ""
221msgid "Release to refresh…"
175msgid "Release to refresh…"
222msgstr ""
176msgstr ""
223
177
178+#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
179+msgid "Enable location data"
180+msgstr ""
181+
224#: qml/Dash/ScopesList.qml:66
182#: qml/Dash/ScopesList.qml:66
225msgid "Manage"
183msgid "Manage"
226msgstr ""
184msgstr ""
@@ -233,7 +191,7 @@ msgstr ""
233msgid "Also installed"
191msgid "Also installed"
234msgstr ""
192msgstr ""
235
193
236−#: qml/Greeter/Greeter.qml:133
194+#: qml/Greeter/Greeter.qml:141
237msgid "Unlock"
195msgid "Unlock"
238msgstr ""
196msgstr ""
239
197
@@ -289,60 +247,112 @@ msgstr ""
289msgid "Roaming"
247msgid "Roaming"
290msgstr ""
248msgstr ""
291
249
292−#: qml/Shell.qml:390
250+#: qml/Shell.qml:402
293#, qt-format
251#, qt-format
294msgid "Enter %1"
252msgid "Enter %1"
295msgstr ""
253msgstr ""
296
254
297−#: qml/Shell.qml:391 qml/Wizard/Pages/passwd-set.qml:60
255+#: qml/Shell.qml:403 qml/Wizard/Pages/passwd-set.qml:60
298msgid "Enter passphrase"
256msgid "Enter passphrase"
299msgstr ""
257msgstr ""
300
258
301−#: qml/Shell.qml:392
259+#: qml/Shell.qml:404
302msgid "Enter passcode"
260msgid "Enter passcode"
303msgstr ""
261msgstr ""
304
262
305−#: qml/Shell.qml:393
263+#: qml/Shell.qml:405
306#, qt-format
264#, qt-format
307msgid "Sorry, incorrect %1"
265msgid "Sorry, incorrect %1"
308msgstr ""
266msgstr ""
309
267
310−#: qml/Shell.qml:394
268+#: qml/Shell.qml:406
311msgid "Sorry, incorrect passphrase"
269msgid "Sorry, incorrect passphrase"
312msgstr ""
270msgstr ""
313
271
314−#: qml/Shell.qml:395
272+#: qml/Shell.qml:407
315msgid "Please re-enter"
273msgid "Please re-enter"
316msgstr ""
274msgstr ""
317
275
318−#: qml/Shell.qml:396
276+#: qml/Shell.qml:408
319msgid "Sorry, incorrect passcode"
277msgid "Sorry, incorrect passcode"
320msgstr ""
278msgstr ""
321
279
322−#: qml/Shell.qml:490 qml/Wizard/Pages/passwd-confirm.qml:53
280+#: qml/Shell.qml:502 qml/Wizard/Pages/passwd-confirm.qml:53
323msgid "Sorry, incorrect passphrase."
281msgid "Sorry, incorrect passphrase."
324msgstr ""
282msgstr ""
325
283
326−#: qml/Shell.qml:491 qml/Wizard/Pages/passwd-confirm.qml:54
284+#: qml/Shell.qml:503 qml/Wizard/Pages/passwd-confirm.qml:54
327msgid "Sorry, incorrect passcode."
285msgid "Sorry, incorrect passcode."
328msgstr ""
286msgstr ""
329
287
330−#: qml/Shell.qml:492
288+#: qml/Shell.qml:504
331msgid "This will be your last attempt."
289msgid "This will be your last attempt."
332msgstr ""
290msgstr ""
333
291
334−#: qml/Shell.qml:494
292+#: qml/Shell.qml:506
335msgid ""
293msgid ""
336"If passphrase is entered incorrectly, your phone will conduct a factory "
294"If passphrase is entered incorrectly, your phone will conduct a factory "
337"reset and all personal data will be deleted."
295"reset and all personal data will be deleted."
338msgstr ""
296msgstr ""
339
297
340−#: qml/Shell.qml:495
298+#: qml/Shell.qml:507
341msgid ""
299msgid ""
342"If passcode is entered incorrectly, your phone will conduct a factory reset "
300"If passcode is entered incorrectly, your phone will conduct a factory reset "
343"and all personal data will be deleted."
301"and all personal data will be deleted."
344msgstr ""
302msgstr ""
345
303
304+#: qml/Tutorial/TutorialBottomFinish.qml:24
305+msgid "This action does different things for different apps"
306+msgstr ""
307+
308+#: qml/Tutorial/TutorialBottomFinish.qml:25
309+msgid "Tap here to finish."
310+msgstr ""
311+
312+#: qml/Tutorial/TutorialBottom.qml:28
313+msgid "Open special menus"
314+msgstr ""
315+
316+#: qml/Tutorial/TutorialBottom.qml:29
317+msgid "Swipe up from the bottom edge."
318+msgstr ""
319+
320+#: qml/Tutorial/TutorialLeftFinish.qml:24
321+msgid "These are the shortcuts to favorite apps"
322+msgstr ""
323+
324+#: qml/Tutorial/TutorialLeftFinish.qml:25 qml/Tutorial/TutorialRight.qml:144
325+msgid "Tap here to continue."
326+msgstr ""
327+
328+#: qml/Tutorial/TutorialLeft.qml:26
329+msgid "Open the launcher"
330+msgstr ""
331+
332+#: qml/Tutorial/TutorialLeft.qml:27
333+msgid "Short swipe from the left edge."
334+msgstr ""
335+
336+#: qml/Tutorial/TutorialPage.qml:178
337+msgid "You almost got it!"
338+msgstr ""
339+
340+#: qml/Tutorial/TutorialPage.qml:195
341+msgid "Try again."
342+msgstr ""
343+
344+#: qml/Tutorial/TutorialRight.qml:31
345+msgid "To view open apps"
346+msgstr ""
347+
348+#: qml/Tutorial/TutorialRight.qml:32
349+msgid "Long swipe from the right edge."
350+msgstr ""
351+
352+#: qml/Tutorial/TutorialRight.qml:122
353+msgid "View all your running tasks."
354+msgstr ""
355+
346#: qml/Wizard/Page.qml:89
356#: qml/Wizard/Page.qml:89
347msgid "Back"
357msgid "Back"
348msgstr ""
358msgstr ""
@@ -360,7 +370,7 @@ msgid "Let’s get started."
360msgstr ""
370msgstr ""
361
371
362#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
372#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
363−#: qml/Wizard/Pages/40-wifi.qml:197 qml/Wizard/Pages/50-location.qml:131
373+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
364#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
374#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
365#: qml/Wizard/Pages/passwd-set.qml:90
375#: qml/Wizard/Pages/passwd-set.qml:90
366msgid "Continue"
376msgid "Continue"
@@ -374,7 +384,7 @@ msgstr ""
374msgid "Without it, you won’t be able to make calls or use text messaging."
384msgid "Without it, you won’t be able to make calls or use text messaging."
375msgstr ""
385msgstr ""
376
386
377−#: qml/Wizard/Pages/20-sim.qml:69 qml/Wizard/Pages/40-wifi.qml:197
387+#: qml/Wizard/Pages/20-sim.qml:69 qml/Wizard/Pages/40-wifi.qml:215
378msgid "Skip"
388msgid "Skip"
379msgstr ""
389msgstr ""
380
390
@@ -410,15 +420,15 @@ msgstr ""
410msgid "Numbers and letters"
420msgid "Numbers and letters"
411msgstr ""
421msgstr ""
412
422
413−#: qml/Wizard/Pages/40-wifi.qml:28
423+#: qml/Wizard/Pages/40-wifi.qml:29
414msgid "Connect to Wi‑Fi"
424msgid "Connect to Wi‑Fi"
415msgstr ""
425msgstr ""
416
426
417−#: qml/Wizard/Pages/40-wifi.qml:147
427+#: qml/Wizard/Pages/40-wifi.qml:168
418msgid "Available networks…"
428msgid "Available networks…"
419msgstr ""
429msgstr ""
420
430
421−#: qml/Wizard/Pages/40-wifi.qml:148
431+#: qml/Wizard/Pages/40-wifi.qml:169
422msgid "No available networks."
432msgid "No available networks."
423msgstr ""
433msgstr ""
424
434
qml/Dash/Dash.qml+6−8
@@ -122,7 +122,6 @@ Showable {
122 dash.setCurrentScope(scopeId, true, false);
122 dash.setCurrentScope(scopeId, true, false);
123 }
123 }
124 onOpenScope: {
124 onOpenScope: {
125− scopeItem.scopeThatOpenedScope = currentScope;
126 scopeItem.scope = scope;
125 scopeItem.scope = scope;
127 x = -width;
126 x = -width;
128 }
127 }
@@ -130,7 +129,7 @@ Showable {
130 UbuntuNumberAnimation {
129 UbuntuNumberAnimation {
131 onRunningChanged: {
130 onRunningChanged: {
132 if (!running && dashContent.x == 0) {
131 if (!running && dashContent.x == 0) {
133− scopeItem.scopeThatOpenedScope.closeScope(scopeItem.scope);
132+ scopes.closeScope(scopeItem.scope);
134 scopeItem.scope = null;
133 scopeItem.scope = null;
135 }
134 }
136 }
135 }
@@ -187,7 +186,6 @@ Showable {
187 onOpenScope: {
186 onOpenScope: {
188 bottomEdgeController.enableAnimation = true;
187 bottomEdgeController.enableAnimation = true;
189 bottomEdgeController.progress = 0;
188 bottomEdgeController.progress = 0;
190− scopeItem.scopeThatOpenedScope = scopesList.scope;
191 scopeItem.scope = scope;
189 scopeItem.scope = scope;
192 dashContent.x = -dashContent.width;
190 dashContent.x = -dashContent.width;
193 }
191 }
@@ -199,8 +197,7 @@ Showable {
199 }
197 }
200 }
198 }
201
199
202− DashBackground
200+ DashBackground {
203− {
204 anchors.fill: scopeItem
201 anchors.fill: scopeItem
205 visible: scopeItem.visible
202 visible: scopeItem.visible
206 }
203 }
@@ -209,8 +206,6 @@ Showable {
209 id: scopeItem
206 id: scopeItem
210 objectName: "dashTempScopeItem"
207 objectName: "dashTempScopeItem"
211
208
212− property var scopeThatOpenedScope: null
213−
214 x: dashContent.x + width
209 x: dashContent.x + width
215 y: dashContent.y
210 y: dashContent.y
216 width: parent.width
211 width: parent.width
@@ -229,7 +224,10 @@ Showable {
229 dashContent.gotoScope(scopeId);
224 dashContent.gotoScope(scopeId);
230 }
225 }
231 onOpenScope: {
226 onOpenScope: {
232− dashContent.openScope(scope);
227+ scopeItem.closePreview();
228+ var oldScope = scopeItem.scope;
229+ scopeItem.scope = scope;
230+ scopes.closeScope(oldScope);
233 }
231 }
234 }
232 }
235 }
233 }
qml/Dash/DashContent.qml+1−2
@@ -84,8 +84,7 @@ Item {
84
84
85 set_current_index = undefined;
85 set_current_index = undefined;
86
86
87− if (dashContentList.count > index)
87+ if (dashContentList.count > index) {
88− {
89 dashContentList.currentIndex = index
88 dashContentList.currentIndex = index
90
89
91 if (reset) {
90 if (reset) {
qml/Dash/Previews/Preview.qml+1
@@ -65,6 +65,7 @@ Item {
65
65
66 delegate: ListView {
66 delegate: ListView {
67 id: column
67 id: column
68+ objectName: "previewListRow" + index
68 anchors { top: parent.top; bottom: parent.bottom }
69 anchors { top: parent.top; bottom: parent.bottom }
69 width: row.columnWidth
70 width: row.columnWidth
70 spacing: row.spacing
71 spacing: row.spacing
qml/Dash/ScopeSettings/ScopeSettingBoolean.qml+3−1
@@ -38,7 +38,9 @@ ScopeSetting {
38 rightMargin: units.gu(1)
38 rightMargin: units.gu(1)
39 verticalCenter: parent.verticalCenter
39 verticalCenter: parent.verticalCenter
40 }
40 }
41+ // TODO The translation should ideally come from the bottom layers and not be hardcoded here
42+ // https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1393438
41− text: widgetData.displayName
43+ text: widgetData.settingId == "internal.location" ? i18n.tr("Enable location data") : widgetData.displayName
42 elide: Text.ElideMiddle
44 elide: Text.ElideMiddle
43 maximumLineCount: 2
45 maximumLineCount: 2
44 wrapMode: Text.Wrap
46 wrapMode: Text.Wrap
qml/Dash/ScopesListCategoryItem.qml+1
@@ -53,6 +53,7 @@ MouseArea {
53 id: shapeImage
53 id: shapeImage
54 cache: true
54 cache: true
55 fillMode: Image.PreserveAspectCrop
55 fillMode: Image.PreserveAspectCrop
56+ sourceSize { width: shape.width; height: shape.height }
56 }
57 }
57 }
58 }
58
59
tests/mocks/Unity/CMakeLists.txt+1−1
@@ -6,7 +6,7 @@ add_subdirectory(Notifications)
6add_subdirectory(DashCommunicator)
6add_subdirectory(DashCommunicator)
7
7
8pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
8pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
9−pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=5)
9+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=6)
10
10
11include_directories(
11include_directories(
12 ${CMAKE_CURRENT_BINARY_DIR}
12 ${CMAKE_CURRENT_BINARY_DIR}
tests/mocks/Unity/fake_previewmodel.cpp+15−1
@@ -22,18 +22,23 @@
22#include "fake_previewmodel.h"
22#include "fake_previewmodel.h"
23
23
24// local
24// local
25+#include "fake_scope.h"
26+#include "fake_scopes.h"
25#include "fake_previewwidgetmodel.h"
27#include "fake_previewwidgetmodel.h"
26
28
27// Qt
29// Qt
28#include <QDebug>
30#include <QDebug>
29
31
30−PreviewModel::PreviewModel(QObject* parent)
32+PreviewModel::PreviewModel(QObject* parent, Scope* scope)
31 : unity::shell::scopes::PreviewModelInterface(parent)
33 : unity::shell::scopes::PreviewModelInterface(parent)
32 , m_loaded(true)
34 , m_loaded(true)
35+ , m_scope(scope)
33{
36{
34 // we have one column by default
37 // we have one column by default
35 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
38 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
36 m_previewWidgetModels.append(columnModel);
39 m_previewWidgetModels.append(columnModel);
40+ connect(this, SIGNAL(triggered(QString const&, QString const&, QVariantMap const&)),
41+ this, SLOT(triggeredSlot(QString const&, QString const&, QVariantMap const&)));
37}
42}
38
43
39void PreviewModel::setWidgetColumnCount(int count)
44void PreviewModel::setWidgetColumnCount(int count)
@@ -80,3 +85,12 @@ void PreviewModel::setLoaded(bool loaded)
80 Q_EMIT loadedChanged();
85 Q_EMIT loadedChanged();
81 }
86 }
82}
87}
88+
89+void PreviewModel::triggeredSlot(QString const&, QString const&, QVariantMap const&) {
90+ if (m_scope) {
91+ Scopes *scopes = dynamic_cast<Scopes*>(m_scope->parent());
92+ Scope* scope = scopes->getScopeFromAll("MockScope9");
93+ scopes->addTempScope(scope);
94+ Q_EMIT m_scope->openScope(scope);
95+ }
96+}
tests/mocks/Unity/fake_previewmodel.h+7−1
@@ -25,12 +25,14 @@
25
25
26class PreviewWidgetModel;
26class PreviewWidgetModel;
27
27
28+class Scope;
29+
28class PreviewModel : public unity::shell::scopes::PreviewModelInterface
30class PreviewModel : public unity::shell::scopes::PreviewModelInterface
29{
31{
30 Q_OBJECT
32 Q_OBJECT
31
33
32public:
34public:
33− explicit PreviewModel(QObject* parent = 0);
35+ explicit PreviewModel(QObject* parent = 0, Scope* scope = 0);
34
36
35 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
37 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
36 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
38 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
@@ -42,9 +44,13 @@ public:
42
44
43 Q_INVOKABLE void setLoaded(bool); // Only available for testing
45 Q_INVOKABLE void setLoaded(bool); // Only available for testing
44
46
47+private Q_SLOTS:
48+ void triggeredSlot(QString const&, QString const&, QVariantMap const&);
49+
45private:
50private:
46 QList<PreviewWidgetModel*> m_previewWidgetModels;
51 QList<PreviewWidgetModel*> m_previewWidgetModels;
47 bool m_loaded;
52 bool m_loaded;
53+ Scope* m_scope;
48};
54};
49
55
50Q_DECLARE_METATYPE(PreviewModel*)
56Q_DECLARE_METATYPE(PreviewModel*)
tests/mocks/Unity/fake_previewstack.cpp+2−2
@@ -21,10 +21,10 @@
21#include "fake_previewmodel.h"
21#include "fake_previewmodel.h"
22#include "fake_scope.h"
22#include "fake_scope.h"
23
23
24−PreviewStack::PreviewStack(QObject* parent)
24+PreviewStack::PreviewStack(QObject* parent, Scope *scope)
25 : unity::shell::scopes::PreviewStackInterface(parent)
25 : unity::shell::scopes::PreviewStackInterface(parent)
26{
26{
27− m_previews << new PreviewModel(this);
27+ m_previews << new PreviewModel(this, scope);
28}
28}
29
29
30PreviewStack::~PreviewStack()
30PreviewStack::~PreviewStack()
tests/mocks/Unity/fake_previewstack.h+3−1
@@ -25,12 +25,14 @@
25
25
26class PreviewModel;
26class PreviewModel;
27
27
28+class Scope;
29+
28class PreviewStack : public unity::shell::scopes::PreviewStackInterface
30class PreviewStack : public unity::shell::scopes::PreviewStackInterface
29{
31{
30 Q_OBJECT
32 Q_OBJECT
31
33
32public:
34public:
33− explicit PreviewStack(QObject* parent = 0);
35+ explicit PreviewStack(QObject* parent = 0, Scope* scope = 0);
34 virtual ~PreviewStack();
36 virtual ~PreviewStack();
35
37
36 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
38 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
tests/mocks/Unity/fake_previewwidgetmodel.cpp+11
@@ -53,6 +53,17 @@ void PreviewWidgetModel::populateWidgets()
53 PreviewData* preview_data = new PreviewData(QString("widget-%1").arg(i), QString("text"), attributes);
53 PreviewData* preview_data = new PreviewData(QString("widget-%1").arg(i), QString("text"), attributes);
54 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
54 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
55 }
55 }
56+
57+ QVariantMap attributes;
58+ QVariantMap buttonData;
59+ buttonData["label"] = "Button";
60+ buttonData["id"] = "open_click";
61+ QVariantList buttons;
62+ buttons << buttonData << buttonData << buttonData;
63+ attributes["actions"] = QVariant::fromValue(buttons);
64+ PreviewData* preview_data = new PreviewData(QString("widget-21"), QString("actions"), attributes);
65+ m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
66+
56 endResetModel();
67 endResetModel();
57
68
58}
69}
tests/mocks/Unity/fake_scope.cpp+5−5
@@ -185,6 +185,7 @@ void Scope::activate(QVariant const& result)
185 if (result.toString() == "Result.2.2") {
185 if (result.toString() == "Result.2.2") {
186 Scopes *scopes = dynamic_cast<Scopes*>(parent());
186 Scopes *scopes = dynamic_cast<Scopes*>(parent());
187 m_openScope = scopes->getScopeFromAll("MockScope9");
187 m_openScope = scopes->getScopeFromAll("MockScope9");
188+ scopes->addTempScope(m_openScope);
188 Q_EMIT openScope(m_openScope);
189 Q_EMIT openScope(m_openScope);
189 }
190 }
190}
191}
@@ -198,7 +199,7 @@ PreviewStack* Scope::preview(QVariant const& result)
198 } else {
199 } else {
199 // This probably leaks, do we don't care
200 // This probably leaks, do we don't care
200 // it's a test after all
201 // it's a test after all
201− return new PreviewStack;
202+ return new PreviewStack(this, this);
202 }
203 }
203}
204}
204
205
@@ -208,11 +209,10 @@ void Scope::cancelActivation()
208
209
209void Scope::closeScope(unity::shell::scopes::ScopeInterface* scope)
210void Scope::closeScope(unity::shell::scopes::ScopeInterface* scope)
210{
211{
211− if (scope != m_openScope) {
212+ Scopes *scopes = dynamic_cast<Scopes*>(parent());
212− qDebug() << scope << m_openScope;
213+ if (scopes) {
213− qFatal("Scope::closeScope got wrong scope in closeScope");
214+ return scopes->closeScope(scope);
214 }
215 }
215− m_openScope = nullptr;
216}
216}
217
217
218QString Scope::currentNavigationId() const
218QString Scope::currentNavigationId() const
tests/mocks/Unity/fake_scopes.cpp+12
@@ -23,6 +23,7 @@
23// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
23// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
24
24
25// Qt
25// Qt
26+#include <QDebug>
26#include <QTimer>
27#include <QTimer>
27
28
28Scopes::Scopes(QObject *parent)
29Scopes::Scopes(QObject *parent)
@@ -177,6 +178,17 @@ unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const
177 return m_scopesOverview;
178 return m_scopesOverview;
178}
179}
179
180
181+void Scopes::addTempScope(unity::shell::scopes::ScopeInterface* scope)
182+{
183+ m_tempScopes.insert(scope);
184+}
185+
186+void Scopes::closeScope(unity::shell::scopes::ScopeInterface* scope)
187+{
188+ Q_ASSERT(m_tempScopes.contains(scope));
189+ m_tempScopes.remove(scope);
190+}
191+
180void Scopes::setFavorite(const QString& scopeId, bool favorite)
192void Scopes::setFavorite(const QString& scopeId, bool favorite)
181{
193{
182 if (favorite) {
194 if (favorite) {
tests/mocks/Unity/fake_scopes.h+5
@@ -26,6 +26,7 @@
26
26
27// Qt
27// Qt
28#include <QList>
28#include <QList>
29+#include <QSet>
29#include <QTimer>
30#include <QTimer>
30
31
31class ScopesOverview;
32class ScopesOverview;
@@ -59,6 +60,9 @@ public:
59 Q_INVOKABLE void setFavorite(const QString& scopeId, bool favorite) override;
60 Q_INVOKABLE void setFavorite(const QString& scopeId, bool favorite) override;
60 Q_INVOKABLE void moveFavoriteTo(const QString& scopeId, int index) override;
61 Q_INVOKABLE void moveFavoriteTo(const QString& scopeId, int index) override;
61
62
63+ void addTempScope(unity::shell::scopes::ScopeInterface* scope);
64+ Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
65+
62 // This is used as part of implementation of the other C++ code, not API
66 // This is used as part of implementation of the other C++ code, not API
63 QList<Scope*> favScopes() const;
67 QList<Scope*> favScopes() const;
64 QList<Scope*> nonFavScopes() const;
68 QList<Scope*> nonFavScopes() const;
@@ -70,6 +74,7 @@ private Q_SLOTS:
70private:
74private:
71 QList<Scope*> m_scopes; // the favorite ones
75 QList<Scope*> m_scopes; // the favorite ones
72 QList<Scope*> m_allScopes;
76 QList<Scope*> m_allScopes;
77+ QSet<unity::shell::scopes::ScopeInterface*> m_tempScopes;
73 ScopesOverview *m_scopesOverview;
78 ScopesOverview *m_scopesOverview;
74 bool m_loaded;
79 bool m_loaded;
75 QTimer timer;
80 QTimer timer;
tests/mocks/Unity/fake_scopesoverview.cpp+1
@@ -48,6 +48,7 @@ Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
48 Q_EMIT gotoScope(result.toString());
48 Q_EMIT gotoScope(result.toString());
49 } else {
49 } else {
50 m_openScope = scopes->getScopeFromAll(result.toString());
50 m_openScope = scopes->getScopeFromAll(result.toString());
51+ scopes->addTempScope(m_openScope);
51 Q_EMIT openScope(m_openScope);
52 Q_EMIT openScope(m_openScope);
52 }
53 }
53}
54}
tests/qmltests/Dash/Previews/tst_Preview.qml+31
@@ -54,6 +54,11 @@ Rectangle {
54 name: "Preview"
54 name: "Preview"
55 when: windowShown
55 when: windowShown
56
56
57+ function init() {
58+ var widget = findChild(preview, "previewListRow0");
59+ widget.positionViewAtBeginning();
60+ }
61+
57 function test_triggered() {
62 function test_triggered() {
58 waitForRendering(preview);
63 waitForRendering(preview);
59 var widget = findChild(preview, "widget-3");
64 var widget = findChild(preview, "widget-3");
@@ -102,5 +107,31 @@ Rectangle {
102 return bottomLeft.y <= preview.height
107 return bottomLeft.y <= preview.height
103 }, true);
108 }, true);
104 }
109 }
110+
111+ function test_comboEnsureVisible() {
112+ waitForRendering(preview);
113+
114+ // Scroll down
115+ var previewListRow0 = findChild(preview, "previewListRow0");
116+ touchFlick(preview, preview.width / 2, units.gu(20), preview.width / 2, units.gu(1));
117+ tryCompare(previewListRow0, "atYEnd", true);
118+ tryCompare(previewListRow0, "moving", false);
119+
120+ // Click on the combo
121+ var widget = findChild(preview, "widget-21");
122+ var initialWidgetHeight = widget.height;
123+ var moreLessButton = findChild(widget, "moreLessButton");
124+ mouseClick(moreLessButton);
125+
126+ // Make sure the combo is growing
127+ tryCompareFunction(function () { return widget.height > 2 * initialWidgetHeight; }, true);
128+
129+ // Wait for the combo to stop growing
130+ tryCompareFunction(function () { var currentWidgetHeight = widget.height; wait(200); return currentWidgetHeight === widget.height;}, true);
131+
132+ // Make sure the combo bottom is on the viewport
133+ var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
134+ verify(bottomLeft.y <= preview.height);
135+ }
105 }
136 }
106}
137}
tests/qmltests/Dash/tst_Dash.qml+69
@@ -428,5 +428,74 @@ Item {
428 tryCompare(bottomEdgeController, "progress", 0);
428 tryCompare(bottomEdgeController, "progress", 0);
429 tryCompare(dashContentList, "currentIndex", 1)
429 tryCompare(dashContentList, "currentIndex", 1)
430 }
430 }
431+
432+ function test_close_temp_scope_preview_opening_scope() {
433+ // Show the manage dash
434+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
435+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
436+ tryCompare(bottomEdgeController, "progress", 1);
437+
438+ // Make sure stuff is loaded
439+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
440+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
441+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
442+
443+ // Click on a non favorite scope
444+ mouseClick(nonfavScopesListCategoryList.currentItem);
445+
446+ // Check the bottom edge (manage dash) is disabled from temp scope
447+ var overviewDragHandle = findChild(dash, "overviewDragHandle");
448+ compare(overviewDragHandle.enabled, false);
449+
450+ // Check temp scope is there
451+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
452+ tryCompare(dashTempScopeItem, "x", 0);
453+ tryCompare(dashTempScopeItem, "visible", true);
454+
455+ // Check the manage dash is gone
456+ tryCompare(bottomEdgeController, "progress", 0);
457+
458+ // Open preview
459+ var categoryListView = findChild(dashTempScopeItem, "categoryListView");
460+ categoryListView.positionAtBeginning();
461+ tryCompareFunction(function() {
462+ var cardGrid = findChild(dashTempScopeItem, "dashCategory0");
463+ if (cardGrid != null) {
464+ var tile = findChild(cardGrid, "delegate0");
465+ return tile != null;
466+ }
467+ return false;
468+ },
469+ true);
470+ var tile = findChild(findChild(dashTempScopeItem, "dashCategory0"), "delegate0");
471+ waitForRendering(tile);
472+ mouseClick(tile);
473+ var subPageLoader = findChild(dashTempScopeItem, "subPageLoader");
474+ tryCompare(subPageLoader, "open", true);
475+ tryCompare(subPageLoader, "x", 0);
476+ tryCompare(findChild(dashTempScopeItem, "categoryListView"), "visible", false);
477+ var previewListRow0 = findChild(subPageLoader, "previewListRow0");
478+ touchFlick(previewListRow0, previewListRow0.width / 2, units.gu(20), previewListRow0.width / 2, units.gu(1));
479+ tryCompare(previewListRow0, "atYEnd", true);
480+ tryCompare(previewListRow0, "moving", false);
481+ var widget = findChild(subPageLoader, "widget-21");
482+ var initialWidgetHeight = widget.height;
483+ var openButton = findChild(widget, "buttonopen_click");
484+ mouseClick(openButton);
485+
486+ tryCompare(subPageLoader, "open", false);
487+ tryCompare(subPageLoader, "x", subPageLoader.width);
488+
489+ compare(dashTempScopeItem.scope.id, "MockScope9");
490+
491+ // Go back
492+ var dashTempScopeItemHeader = findChild(dashTempScopeItem, "scopePageHeader");
493+ var backButton = findChild(findChild(dashTempScopeItemHeader, "innerPageHeader"), "customBackButton");
494+ mouseClick(backButton);
495+
496+ // Check temp scope is gone
497+ tryCompare(dashTempScopeItem, "x", dash.width);
498+ tryCompare(dashTempScopeItem, "visible", false);
499+ }
431 }
500 }
432}
501}
tests/qmltests/Dash/tst_GenericScopeView.qml+1−1
@@ -380,8 +380,8 @@ Item {
380
380
381 tryCompare(testCase.subPageLoader, "open", false);
381 tryCompare(testCase.subPageLoader, "open", false);
382
382
383+ tryCompareFunction(function() { return findChild(category, "delegate1") != null; }, true);
383 var tile = findChild(category, "delegate1");
384 var tile = findChild(category, "delegate1");
384− verify(tile, "Could not find delegate");
385
385
386 mouseClick(tile);
386 mouseClick(tile);
387 tryCompare(testCase.subPageLoader, "open", true);
387 tryCompare(testCase.subPageLoader, "open", true);
tests/qmltests/Notifications/tst_Notifications.qml+8
@@ -563,6 +563,7 @@ Item {
563 verify(notification !== undefined, "notification wasn't found");
563 verify(notification !== undefined, "notification wasn't found");
564
564
565 waitForRendering(notification);
565 waitForRendering(notification);
566+ tryCompare(notification, "height", notification.state === "contracted" ? units.gu(10) : notification.implicitHeight);
566
567
567 var icon = findChild(notification, "icon")
568 var icon = findChild(notification, "icon")
568 var centeredIcon = findChild(notification, "centeredIcon")
569 var centeredIcon = findChild(notification, "centeredIcon")
@@ -602,6 +603,13 @@ Item {
602 compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
603 compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
603 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
604 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
604
605
606+ // After clicking the state of notifications can change so let's wait
607+ // for their height animations to finish before continuing
608+ for (var i = 0; i < mockModel.count; ++i) {
609+ var n = findChild(notifications, "notification" + i)
610+ tryCompare(n, "height", n.state === "contracted" ? units.gu(10) : n.implicitHeight);
611+ }
612+
605 if (data.hasSound) {
613 if (data.hasSound) {
606 var audioItem = findInvisibleChild(notification, "sound")
614 var audioItem = findInvisibleChild(notification, "sound")
607 compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")
615 compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")