on xenial help sign in
Releasing 8.02+15.04.20150216.1-0ubuntu1.
commit61022bca86b96213374a59ccde611c148130cb9b authorRobert Bruce Park <robert.park@canonical.com> dateMon 16 Feb 2015, 10:53 (12 years ago) parent2a91807f3e32b3
23 files changed+289−98
CMakeLists.txt+1 debian/changelog+20 debian/control+2−2 po/unity8.pot+83−73 qml/Dash/Dash.qml+6−8 qml/Dash/DashContent.qml+1−2 qml/Dash/Previews/Preview.qml+1 qml/Dash/ScopeSettings/ScopeSettingBoolean.qml+3−1 qml/Dash/ScopesListCategoryItem.qml+1 tests/mocks/Unity/CMakeLists.txt+1−1 tests/mocks/Unity/fake_previewmodel.cpp+15−1 tests/mocks/Unity/fake_previewmodel.h+7−1 tests/mocks/Unity/fake_previewstack.cpp+2−2 tests/mocks/Unity/fake_previewstack.h+3−1 tests/mocks/Unity/fake_previewwidgetmodel.cpp+11 tests/mocks/Unity/fake_scope.cpp+5−5 tests/mocks/Unity/fake_scopes.cpp+12 tests/mocks/Unity/fake_scopes.h+5 tests/mocks/Unity/fake_scopesoverview.cpp+1 tests/qmltests/Dash/Previews/tst_Preview.qml+31 tests/qmltests/Dash/tst_Dash.qml+69 tests/qmltests/Dash/tst_GenericScopeView.qml+1−1 tests/qmltests/Notifications/tst_Notifications.qml+8
CMakeLists.txt+1
@@ -54,6 +54,7 @@ find_package(Qt5Quick 5.2 REQUIRED)
5454find_package(Qt5Gui 5.2 REQUIRED)
5555find_package(Qt5DBus 5.2 REQUIRED)
5656find_package(Qt5Concurrent 5.2 REQUIRED)
57+find_package(Qt5Sql 5.2 REQUIRED)
5758
5859# Standard install paths
5960include(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+
121unity8 (8.02+15.04.20150211-0ubuntu2) vivid; urgency=medium
222
323 * No-change rebuild against Qt 5.4.0.
debian/control+2−2
@@ -27,7 +27,7 @@ Build-Depends: cmake,
2727 libqmenumodel-dev (>= 0.2.9),
2828 libqt5xmlpatterns5-dev,
2929 libsystemsettings-dev,
30− libunity-api-dev (>= 7.95),
30+ libunity-api-dev (>= 7.96),
3131 libusermetricsoutput1-dev,
3232 libxcb1-dev,
3333 pkg-config,
@@ -126,7 +126,7 @@ Depends: qml-module-qtquick-layouts,
126126 unity-application-impl-4,
127127 unity-notifications-impl-3,
128128 unity-plugin-scopes | unity-scopes-impl,
129− unity-scopes-impl-4,
129+ unity-scopes-impl-6,
130130 unity8-fake-env | unity-application-impl,
131131 ${misc:Depends},
132132Breaks: unity8 (<< 7.86),
po/unity8.pot+83−73
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"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"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,7 +18,7 @@ msgstr ""
1818"Content-Transfer-Encoding: 8bit\n"
1919"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
2020
21−#: plugins/LightDM/Greeter.cpp:130
21+#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
2323msgstr ""
2424
@@ -106,52 +106,6 @@ msgstr ""
106106msgid "Cancel"
107107msgstr ""
108108
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−
155109#: qml/Components/Lockscreen.qml:238
156110msgid "Return to Call"
157111msgstr ""
@@ -164,32 +118,32 @@ msgstr ""
164118msgid "OK"
165119msgstr ""
166120
167−#: qml/Dash/GenericScopeView.qml:485 qml/Dash/GenericScopeView.qml:642
121+#: qml/Dash/GenericScopeView.qml:528 qml/Dash/GenericScopeView.qml:686
168122msgid "See less"
169123msgstr ""
170124
171−#: qml/Dash/GenericScopeView.qml:485
125+#: qml/Dash/GenericScopeView.qml:528
172126msgid "See all"
173127msgstr ""
174128
175−#: qml/Dash/GenericScopeView.qml:547 qml/Dash/PageHeader.qml:274
129+#: qml/Dash/GenericScopeView.qml:590 qml/Dash/PageHeader.qml:276
176130#: qml/Panel/SearchIndicator.qml:27
177131msgid "Search"
178132msgstr ""
179133
180−#: qml/Dash/PageHeader.qml:267
134+#: qml/Dash/PageHeader.qml:269
181135msgid "Store"
182136msgstr ""
183137
184−#: qml/Dash/PageHeader.qml:284
138+#: qml/Dash/PageHeader.qml:286
185139msgid "Settings"
186140msgstr ""
187141
188−#: qml/Dash/PageHeader.qml:291
142+#: qml/Dash/PageHeader.qml:293
189143msgid "Remove from Favorites"
190144msgstr ""
191145
192−#: qml/Dash/PageHeader.qml:291
146+#: qml/Dash/PageHeader.qml:293
193147msgid "Add to Favorites"
194148msgstr ""
195149
@@ -221,6 +175,10 @@ msgstr ""
221175msgid "Release to refresh…"
222176msgstr ""
223177
178+#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
179+msgid "Enable location data"
180+msgstr ""
181+
224182#: qml/Dash/ScopesList.qml:66
225183msgid "Manage"
226184msgstr ""
@@ -233,7 +191,7 @@ msgstr ""
233191msgid "Also installed"
234192msgstr ""
235193
236−#: qml/Greeter/Greeter.qml:133
194+#: qml/Greeter/Greeter.qml:141
237195msgid "Unlock"
238196msgstr ""
239197
@@ -289,60 +247,112 @@ msgstr ""
289247msgid "Roaming"
290248msgstr ""
291249
292−#: qml/Shell.qml:390
250+#: qml/Shell.qml:402
293251#, qt-format
294252msgid "Enter %1"
295253msgstr ""
296254
297−#: qml/Shell.qml:391 qml/Wizard/Pages/passwd-set.qml:60
255+#: qml/Shell.qml:403 qml/Wizard/Pages/passwd-set.qml:60
298256msgid "Enter passphrase"
299257msgstr ""
300258
301−#: qml/Shell.qml:392
259+#: qml/Shell.qml:404
302260msgid "Enter passcode"
303261msgstr ""
304262
305−#: qml/Shell.qml:393
263+#: qml/Shell.qml:405
306264#, qt-format
307265msgid "Sorry, incorrect %1"
308266msgstr ""
309267
310−#: qml/Shell.qml:394
268+#: qml/Shell.qml:406
311269msgid "Sorry, incorrect passphrase"
312270msgstr ""
313271
314−#: qml/Shell.qml:395
272+#: qml/Shell.qml:407
315273msgid "Please re-enter"
316274msgstr ""
317275
318−#: qml/Shell.qml:396
276+#: qml/Shell.qml:408
319277msgid "Sorry, incorrect passcode"
320278msgstr ""
321279
322−#: qml/Shell.qml:490 qml/Wizard/Pages/passwd-confirm.qml:53
280+#: qml/Shell.qml:502 qml/Wizard/Pages/passwd-confirm.qml:53
323281msgid "Sorry, incorrect passphrase."
324282msgstr ""
325283
326−#: qml/Shell.qml:491 qml/Wizard/Pages/passwd-confirm.qml:54
284+#: qml/Shell.qml:503 qml/Wizard/Pages/passwd-confirm.qml:54
327285msgid "Sorry, incorrect passcode."
328286msgstr ""
329287
330−#: qml/Shell.qml:492
288+#: qml/Shell.qml:504
331289msgid "This will be your last attempt."
332290msgstr ""
333291
334−#: qml/Shell.qml:494
292+#: qml/Shell.qml:506
335293msgid ""
336294"If passphrase is entered incorrectly, your phone will conduct a factory "
337295"reset and all personal data will be deleted."
338296msgstr ""
339297
340−#: qml/Shell.qml:495
298+#: qml/Shell.qml:507
341299msgid ""
342300"If passcode is entered incorrectly, your phone will conduct a factory reset "
343301"and all personal data will be deleted."
344302msgstr ""
345303
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+
346356#: qml/Wizard/Page.qml:89
347357msgid "Back"
348358msgstr ""
@@ -360,7 +370,7 @@ msgid "Let’s get started."
360370msgstr ""
361371
362372#: 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
364374#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
365375#: qml/Wizard/Pages/passwd-set.qml:90
366376msgid "Continue"
@@ -374,7 +384,7 @@ msgstr ""
374384msgid "Without it, you won’t be able to make calls or use text messaging."
375385msgstr ""
376386
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
378388msgid "Skip"
379389msgstr ""
380390
@@ -410,15 +420,15 @@ msgstr ""
410420msgid "Numbers and letters"
411421msgstr ""
412422
413−#: qml/Wizard/Pages/40-wifi.qml:28
423+#: qml/Wizard/Pages/40-wifi.qml:29
414424msgid "Connect to Wi‑Fi"
415425msgstr ""
416426
417−#: qml/Wizard/Pages/40-wifi.qml:147
427+#: qml/Wizard/Pages/40-wifi.qml:168
418428msgid "Available networks…"
419429msgstr ""
420430
421−#: qml/Wizard/Pages/40-wifi.qml:148
431+#: qml/Wizard/Pages/40-wifi.qml:169
422432msgid "No available networks."
423433msgstr ""
424434
qml/Dash/Dash.qml+6−8
@@ -122,7 +122,6 @@ Showable {
122122 dash.setCurrentScope(scopeId, true, false);
123123 }
124124 onOpenScope: {
125− scopeItem.scopeThatOpenedScope = currentScope;
126125 scopeItem.scope = scope;
127126 x = -width;
128127 }
@@ -130,7 +129,7 @@ Showable {
130129 UbuntuNumberAnimation {
131130 onRunningChanged: {
132131 if (!running && dashContent.x == 0) {
133− scopeItem.scopeThatOpenedScope.closeScope(scopeItem.scope);
132+ scopes.closeScope(scopeItem.scope);
134133 scopeItem.scope = null;
135134 }
136135 }
@@ -187,7 +186,6 @@ Showable {
187186 onOpenScope: {
188187 bottomEdgeController.enableAnimation = true;
189188 bottomEdgeController.progress = 0;
190− scopeItem.scopeThatOpenedScope = scopesList.scope;
191189 scopeItem.scope = scope;
192190 dashContent.x = -dashContent.width;
193191 }
@@ -199,8 +197,7 @@ Showable {
199197 }
200198 }
201199
202− DashBackground
203− {
200+ DashBackground {
204201 anchors.fill: scopeItem
205202 visible: scopeItem.visible
206203 }
@@ -209,8 +206,6 @@ Showable {
209206 id: scopeItem
210207 objectName: "dashTempScopeItem"
211208
212− property var scopeThatOpenedScope: null
213−
214209 x: dashContent.x + width
215210 y: dashContent.y
216211 width: parent.width
@@ -229,7 +224,10 @@ Showable {
229224 dashContent.gotoScope(scopeId);
230225 }
231226 onOpenScope: {
232− dashContent.openScope(scope);
227+ scopeItem.closePreview();
228+ var oldScope = scopeItem.scope;
229+ scopeItem.scope = scope;
230+ scopes.closeScope(oldScope);
233231 }
234232 }
235233 }
qml/Dash/DashContent.qml+1−2
@@ -84,8 +84,7 @@ Item {
8484
8585 set_current_index = undefined;
8686
87− if (dashContentList.count > index)
88− {
87+ if (dashContentList.count > index) {
8988 dashContentList.currentIndex = index
9089
9190 if (reset) {
qml/Dash/Previews/Preview.qml+1
@@ -65,6 +65,7 @@ Item {
6565
6666 delegate: ListView {
6767 id: column
68+ objectName: "previewListRow" + index
6869 anchors { top: parent.top; bottom: parent.bottom }
6970 width: row.columnWidth
7071 spacing: row.spacing
qml/Dash/ScopeSettings/ScopeSettingBoolean.qml+3−1
@@ -38,7 +38,9 @@ ScopeSetting {
3838 rightMargin: units.gu(1)
3939 verticalCenter: parent.verticalCenter
4040 }
41− text: widgetData.displayName
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
43+ text: widgetData.settingId == "internal.location" ? i18n.tr("Enable location data") : widgetData.displayName
4244 elide: Text.ElideMiddle
4345 maximumLineCount: 2
4446 wrapMode: Text.Wrap
qml/Dash/ScopesListCategoryItem.qml+1
@@ -53,6 +53,7 @@ MouseArea {
5353 id: shapeImage
5454 cache: true
5555 fillMode: Image.PreserveAspectCrop
56+ sourceSize { width: shape.width; height: shape.height }
5657 }
5758 }
5859
tests/mocks/Unity/CMakeLists.txt+1−1
@@ -6,7 +6,7 @@ add_subdirectory(Notifications)
66add_subdirectory(DashCommunicator)
77
88pkg_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)
1010
1111include_directories(
1212 ${CMAKE_CURRENT_BINARY_DIR}
tests/mocks/Unity/fake_previewmodel.cpp+15−1
@@ -22,18 +22,23 @@
2222#include "fake_previewmodel.h"
2323
2424// local
25+#include "fake_scope.h"
26+#include "fake_scopes.h"
2527#include "fake_previewwidgetmodel.h"
2628
2729// Qt
2830#include <QDebug>
2931
30−PreviewModel::PreviewModel(QObject* parent)
32+PreviewModel::PreviewModel(QObject* parent, Scope* scope)
3133 : unity::shell::scopes::PreviewModelInterface(parent)
3234 , m_loaded(true)
35+ , m_scope(scope)
3336{
3437 // we have one column by default
3538 PreviewWidgetModel* columnModel = new PreviewWidgetModel(this);
3639 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&)));
3742}
3843
3944void PreviewModel::setWidgetColumnCount(int count)
@@ -80,3 +85,12 @@ void PreviewModel::setLoaded(bool loaded)
8085 Q_EMIT loadedChanged();
8186 }
8287}
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 @@
2525
2626class PreviewWidgetModel;
2727
28+class Scope;
29+
2830class PreviewModel : public unity::shell::scopes::PreviewModelInterface
2931{
3032 Q_OBJECT
3133
3234public:
33− explicit PreviewModel(QObject* parent = 0);
35+ explicit PreviewModel(QObject* parent = 0, Scope* scope = 0);
3436
3537 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
3638 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
@@ -42,9 +44,13 @@ public:
4244
4345 Q_INVOKABLE void setLoaded(bool); // Only available for testing
4446
47+private Q_SLOTS:
48+ void triggeredSlot(QString const&, QString const&, QVariantMap const&);
49+
4550private:
4651 QList<PreviewWidgetModel*> m_previewWidgetModels;
4752 bool m_loaded;
53+ Scope* m_scope;
4854};
4955
5056Q_DECLARE_METATYPE(PreviewModel*)
tests/mocks/Unity/fake_previewstack.cpp+2−2
@@ -21,10 +21,10 @@
2121#include "fake_previewmodel.h"
2222#include "fake_scope.h"
2323
24−PreviewStack::PreviewStack(QObject* parent)
24+PreviewStack::PreviewStack(QObject* parent, Scope *scope)
2525 : unity::shell::scopes::PreviewStackInterface(parent)
2626{
27− m_previews << new PreviewModel(this);
27+ m_previews << new PreviewModel(this, scope);
2828}
2929
3030PreviewStack::~PreviewStack()
tests/mocks/Unity/fake_previewstack.h+3−1
@@ -25,12 +25,14 @@
2525
2626class PreviewModel;
2727
28+class Scope;
29+
2830class PreviewStack : public unity::shell::scopes::PreviewStackInterface
2931{
3032 Q_OBJECT
3133
3234public:
33− explicit PreviewStack(QObject* parent = 0);
35+ explicit PreviewStack(QObject* parent = 0, Scope* scope = 0);
3436 virtual ~PreviewStack();
3537
3638 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()
5353 PreviewData* preview_data = new PreviewData(QString("widget-%1").arg(i), QString("text"), attributes);
5454 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
5555 }
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+
5667 endResetModel();
5768
5869}
tests/mocks/Unity/fake_scope.cpp+5−5
@@ -185,6 +185,7 @@ void Scope::activate(QVariant const& result)
185185 if (result.toString() == "Result.2.2") {
186186 Scopes *scopes = dynamic_cast<Scopes*>(parent());
187187 m_openScope = scopes->getScopeFromAll("MockScope9");
188+ scopes->addTempScope(m_openScope);
188189 Q_EMIT openScope(m_openScope);
189190 }
190191}
@@ -198,7 +199,7 @@ PreviewStack* Scope::preview(QVariant const& result)
198199 } else {
199200 // This probably leaks, do we don't care
200201 // it's a test after all
201− return new PreviewStack;
202+ return new PreviewStack(this, this);
202203 }
203204}
204205
@@ -208,11 +209,10 @@ void Scope::cancelActivation()
208209
209210void Scope::closeScope(unity::shell::scopes::ScopeInterface* scope)
210211{
211− if (scope != m_openScope) {
212− qDebug() << scope << m_openScope;
213− qFatal("Scope::closeScope got wrong scope in closeScope");
212+ Scopes *scopes = dynamic_cast<Scopes*>(parent());
213+ if (scopes) {
214+ return scopes->closeScope(scope);
214215 }
215− m_openScope = nullptr;
216216}
217217
218218QString Scope::currentNavigationId() const
tests/mocks/Unity/fake_scopes.cpp+12
@@ -23,6 +23,7 @@
2323// TODO: Implement remaining pieces, like Categories (i.e. LensView now gives warnings)
2424
2525// Qt
26+#include <QDebug>
2627#include <QTimer>
2728
2829Scopes::Scopes(QObject *parent)
@@ -177,6 +178,17 @@ unity::shell::scopes::ScopeInterface* Scopes::overviewScope() const
177178 return m_scopesOverview;
178179}
179180
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+
180192void Scopes::setFavorite(const QString& scopeId, bool favorite)
181193{
182194 if (favorite) {
tests/mocks/Unity/fake_scopes.h+5
@@ -26,6 +26,7 @@
2626
2727// Qt
2828#include <QList>
29+#include <QSet>
2930#include <QTimer>
3031
3132class ScopesOverview;
@@ -59,6 +60,9 @@ public:
5960 Q_INVOKABLE void setFavorite(const QString& scopeId, bool favorite) override;
6061 Q_INVOKABLE void moveFavoriteTo(const QString& scopeId, int index) override;
6162
63+ void addTempScope(unity::shell::scopes::ScopeInterface* scope);
64+ Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
65+
6266 // This is used as part of implementation of the other C++ code, not API
6367 QList<Scope*> favScopes() const;
6468 QList<Scope*> nonFavScopes() const;
@@ -70,6 +74,7 @@ private Q_SLOTS:
7074private:
7175 QList<Scope*> m_scopes; // the favorite ones
7276 QList<Scope*> m_allScopes;
77+ QSet<unity::shell::scopes::ScopeInterface*> m_tempScopes;
7378 ScopesOverview *m_scopesOverview;
7479 bool m_loaded;
7580 QTimer timer;
tests/mocks/Unity/fake_scopesoverview.cpp+1
@@ -48,6 +48,7 @@ Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
4848 Q_EMIT gotoScope(result.toString());
4949 } else {
5050 m_openScope = scopes->getScopeFromAll(result.toString());
51+ scopes->addTempScope(m_openScope);
5152 Q_EMIT openScope(m_openScope);
5253 }
5354}
tests/qmltests/Dash/Previews/tst_Preview.qml+31
@@ -54,6 +54,11 @@ Rectangle {
5454 name: "Preview"
5555 when: windowShown
5656
57+ function init() {
58+ var widget = findChild(preview, "previewListRow0");
59+ widget.positionViewAtBeginning();
60+ }
61+
5762 function test_triggered() {
5863 waitForRendering(preview);
5964 var widget = findChild(preview, "widget-3");
@@ -102,5 +107,31 @@ Rectangle {
102107 return bottomLeft.y <= preview.height
103108 }, true);
104109 }
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+ }
105136 }
106137}
tests/qmltests/Dash/tst_Dash.qml+69
@@ -428,5 +428,74 @@ Item {
428428 tryCompare(bottomEdgeController, "progress", 0);
429429 tryCompare(dashContentList, "currentIndex", 1)
430430 }
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+ }
431500 }
432501}
tests/qmltests/Dash/tst_GenericScopeView.qml+1−1
@@ -380,8 +380,8 @@ Item {
380380
381381 tryCompare(testCase.subPageLoader, "open", false);
382382
383+ tryCompareFunction(function() { return findChild(category, "delegate1") != null; }, true);
383384 var tile = findChild(category, "delegate1");
384− verify(tile, "Could not find delegate");
385385
386386 mouseClick(tile);
387387 tryCompare(testCase.subPageLoader, "open", true);
tests/qmltests/Notifications/tst_Notifications.qml+8
@@ -563,6 +563,7 @@ Item {
563563 verify(notification !== undefined, "notification wasn't found");
564564
565565 waitForRendering(notification);
566+ tryCompare(notification, "height", notification.state === "contracted" ? units.gu(10) : notification.implicitHeight);
566567
567568 var icon = findChild(notification, "icon")
568569 var centeredIcon = findChild(notification, "centeredIcon")
@@ -602,6 +603,13 @@ Item {
602603 compare(bodyLabel.visible, data.bodyVisible, "body-text visibility is incorrect")
603604 compare(buttonRow.visible, data.buttonRowVisible, "button visibility is incorrect")
604605
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+
605613 if (data.hasSound) {
606614 var audioItem = findInvisibleChild(notification, "sound")
607615 compare(audioItem.playbackState, data.hasSound ? Audio.PlayingState : Audio.StoppedState, "Audio has wrong state")