on xenial help sign in
merge with trunk
commitd8a24e9fd9b234fd82cfb19f933cc5207a69978d authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 18 Jun 2015, 21:23 (11 years ago) parente610a59bba3243
35 files changed+330−134
CODING+4 debian/changelog+45 debian/control+1−1 plugins/Dash/CardCreator.js+24−10 po/de.po+6−6 po/it.po+4−4 qml/Components/ResponsiveVerticalJournal.qml+7−2 qml/Dash/CardCarousel.qml−1 qml/Dash/CardGrid.qml−1 qml/Dash/CardHorizontalList.qml−1 qml/Dash/CardTool.qml+16−15 qml/Dash/CardVerticalJournal.qml−1 qml/Dash/GenericScopeView.qml+1−1 qml/Greeter/ShimGreeter.qml+45 qml/Notifications/ShapedIcon.qml+4−3 qml/Shell.qml+47−34 qml/Stages/ShimStage.qml+44 tests/autopilot/unity8/shell/emulators/dash.py+17−10 tests/autopilot/unity8/shell/tests/test_emulators.py+6 tests/plugins/Dash/cardcreator/1.res+3−2 tests/plugins/Dash/cardcreator/2.res+3−8 tests/plugins/Dash/cardcreator/3.res+3−2 tests/plugins/Dash/cardcreator/4.res+1−2 tests/plugins/Dash/cardcreator/5.res+3−2 tests/plugins/Dash/cardcreator/5.tst+1−1 tests/plugins/Dash/cardcreator/6.res+3−8 tests/plugins/Dash/cardcreator/6.tst+1−1 tests/plugins/Dash/cardcreator/7.res+3−8 tests/plugins/Dash/cardcreator/7.tst+1−1 tests/qmltests/Dash/tst_Card.qml−1 tests/qmltests/Dash/tst_GenericScopeView.qml+30−7 tests/qmltests/Tutorial/tst_Tutorial.qml+1 tests/qmltests/tst_Shell.qml+2 tests/qmltests/tst_ShellWithPin.qml+2 tests/utils/modules/Unity/Test/UnityTestCase.qml+2−1
CODING+4
@@ -158,6 +158,10 @@ To run the tests for a single component/class under gdb (so you can catch SEGFAU
158158
159159$ make gdbtestComponentName
160160
161+To run a single test function of a single component/class:
162+
163+$ make testComponentName FUNCTION="TestCaseName::functionName"
164+
161165To run a test application that allow you to manually test or to simply try out
162166a given component:
163167
debian/changelog+45
@@ -1,3 +1,48 @@
1+unity8 (8.10+15.10.20150616.1-0ubuntu1) wily; urgency=medium
2+
3+ [ Albert Astals Cid ]
4+ * Bind running to the proper object.visible
5+ * Do not use template in generated card creator code
6+ * Fix regression introduced by the concierge change
7+ * Take into account the extra margin on top when calculating the
8+ display margin
9+ * workaround oxide 1.7 issue (LP: #1459142)
10+
11+ [ CI Train Bot ]
12+ * New rebuild forced.
13+
14+ [ Federico Gimenez ]
15+ * On the autopilot helpers, swipe if the item to open from the dash is
16+ not visible. unity8-autopilot dependencies now require ubuntu-ui-
17+ toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
18+
19+ [ Florian Boucault ]
20+ * Notifications: shaped icon was stretching the icon instead of
21+ respecting its aspect ratio and filling the whole shape. (LP:
22+ #1450229)
23+
24+ [ Josh Arenson ]
25+ * Implement bare-bones shellMode=greeter and shellMode=shell
26+
27+ [ Leo Arias ]
28+ * On the autopilot helpers, swipe if the item to open from the dash is
29+ not visible. unity8-autopilot dependencies now require ubuntu-ui-
30+ toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
31+
32+ [ Leonardo Arias Fonseca ]
33+ * On the autopilot helpers, swipe if the item to open from the dash is
34+ not visible. unity8-autopilot dependencies now require ubuntu-ui-
35+ toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1)
36+
37+ [ Michael Zanetti ]
38+ * add info on how to run a single function in make test
39+
40+ [ Richard Huddie ]
41+ * Slow down the speed of autopilot helpers used to swipe to a
42+ different scope to improve the reliability. (LP: #1461059, #1457047)
43+
44+ -- CI Train Bot <ci-train-bot@canonical.com> Tue, 16 Jun 2015 15:12:59 +0000
45+
146unity8 (8.10+15.10.20150612-0ubuntu2) wily; urgency=medium
247
348 * No-change rebuild against Qt 5.4.2.
debian/control+1−1
@@ -151,7 +151,7 @@ Depends: autopilot-qt5 (>= 1.4),
151151 python3-fixtures,
152152 python3-gi,
153153 qttestability-autopilot (>= 1.4),
154− ubuntu-ui-toolkit-autopilot,
154+ ubuntu-ui-toolkit-autopilot (>= 1.2.1485+15.04.20150417.1-0ubuntu1),
155155 unity-scope-click,
156156 unity8 (= ${source:Version}),
157157 unity8-fake-env (= ${source:Version}),
plugins/Dash/CardCreator.js+24−10
@@ -16,6 +16,9 @@
1616
1717.pragma library
1818
19+// %1 is the template["card-background"] string
20+// %2 is the template["card-background"]["elements"][0]
21+// %3 is the template["card-background"]["elements"][1]
1922var kBackgroundLoaderCode = 'Loader {\n\
2023 id: backgroundLoader; \n\
2124 objectName: "backgroundLoader"; \n\
@@ -34,18 +37,14 @@ var kBackgroundLoaderCode = 'Loader {\n\
3437 objectName: "backgroundImage"; \n\
3538 source: { \n\
3639 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
37− else if (template && typeof template["card-background"] === "string") return template["card-background"]; \n\
38− else return ""; \n\
40+ else return "%1"; \n\
3941 } \n\
4042 } \n\
4143 function getColor(index) { \n\
4244 if (cardData && typeof cardData["background"] === "object" \n\
4345 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) { \n\
4446 return cardData["background"]["elements"][index]; \n\
45− } else if (template && typeof template["card-background"] === "object" \n\
46− && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) { \n\
47− return template["card-background"]["elements"][index]; \n\
48− } else return undefined; \n\
47+ } else return index === 0 ? %2 : %3; \n\
4948 } \n\
5049 } \n\
5150 }\n';
@@ -70,6 +69,7 @@ var kArtShapeHolderCode = 'Item { \n\
7069 property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
7170 visible: image.status == Image.Ready; \n\
7271 readonly property alias image: artImage.image; \n\
72+ property alias borderSource: artShapeShape.borderSource; \n\
7373 ShaderEffectSource { \n\
7474 id: artShapeSource; \n\
7575 sourceItem: artImage; \n\
@@ -79,6 +79,7 @@ var kArtShapeHolderCode = 'Item { \n\
7979 hideSource: doShapeItem; \n\
8080 } \n\
8181 Shape { \n\
82+ id: artShapeShape; \n\
8283 image: artShapeSource; \n\
8384 anchors.fill: parent; \n\
8485 visible: doShapeItem; \n\
@@ -315,9 +316,11 @@ var kSummaryLabelCode = 'Label { \n\
315316
316317function cardString(template, components) {
317318 var code;
319+
320+ var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false";
321+
318322 code = 'AbstractButton { \n\
319323 id: root; \n\
320− property var template; \n\
321324 property var components; \n\
322325 property var cardData; \n\
323326 property var artShapeBorderSource: undefined; \n\
@@ -330,8 +333,8 @@ function cardString(template, components) {
330333 property bool asynchronous: true; \n\
331334 property bool showHeader: true; \n\
332335 implicitWidth: childrenRect.width; \n\
333− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true); \n\
334− \n';
336+ enabled: %1; \n\
337+ \n'.arg(templateInteractive);
335338
336339 var hasArt = components["art"] && components["art"]["field"] || false;
337340 var hasSummary = components["summary"] || false;
@@ -348,7 +351,18 @@ function cardString(template, components) {
348351 var hasAttributes = hasTitle && components["attributes"]["field"] || false;
349352
350353 if (hasBackground) {
351− code += kBackgroundLoaderCode;
354+ var templateCardBackground = (template && typeof template["card-background"] === "string") ? template["card-background"] : "";
355+ var backgroundElements0;
356+ var backgroundElements1;
357+ if (template && typeof template["card-background"] === "object" && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) {
358+ if (template["card-background"]["elements"][0] !== undefined) {
359+ backgroundElements0 = '"%1"'.arg(template["card-background"]["elements"][0]);
360+ }
361+ if (template["card-background"]["elements"][1] !== undefined) {
362+ backgroundElements1 = '"%1"'.arg(template["card-background"]["elements"][1]);
363+ }
364+ }
365+ code += kBackgroundLoaderCode.arg(templateCardBackground).arg(backgroundElements0).arg(backgroundElements1);
352366 }
353367
354368 if (hasArt) {
po/de.po+6−6
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-05-14 15:49+0000\n"
12−"Last-Translator: Tobias Bannert <Unknown>\n"
11+"PO-Revision-Date: 2015-06-17 14:05+0000\n"
12+"Last-Translator: JkB <Unknown>\n"
1313"Language-Team: German <de@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-05-15 05:31+0000\n"
19−"X-Generator: Launchpad (build 17493)\n"
18+"X-Launchpad-Export-Date: 2015-06-18 05:07+0000\n"
19+"X-Generator: Launchpad (build 17570)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -117,7 +117,7 @@ msgstr "Ja"
117117#: qml/Components/Dialogs.qml:152
118118msgctxt "Title: Power off/Restart dialog"
119119msgid "Power"
120−msgstr "Leistung"
120+msgstr "Ausschalten"
121121
122122#: qml/Components/Dialogs.qml:153
123123msgid ""
@@ -276,7 +276,7 @@ msgstr "%1 eingeben"
276276
277277#: qml/Greeter/NarrowView.qml:116 qml/Wizard/Pages/passwd-set.qml:60
278278msgid "Enter passphrase"
279−msgstr "Passwort eingeben"
279+msgstr "Passphrase eingeben"
280280
281281#: qml/Greeter/NarrowView.qml:117
282282msgid "Enter passcode"
po/it.po+4−4
@@ -8,15 +8,15 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2015-04-14 16:13+0200\n"
11−"PO-Revision-Date: 2015-03-21 12:42+0000\n"
11+"PO-Revision-Date: 2015-06-17 09:56+0000\n"
1212"Last-Translator: Claudio Arseni <claudio.arseni@gmail.com>\n"
1313"Language-Team: Italian <it@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2015-04-23 06:48+0000\n"
19−"X-Generator: Launchpad (build 17430)\n"
18+"X-Launchpad-Export-Date: 2015-06-18 05:07+0000\n"
19+"X-Generator: Launchpad (build 17570)\n"
2020
2121#: plugins/LightDM/Greeter.cpp:112
2222msgid "Password: "
@@ -375,7 +375,7 @@ msgstr "Toccare qui per continuare."
375375
376376#: qml/Tutorial/TutorialContent.qml:81
377377msgid "Click here to finish."
378−msgstr ""
378+msgstr "Fare clic qui per terminare."
379379
380380#: qml/Tutorial/TutorialLeftFinish.qml:24
381381msgid "These are the shortcuts to favorite apps"
qml/Components/ResponsiveVerticalJournal.qml+7−2
@@ -39,6 +39,8 @@ import Dash 0.1
3939 +-----+
4040*/
4141Item {
42+ id: root
43+
4244 property real minimumColumnSpacing: units.gu(1)
4345
4446 property alias columnWidth: verticalJournalView.columnWidth
@@ -46,8 +48,8 @@ Item {
4648 property alias model: verticalJournalView.model
4749 property alias delegate: verticalJournalView.delegate
4850 property alias cacheBuffer: verticalJournalView.cacheBuffer
49− property alias displayMarginBeginning: verticalJournalView.displayMarginBeginning
50− property alias displayMarginEnd: verticalJournalView.displayMarginEnd
51+ property real displayMarginBeginning: 0
52+ property real displayMarginEnd: 0
5153
5254 implicitHeight: verticalJournalView.implicitHeight + rowSpacing
5355 clip: height < implicitHeight
@@ -63,6 +65,9 @@ Item {
6365 bottomMargin: rowSpacing / 2
6466 }
6567
68+ displayMarginBeginning: -Math.max(-root.displayMarginBeginning - anchors.topMargin, 0)
69+ displayMarginEnd:-Math.max(-root.displayMarginEnd - anchors.topMargin, 0)
70+
6671 function px2gu(pixels) {
6772 return Math.floor(pixels / units.gu(1))
6873 }
qml/Dash/CardCarousel.qml−1
@@ -61,7 +61,6 @@ DashRenderer {
6161 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
6262 item.height = Qt.binding(function() { return cardTool.cardHeight; });
6363 item.cardData = Qt.binding(function() { return model; });
64− item.template = Qt.binding(function() { return cardTool.template; });
6564 item.components = Qt.binding(function() { return cardTool.components; });
6665 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
6766 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
qml/Dash/CardGrid.qml−1
@@ -66,7 +66,6 @@ DashRenderer {
6666 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
6767 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
6868 item.cardData = Qt.binding(function() { return model; });
69− item.template = Qt.binding(function() { return cardTool.template; });
7069 item.components = Qt.binding(function() { return cardTool.components; });
7170 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
7271 item.scopeStyle = root.scopeStyle;
qml/Dash/CardHorizontalList.qml−1
@@ -53,7 +53,6 @@ DashRenderer {
5353 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
5454 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
5555 item.cardData = Qt.binding(function() { return model; });
56− item.template = Qt.binding(function() { return cardTool.template; });
5756 item.components = Qt.binding(function() { return cardTool.components; });
5857 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
5958 item.scopeStyle = root.scopeStyle;
qml/Dash/CardTool.qml+16−15
@@ -198,8 +198,8 @@ Item {
198198
199199 Loader {
200200 id: cardLoader
201− property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"]
202− property var maxData: {
201+ readonly property var fields: ["art", "mascot", "title", "subtitle", "summary", "attributes"]
202+ readonly property var maxData: {
203203 "art": Qt.resolvedUrl("graphics/pixel.png"),
204204 "mascot": Qt.resolvedUrl("graphics/pixel.png"),
205205 "title": "—\n—",
@@ -211,26 +211,27 @@ Item {
211211 onLoaded: {
212212 item.objectName = "cardToolCard";
213213 item.asynchronous = false;
214− item.template = Qt.binding(function() { return cardTool.template; });
215214 item.components = Qt.binding(function() { return cardTool.components; });
216215 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
217216 item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; });
218217 }
219218 Connections {
220− target: cardLoader.item
221− onComponentsChanged: {
222− var data = {};
223− for (var k in cardLoader.fields) {
224− var component = cardLoader.item.components[cardLoader.fields[k]];
225− var key = cardLoader.fields[k];
226− if ((typeof component === "string" && component.length > 0) ||
227− (typeof component === "object" && component !== null
228− && typeof component["field"] === "string" && component["field"].length > 0)) {
229− data[key] = cardLoader.maxData[key];
230− }
219+ target: cardTool
220+ onTemplateChanged: cardLoader.updateCardData();
221+ onComponentsChanged: cardLoader.updateCardData();
222+ }
223+ function updateCardData() {
224+ var data = {};
225+ for (var k in fields) {
226+ var component = cardTool.components[fields[k]];
227+ var key = fields[k];
228+ if ((typeof component === "string" && component.length > 0) ||
229+ (typeof component === "object" && component !== null
230+ && typeof component["field"] === "string" && component["field"].length > 0)) {
231+ data[key] = maxData[key];
231232 }
232− cardLoader.item.cardData = data;
233233 }
234+ item.cardData = data;
234235 }
235236 }
236237}
qml/Dash/CardVerticalJournal.qml−1
@@ -72,7 +72,6 @@ DashRenderer {
7272 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
7373 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
7474 item.cardData = Qt.binding(function() { return model; });
75− item.template = Qt.binding(function() { return cardTool.template; });
7675 item.components = Qt.binding(function() { return cardTool.components; });
7776 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
7877 item.scopeStyle = root.scopeStyle;
qml/Dash/GenericScopeView.qml+1−1
@@ -425,7 +425,7 @@ FocusScope {
425425 // to the next, we set the visible range to the viewport so
426426 // items are not culled (invisible) but still use no cacheBuffer
427427 // (it will be set once the scope is the current one)
428− var displayMarginBeginning = baseItem.y;
428+ var displayMarginBeginning = baseItem.y + rendererLoader.anchors.topMargin;
429429 displayMarginBeginning = -Math.max(-displayMarginBeginning, 0);
430430 displayMarginBeginning = -Math.min(-displayMarginBeginning, baseItem.height);
431431 displayMarginBeginning = Math.round(displayMarginBeginning);
qml/Greeter/ShimGreeter.qmlnew file+45
@@ -0,0 +1,45 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.3
18+
19+/*
20+ * This is a shim greeter that is only used to provide a shell,
21+ * running without a greeter, the requisite information
22+ *
23+ */
24+
25+/* FIXME: this shuld be fine as a QtObject, but bug lp:1447391
26+ * dictates wrapping as an item instead
27+ */
28+Item {
29+ id: shimGreeter
30+
31+ readonly property bool active: false
32+ readonly property bool hasLockedApp: lockedApp !== ""
33+ readonly property bool locked: false
34+ readonly property bool shown: false
35+ readonly property bool waiting: false
36+
37+ property string lockedApp: ""
38+
39+ // Since ShimGreeter is never active, these can just return
40+ property var forceShow: (function() { return; })
41+ property var notifyAboutToFocusApp: (function(appId) { return; })
42+ property var notifyAppFocused: (function(appId) { return; })
43+ property var notifyShowingDashFromDrag: (function(appId) { return false; })
44+
45+}
qml/Notifications/ShapedIcon.qml+4−3
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.3
18+import Ubuntu.Components 1.2
1919
2020Item {
2121 property string fileSource
@@ -25,7 +25,8 @@ Item {
2525 objectName: "shapedIcon"
2626 anchors.fill: parent
2727 visible: shaped
28− image: realImage
28+ source: realImage
29+ sourceFillMode: UbuntuShape.PreserveAspectCrop
2930 }
3031
3132 Image {
qml/Shell.qml+47−34
@@ -111,6 +111,8 @@ Item {
111111 // This is _only_ used to expose the property to autopilot tests
112112 readonly property string testShellMode: shellMode
113113
114+ readonly property alias greeter: greeterLoader.item
115+
114116 function activateApplication(appId) {
115117 if (ApplicationManager.findApplication(appId)) {
116118 ApplicationManager.requestFocusApplication(appId);
@@ -262,7 +264,9 @@ Item {
262264 ? "phone"
263265 : shell.usageScenario
264266 source: {
265− if (applicationsDisplayLoader.usageScenario === "phone") {
267+ if(shellMode === "greeter") {
268+ return "Stages/ShimStage.qml"
269+ } else if (applicationsDisplayLoader.usageScenario === "phone") {
266270 return "Stages/PhoneStage.qml";
267271 } else if (applicationsDisplayLoader.usageScenario === "tablet") {
268272 return "Stages/TabletStage.qml";
@@ -414,50 +418,59 @@ Item {
414418 }
415419 }
416420
417− Greeter {
418− id: greeter
419− objectName: "greeter"
420−
421− hides: [launcher, panel.indicators]
422− tabletMode: shell.usageScenario !== "phone"
423− launcherOffset: launcher.progress
424− forcedUnlock: tutorial.running
425− background: shell.background
426−
421+ Loader {
422+ id: greeterLoader
427423 anchors.fill: parent
428424 anchors.topMargin: panel.panelHeight
425+ sourceComponent: shellMode != "shell" ? integratedGreeter :
426+ Qt.createComponent(Qt.resolvedUrl("Greeter/ShimGreeter.qml"));
427+ onLoaded: {
428+ item.objectName = "greeter"
429+ }
430+ }
429431
430− // avoid overlapping with Launcher's edge drag area
431− // FIXME: Fix TouchRegistry & friends and remove this workaround
432− // Issue involves launcher's DDA getting disabled on a long
433− // left-edge drag
434− dragHandleLeftMargin: launcher.available ? launcher.dragAreaWidth + 1 : 0
432+ Component {
433+ id: integratedGreeter
434+ Greeter {
435435
436− onSessionStarted: {
437− launcher.hide();
438− }
436+ hides: [launcher, panel.indicators]
437+ tabletMode: shell.sideStageEnabled
438+ launcherOffset: launcher.progress
439+ forcedUnlock: tutorial.running
440+ background: shell.background
439441
440− onTease: {
441− if (!tutorial.running) {
442− launcher.tease();
442+ // avoid overlapping with Launcher's edge drag area
443+ // FIXME: Fix TouchRegistry & friends and remove this workaround
444+ // Issue involves launcher's DDA getting disabled on a long
445+ // left-edge drag
446+ dragHandleLeftMargin: launcher.available ? launcher.dragAreaWidth + 1 : 0
447+
448+ onSessionStarted: {
449+ launcher.hide();
450+ }
451+
452+ onTease: {
453+ if (!tutorial.running) {
454+ launcher.tease();
455+ }
443456 }
444− }
445457
446− onEmergencyCall: startLockedApp("dialer-app")
458+ onEmergencyCall: startLockedApp("dialer-app")
447459
448− Timer {
449− // See powerConnection for why this is useful
450− id: showGreeterDelayed
451− interval: 1
452− onTriggered: {
453− greeter.forceShow();
460+ Binding {
461+ target: ApplicationManager
462+ property: "suspended"
463+ value: greeter.shown
454464 }
455465 }
466+ }
456467
457− Binding {
458− target: ApplicationManager
459− property: "suspended"
460− value: greeter.shown
468+ Timer {
469+ // See powerConnection for why this is useful
470+ id: showGreeterDelayed
471+ interval: 1
472+ onTriggered: {
473+ greeter.forceShow();
461474 }
462475 }
463476
qml/Stages/ShimStage.qmlnew file+44
@@ -0,0 +1,44 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.3
18+import Ubuntu.Components 0.1
19+
20+Rectangle {
21+ id: shimStage
22+
23+ anchors.fill: parent
24+ color: UbuntuColors.lightAubergine
25+
26+ Text {
27+ id: greeterModeText
28+
29+ anchors.horizontalCenter: parent.horizontalCenter
30+ anchors.top: parent.top
31+ anchors.topMargin: units.gu(10)
32+ font.bold: true
33+ horizontalAlignment: Text.AlignHCenter
34+ text: "Shell is in \"greeter\" mode"
35+ }
36+
37+ Text {
38+ anchors.centerIn: parent
39+ color: UbuntuColors.orange
40+ font.pointSize: units.gu(8)
41+ horizontalAlignment: Text.AlignHCenter
42+ text: "Shim \nStage"
43+ }
44+}
tests/autopilot/unity8/shell/emulators/dash.py+17−10
@@ -130,7 +130,7 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
130130 x, y, width, height = dash_content.globalRect
131131 # Make the drag range be a multiple of the drag "rate" value.
132132 # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
133− rate = 10
133+ rate = 5
134134 divisions = 5
135135 jump = (width / divisions) // rate * rate
136136 start_x = x + jump
@@ -146,7 +146,7 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
146146 x, y, width, height = dash_content.globalRect
147147 # Make the drag range be a multiple of the drag "rate" value.
148148 # Workarounds https://bugs.launchpad.net/mir/+bug/1399690
149− rate = 10
149+ rate = 5
150150 divisions = 5
151151 jump = (width / divisions) // rate * rate
152152 start_x = x + jump * (divisions - 1)
@@ -185,14 +185,15 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
185185
186186
187187class ListViewWithPageHeader(ubuntuuitoolkit.QQuickFlickable):
188− pass
188+
189+ margin_to_swipe_from_bottom = ubuntuuitoolkit.units.gu(4)
189190
190191
191192class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
192193 """Autopilot emulator for generic scopes."""
193194
194195 @autopilot_logging.log_action(logger.info)
195− def open_preview(self, category, app_name):
196+ def open_preview(self, category, app_name, press_duration=0.10):
196197 """Open the preview of an application.
197198
198199 :parameter category: The name of the category where the application is.
@@ -203,16 +204,19 @@ class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
203204 # FIXME some categories need a long press in order to see the preview.
204205 # Some categories do not show previews, like recent apps.
205206 # --elopio - 2014-1-14
206− self.click_scope_item(category, app_name)
207+ self.click_scope_item(category, app_name, press_duration)
207208 preview_list = self.wait_select_single(
208209 'QQuickLoader', objectName='subPageLoader')
209210 preview_list.subPageShown.wait_for(True)
210211 preview_list.x.wait_for(0)
212+ self.get_root_instance().select_single(
213+ objectName='processingIndicator').visible.wait_for(False)
211214 return preview_list.select_single(
212− Preview, objectName='preview{}'.format(preview_list.currentIndex))
215+ Preview, objectName='preview{}'.format(
216+ preview_list.initialIndex))
213217
214218 @autopilot_logging.log_action(logger.debug)
215− def click_scope_item(self, category, title):
219+ def click_scope_item(self, category, title, press_duration=0.10):
216220 """Click an item from the scope.
217221
218222 :parameter category: The name of the category where the item is.
@@ -220,9 +224,12 @@ class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
220224
221225 """
222226 category_element = self._get_category_element(category)
223− icon = category_element.wait_select_single('AbstractButton',
224− title=title)
225− self.pointing_device.click_object(icon)
227+ icon = category_element.wait_select_single(
228+ 'AbstractButton', title=title)
229+ list_view = self.select_single(
230+ ListViewWithPageHeader, objectName='categoryListView')
231+ list_view.swipe_child_into_view(icon)
232+ self.pointing_device.click_object(icon, press_duration=press_duration)
226233
227234 def _get_category_element(self, category):
228235 try:
tests/autopilot/unity8/shell/tests/test_emulators.py+6
@@ -120,6 +120,12 @@ class GenericScopeViewEmulatorTestCase(tests.DashBaseTestCase):
120120 self.assertIsInstance(preview, dash_emulators.Preview)
121121 self.assertTrue(preview.isCurrent)
122122
123+ def test_open_preview_of_non_visible_item(self):
124+ """Open an item that requires swiping to make it visible."""
125+ preview = self.generic_scope.open_preview('2', 'Title.2.0')
126+ self.assertIsInstance(preview, dash_emulators.Preview)
127+ self.assertTrue(preview.isCurrent)
128+
123129
124130class DashAppsEmulatorTestCase(tests.DashBaseTestCase):
125131
tests/plugins/Dash/cardcreator/1.res+3−2
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1918readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
@@ -34,6 +33,7 @@ Item {
3433 property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3534 visible: image.status == Image.Ready;
3635 readonly property alias image: artImage.image;
36+ property alias borderSource: artShapeShape.borderSource;
3737 ShaderEffectSource {
3838 id: artShapeSource;
3939 sourceItem: artImage;
@@ -43,6 +43,7 @@ Item {
4343 hideSource: doShapeItem;
4444 }
4545 Shape {
46+ id: artShapeShape;
4647 image: artShapeSource;
4748 anchors.fill: parent;
4849 visible: doShapeItem;
tests/plugins/Dash/cardcreator/2.res+3−8
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817Loader {
1918 id: backgroundLoader;
@@ -33,18 +32,14 @@ Loader {
3332 objectName: "backgroundImage";
3433 source: {
3534 if (cardData && typeof cardData["background"] === "string") return cardData["background"];
36− else if (template && typeof template["card-background"] === "string") return template["card-background"];
37− else return "";
35+ else return "";
3836 }
3937 }
4038 function getColor(index) {
4139 if (cardData && typeof cardData["background"] === "object"
4240 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) {
4341 return cardData["background"]["elements"][index];
44− } else if (template && typeof template["card-background"] === "object"
45− && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) {
46− return template["card-background"]["elements"][index];
47− } else return undefined;
42+ } else return index === 0 ? "#E9E9E9" : undefined;
4843 }
4944 }
5045 }
tests/plugins/Dash/cardcreator/3.res+3−2
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1918readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
@@ -34,6 +33,7 @@ Item {
3433 property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3534 visible: image.status == Image.Ready;
3635 readonly property alias image: artImage.image;
36+ property alias borderSource: artShapeShape.borderSource;
3737 ShaderEffectSource {
3838 id: artShapeSource;
3939 sourceItem: artImage;
@@ -43,6 +43,7 @@ Item {
4343 hideSource: doShapeItem;
4444 }
4545 Shape {
46+ id: artShapeShape;
4647 image: artShapeSource;
4748 anchors.fill: parent;
4849 visible: doShapeItem;
tests/plugins/Dash/cardcreator/4.res+1−2
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817readonly property size artShapeSize: Qt.size(-1, -1);
1918readonly property int headerHeight: row.height;
tests/plugins/Dash/cardcreator/5.res+3−2
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: false;
1716
1817onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1918readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
@@ -34,6 +33,7 @@ Item {
3433 property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3534 visible: image.status == Image.Ready;
3635 readonly property alias image: artImage.image;
36+ property alias borderSource: artShapeShape.borderSource;
3737 ShaderEffectSource {
3838 id: artShapeSource;
3939 sourceItem: artImage;
@@ -43,6 +43,7 @@ Item {
4343 hideSource: doShapeItem;
4444 }
4545 Shape {
46+ id: artShapeShape;
4647 image: artShapeSource;
4748 anchors.fill: parent;
4849 visible: doShapeItem;
tests/plugins/Dash/cardcreator/5.tst+1−1
@@ -1,3 +1,3 @@
1−template: {"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
1+template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
22components: {"art":{"aspect-ratio":1,"field":"art"},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
33result: 5.res
tests/plugins/Dash/cardcreator/6.res+3−8
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817Loader {
1918 id: backgroundLoader;
@@ -33,18 +32,14 @@ Loader {
3332 objectName: "backgroundImage";
3433 source: {
3534 if (cardData && typeof cardData["background"] === "string") return cardData["background"];
36− else if (template && typeof template["card-background"] === "string") return template["card-background"];
37− else return "";
35+ else return "http://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-grey.png";
3836 }
3937 }
4038 function getColor(index) {
4139 if (cardData && typeof cardData["background"] === "object"
4240 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) {
4341 return cardData["background"]["elements"][index];
44− } else if (template && typeof template["card-background"] === "object"
45− && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) {
46− return template["card-background"]["elements"][index];
47− } else return undefined;
42+ } else return index === 0 ? undefined : undefined;
4843 }
4944 }
5045 }
tests/plugins/Dash/cardcreator/6.tst+1−1
@@ -1,3 +1,3 @@
1−template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
1+template: {"card-background":"http://assets.ubuntu.com/sites/ubuntu/latest/u/img/logos/logo-ubuntu-grey.png","card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
22components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"subtitle":{"field":"author"},"title":{"field":"title"},"emblem":{"field":"source"},"attributes":{}}
33result: 6.res
tests/plugins/Dash/cardcreator/7.res+3−8
@@ -1,6 +1,5 @@
11AbstractButton {
22 id: root;
3− property var template;
43 property var components;
54 property var cardData;
65 property var artShapeBorderSource: undefined;
@@ -13,7 +12,7 @@ AbstractButton {
1312 property bool asynchronous: true;
1413 property bool showHeader: true;
1514 implicitWidth: childrenRect.width;
16− enabled: root.template == null ? true : (root.template["non-interactive"] !== undefined ? !root.template["non-interactive"] : true);
15+ enabled: true;
1716
1817Loader {
1918 id: backgroundLoader;
@@ -33,18 +32,14 @@ Loader {
3332 objectName: "backgroundImage";
3433 source: {
3534 if (cardData && typeof cardData["background"] === "string") return cardData["background"];
36− else if (template && typeof template["card-background"] === "string") return template["card-background"];
37− else return "";
35+ else return "";
3836 }
3937 }
4038 function getColor(index) {
4139 if (cardData && typeof cardData["background"] === "object"
4240 && (cardData["background"]["type"] === "color" || cardData["background"]["type"] === "gradient")) {
4341 return cardData["background"]["elements"][index];
44− } else if (template && typeof template["card-background"] === "object"
45− && (template["card-background"]["type"] === "color" || template["card-background"]["type"] === "gradient")) {
46− return template["card-background"]["elements"][index];
47− } else return undefined;
42+ } else return index === 0 ? "#E9E9E9" : "#E9AAE9";
4843 }
4944 }
5045 }
tests/plugins/Dash/cardcreator/7.tst+1−1
@@ -1,3 +1,3 @@
1−template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
1+template: {"card-background":{"elements":["#E9E9E9","#E9AAE9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2}
22components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}}
33result: 7.res
tests/qmltests/Dash/tst_Card.qml−1
@@ -124,7 +124,6 @@ Rectangle {
124124 sourceComponent: cardTool.cardComponent
125125 clip: true
126126 onLoaded: {
127− item.template = Qt.binding(function() { return cardTool.template; });
128127 item.components = Qt.binding(function() { return cardTool.components; });
129128 item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); });
130129 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
tests/qmltests/Dash/tst_GenericScopeView.qml+30−7
@@ -302,6 +302,7 @@ Item {
302302 }
303303
304304 function closePreview() {
305+ tryCompare(testCase.subPageLoader, "x", 0);
305306 var closePreviewMouseArea = findChild(subPageLoader.item, "pageHeader");
306307 mouseClick(closePreviewMouseArea, units.gu(2), units.gu(2));
307308
@@ -616,27 +617,49 @@ Item {
616617 waitForRendering(category0);
617618
618619 var cardTool = findChild(category0, "cardTool");
619− var cardGrid = category0.item;
620−
621620 cardTool.template["non-interactive"] = true;
621+ cardTool.templateChanged();
622+
623+ var category0 = findChild(categoryListView, "dashCategory0");
624+ waitForRendering(category0);
625+
626+ var cardGrid = category0.item;
622627 compare(cardGrid.cardTool.template["non-interactive"], true);
623628
624629 var item0 = findChild(cardGrid, "delegate0");
625630 waitForRendering(item0);
626− item0.template = cardTool.template;
627− compare(item0.template["non-interactive"], true);
628631 compare(item0.enabled, false);
629632 var touchdown = findChild(item0, "touchdown");
630633
631634 compare(touchdown.visible, false);
632− mouseClick(item0);
635+ mousePress(item0);
633636 compare(touchdown.visible, false);
637+ mouseRelease(item0);
634638
635639 cardTool.template["non-interactive"] = false;
640+ cardTool.templateChanged();
636641 compare(cardGrid.cardTool.template["non-interactive"], false);
637− item0.template = cardTool.template;
638− compare(item0.template["non-interactive"], false);
642+
643+ waitForRendering(category0);
644+ item0 = findChild(cardGrid, "delegate0");
639645 compare(item0.enabled, true);
646+ var touchdown = findChild(item0, "touchdown");
647+
648+ compare(touchdown.visible, false);
649+ mousePress(item0);
650+ compare(touchdown.visible, true);
651+ mouseRelease(item0);
652+ compare(touchdown.visible, false);
653+ closePreview();
654+ }
655+
656+ function test_carousel_borderSource() {
657+ var category = scrollToCategory("dashCategory1");
658+ var tile = findChild(category, "carouselDelegate0");
659+ tryCompareFunction(function() { return findChild(tile, "artShapeLoader") !== null; }, true);
660+ var artShapeLoader = findChild(tile, "artShapeLoader");
661+ var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");
662+ compare(shape.borderSource, undefined);
640663 }
641664 }
642665 }
tests/qmltests/Tutorial/tst_Tutorial.qml+1
@@ -73,6 +73,7 @@ Item {
7373 sourceComponent: Component {
7474 Shell {
7575 property string indicatorProfile: "phone"
76+ property string shellMode: "full-greeter" /* default */
7677
7778 Component.onDestruction: {
7879 shellLoader.itemDestroyed = true;
tests/qmltests/tst_Shell.qml+2
@@ -81,6 +81,8 @@ Rectangle {
8181 property bool itemDestroyed: false
8282 sourceComponent: Component {
8383 Shell {
84+ property string shellMode: "full-greeter" /* default */
85+
8486 usageScenario: "phone"
8587 orientation: Qt.PortraitOrientation
8688 primaryOrientation: Qt.PortraitOrientation
tests/qmltests/tst_ShellWithPin.qml+2
@@ -69,6 +69,8 @@ Item {
6969 property bool itemDestroyed: false
7070 sourceComponent: Component {
7171 Shell {
72+ property string shellMode: "full-greeter" /* default */
73+
7274 Component.onDestruction: {
7375 shellLoader.itemDestroyed = true
7476 }
tests/utils/modules/Unity/Test/UnityTestCase.qml+2−1
@@ -26,6 +26,7 @@ TestCase {
2626 // This is needed for waitForRendering calls to return
2727 // if the watched element already got rendered
2828 Rectangle {
29+ id: rotatingRectangle
2930 width: units.gu(1)
3031 height: width
3132 parent: testCase.parent
@@ -35,7 +36,7 @@ TestCase {
3536 visible: testCase.running
3637
3738 RotationAnimation on rotation {
38− running: parent.visible
39+ running: rotatingRectangle.visible
3940 from: 0
4041 to: 360
4142 loops: Animation.Infinite