on xenial help sign in
Merge from trunk
commit49c02bd74ee819ee68a91264eddbcd09ae756811 authorMichael Terry <michael.terry@canonical.com> dateWed 28 May 2014, 09:17 (12 years ago) parent924481a39afe1f
35 files changed+521−322
cmake/modules/QmlTest.cmake+4−4 debian/changelog+41 plugins/Dash/CardCreator.js+3−3 plugins/Dash/abstractdashview.cpp+3 po/de.po+5−3 po/it.po+12−12 po/pl.po+14−12 qml/Components/Lockscreen.qml+91−6 qml/Components/PassphraseLockscreen.qml+6−2 qml/Components/PinLockscreen.qml+29−11 qml/Components/PinPadButton.qml+2−1 qml/Dash/CardCarousel.qml+1−1 qml/Dash/GenericScopeView.qml+1−1 qml/Dash/Previews/PreviewHeader.qml+3 qml/GreeterShell.qml+8−2 qml/Shell.qml−9 tests/autopilot/unity8/shell/emulators/main_window.py−4 tests/mocks/Unity/CMakeLists.txt−1 tests/mocks/Unity/fake_categories.cpp+5−1 tests/mocks/Unity/iconutils.cpp−124 tests/mocks/Unity/iconutils.h−29 tests/plugins/Dash/cardcreator/1.res+3−3 tests/plugins/Dash/cardcreator/2.res+1−1 tests/plugins/Dash/cardcreator/3.res+3−3 tests/plugins/Dash/cardcreator/4.res+1−1 tests/plugins/Dash/cardcreator/5.res+3−3 tests/plugins/Dash/organicgridtest.cpp+5 tests/qmltests/CMakeLists.txt−1 tests/qmltests/Components/tst_ZoomableImage.qml+21−19 tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+12−7 tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+7−5 tests/qmltests/Dash/tst_DashContent.qml+29−14 tests/qmltests/Dash/tst_GenericScopeView.qml+1 tests/qmltests/Greeter/tst_Lockscreen.qml+207−30 tests/qmltests/tst_Shell.qml−9
cmake/modules/QmlTest.cmake+4−4
@@ -51,7 +51,7 @@ macro(add_manual_qml_test SUBPATH COMPONENT_NAME)
5151
5252 set(qmlscene_command
5353 env ${qmltest_ENVIRONMENT}
54− ${qmlscene_exe} ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
54+ ${qmlscene_exe} -qmljsdebugger=port:3768 ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
5555 ${qmlscene_imports}
5656 )
5757 add_custom_target(${qmlscene_TARGET} ${qmlscene_command})
@@ -111,9 +111,9 @@ macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
111111 -o -,txt
112112 ${function_ARGS}
113113 )
114− find_program( HAVE_GCC gcc )
115− if (NOT ${HAVE_GCC} STREQUAL "")
116− exec_program( gcc ARGS "-dumpmachine" OUTPUT_VARIABLE ARCH_TRIPLET )
114+ find_program(DPKG dpkg-architecture)
115+ if(DPKG)
116+ exec_program(${DPKG} ARGS "-qDEB_BUILD_MULTIARCH" OUTPUT_VARIABLE ARCH_TRIPLET )
117117 set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1")
118118 endif()
119119 set(qmltest_xvfb_command
debian/changelog+41
@@ -4,6 +4,47 @@ unity8 (7.87+14.10.20140505-0ubuntu1) UNRELEASED; urgency=medium
44
55 -- Michael Terry <mterry@ubuntu.com> Wed, 02 Apr 2014 14:39:45 -0400
66
7+unity8 (7.86+14.10.20140527-0ubuntu1) utopic; urgency=low
8+
9+ [ Andrea Cimitan ]
10+ * Passes to make tryCommand -qmljsdebugger=port:3768 to enable
11+ debug/profiling test apps
12+ * Fixes carousel shadow
13+
14+ [ Michał Sawicz ]
15+ * Use dpkg-architecture, not gcc, to determine the machine triplet.
16+
17+ [ Ying-Chun Liu ]
18+ * Fix ZoomableImage test failure. (LP: #1317254)
19+
20+ [ Albert Astals ]
21+ * We don't need iconutils in this mock
22+ * Don't reserve space for mascot if no mascot is specified (LP:
23+ #1319343)
24+ * CardHeader is no more, remove stale line in CMakeLists.txt
25+ * GenericScopeViewTest: Wait a bit more Otherwise sometimes we end
26+ getting up the wrong delegate (maybe one that will be garbage
27+ collected?) (LP: #1322279)
28+ * Fix crash in organicgridtest
29+
30+ [ Daniel d'Andrada ]
31+ * Remove Shell's underlay background image as it cannot be seen
32+ anymore Now that the Dash has its own, opaque, background, the
33+ underlay's background image can no longer be seen. So it's just a
34+ waste of resources to have it.
35+
36+ [ Michael Terry ]
37+ * Use the same animation when dismissing a greeter slide from the
38+ launcher as from a normal greeter drag. (LP: #1316513)
39+
40+ [ Michael Zanetti ]
41+ * enhance lockscreen add a retry indication label (e.g. 3 attempts
42+ left). add an additional label (e.g. phone number for multi sim).
43+ add a infoPopup (e.g. to display a warning for last retry). add min
44+ and max limit values. add tests for the above (LP: #1302050)
45+
46+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 27 May 2014 07:47:11 +0000
47+
748unity8 (7.86+14.10.20140522-0ubuntu1) utopic; urgency=low
849
950 [ Albert Astals ]
plugins/Dash/CardCreator.js+3−3
@@ -70,10 +70,9 @@ var kArtShapeHolderCode = 'Item { \n\
7070 radius: "medium"; \n\
7171 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
7272 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; \n\
73− Component.onCompleted: updateWidthHeightBindings(); \n\
73+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
7474 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); \n\
7575 visible: image.status == Image.Ready; \n\
76− borderSource: artShapeBorderSource; \n\
7776 function updateWidthHeightBindings() { \n\
7877 if (aspectSmallerThanImageAspect) { \n\
7978 width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\
@@ -281,7 +280,7 @@ function cardString(template, components) {
281280 property var template; \n\
282281 property var components; \n\
283282 property var cardData; \n\
284− property var artShapeBorderSource; \n\
283+ property var artShapeBorderSource: undefined; \n\
285284 property real fontScale: 1.0; \n\
286285 property int headerAlignment: Text.AlignLeft; \n\
287286 property int fixedHeaderHeight: -1; \n\
@@ -307,6 +306,7 @@ function cardString(template, components) {
307306 }
308307
309308 if (hasArt) {
309+ code += 'onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } \n';
310310 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
311311
312312 var widthCode, heightCode;
plugins/Dash/abstractdashview.cpp+3
@@ -176,6 +176,9 @@ void AbstractDashView::refill()
176176
177177bool AbstractDashView::addVisibleItems(qreal fillFromY, qreal fillToY, bool asynchronous)
178178{
179+ if (fillToY <= fillFromY)
180+ return false;
181+
179182 if (!delegate())
180183 return false;
181184
po/de.po+5−3
@@ -8,13 +8,13 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-05-20 13:45+0000\n"
12−"Last-Translator: Tobias Bannert <Unknown>\n"
11+"PO-Revision-Date: 2014-05-27 14:09+0000\n"
12+"Last-Translator: Phillip Sz <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"
17−"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
17+"X-Launchpad-Export-Date: 2014-05-28 05:54+0000\n"
1818"X-Generator: Launchpad (build 17017)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
@@ -73,6 +73,8 @@ msgid ""
7373"You have now mastered the edge gestures and can start using the "
7474"phone<br><br>Tap on the screen to start"
7575msgstr ""
76+"Sie haben nun die Kantengesten erfolgreich erlernt und können das Telefon "
77+"nun nutzen<br><br>Zum Starten auf den Bildschirm tippen"
7678
7779#: qml/Components/PageHeader.qml:365
7880msgid "Recent searches"
po/it.po+12−12
@@ -8,14 +8,14 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-01-22 09:15+0000\n"
12−"Last-Translator: Domenico <domenico.verde125@live.it>\n"
11+"PO-Revision-Date: 2014-05-23 11:52+0000\n"
12+"Last-Translator: Gio <gio.scino@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"
17−"X-Launchpad-Export-Date: 2014-05-01 06:43+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
17+"X-Launchpad-Export-Date: 2014-05-24 06:52+0000\n"
18+"X-Generator: Launchpad (build 17017)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
2121#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -83,28 +83,28 @@ msgstr "Ricerche recenti"
8383
8484#: qml/Components/SeeMore.qml:35
8585msgid "See more"
86−msgstr ""
86+msgstr "Mostra di più"
8787
8888#: qml/Components/SeeMore.qml:58
8989msgid "See less"
90−msgstr ""
90+msgstr "Mostra meno"
9191
9292#: qml/Dash/DashApps.qml:37
9393msgid "Recent"
94−msgstr ""
94+msgstr "Recenti"
9595
9696#: qml/Dash/PreviewListView.qml:52
9797#, qt-format
9898msgid "%1 Preview"
99−msgstr ""
99+msgstr "Anteprime: %1"
100100
101101#: qml/Dash/Previews/PreviewActionCombo.qml:34
102102msgid "More..."
103−msgstr ""
103+msgstr "Altro..."
104104
105105#: qml/Dash/Previews/PreviewActionCombo.qml:34
106106msgid "Less..."
107−msgstr ""
107+msgstr "Meno..."
108108
109109#: qml/Dash/Previews/PreviewRatingInput.qml:81
110110msgid "Rate this"
@@ -120,7 +120,7 @@ msgstr "Invia"
120120
121121#: qml/Greeter/Greeter.qml:151
122122msgid "Swipe to unlock"
123−msgstr ""
123+msgstr "Scorrere per sbloccare"
124124
125125#: qml/Greeter/Lockscreen.qml:149
126126msgid "Emergency Call"
@@ -161,7 +161,7 @@ msgstr "Mostra password"
161161
162162#: qml/Notifications/NotificationMenuItemFactory.qml:103
163163msgid "Please enter SIM PIN"
164−msgstr ""
164+msgstr "Inserire il codice PIN"
165165
166166#: qml/Panel/SearchIndicator.qml:27
167167msgid "Search"
po/pl.po+14−12
@@ -8,14 +8,14 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-04-10 11:13-0400\n"
11−"PO-Revision-Date: 2014-01-10 11:38+0000\n"
12−"Last-Translator: Michał Sawicz <michal.sawicz@canonical.com>\n"
11+"PO-Revision-Date: 2014-05-27 15:20+0000\n"
12+"Last-Translator: GTriderXC <gtriderxc@yahoo.com>\n"
1313"Language-Team: Polish <pl@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-05-01 06:44+0000\n"
18−"X-Generator: Launchpad (build 16985)\n"
17+"X-Launchpad-Export-Date: 2014-05-28 05:54+0000\n"
18+"X-Generator: Launchpad (build 17017)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
2121#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -73,6 +73,8 @@ msgid ""
7373"You have now mastered the edge gestures and can start using the "
7474"phone<br><br>Tap on the screen to start"
7575msgstr ""
76+"Wydawanie poleceń krawędzi zostało opanowane. Urządzenie gotowe do "
77+"pracy.<br><br>Dotknij ekranu by rozpocząć"
7678
7779#: qml/Components/PageHeader.qml:365
7880msgid "Recent searches"
@@ -80,28 +82,28 @@ msgstr "Ostatnie wyszukiwania"
8082
8183#: qml/Components/SeeMore.qml:35
8284msgid "See more"
83−msgstr ""
85+msgstr "Zobacz więcej"
8486
8587#: qml/Components/SeeMore.qml:58
8688msgid "See less"
87−msgstr ""
89+msgstr "Zobacz mniej"
8890
8991#: qml/Dash/DashApps.qml:37
9092msgid "Recent"
91−msgstr ""
93+msgstr "Ostatnio używane"
9294
9395#: qml/Dash/PreviewListView.qml:52
9496#, qt-format
9597msgid "%1 Preview"
96−msgstr ""
98+msgstr "%1 Podgląd"
9799
98100#: qml/Dash/Previews/PreviewActionCombo.qml:34
99101msgid "More..."
100−msgstr ""
102+msgstr "Więcej..."
101103
102104#: qml/Dash/Previews/PreviewActionCombo.qml:34
103105msgid "Less..."
104−msgstr ""
106+msgstr "Mniej..."
105107
106108#: qml/Dash/Previews/PreviewRatingInput.qml:81
107109msgid "Rate this"
@@ -117,7 +119,7 @@ msgstr "Wyślij"
117119
118120#: qml/Greeter/Greeter.qml:151
119121msgid "Swipe to unlock"
120−msgstr ""
122+msgstr "Przeciągnij aby odblokować"
121123
122124#: qml/Greeter/Lockscreen.qml:149
123125msgid "Emergency Call"
@@ -158,7 +160,7 @@ msgstr "Wyświetl hasło"
158160
159161#: qml/Notifications/NotificationMenuItemFactory.qml:103
160162msgid "Please enter SIM PIN"
161−msgstr ""
163+msgstr "Wprowadź kod PIN karty SIM"
162164
163165#: qml/Panel/SearchIndicator.qml:27
164166msgid "Search"
qml/Components/Lockscreen.qml+91−6
@@ -15,7 +15,8 @@
1515 */
1616
1717import QtQuick 2.0
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.0
19+import Ubuntu.Components.Popups 1.0
1920
2021Showable {
2122 id: root
@@ -25,17 +26,32 @@ Showable {
2526
2627 // Placeholder text
2728 property string placeholderText: ""
29+ // Placeholder text while shaking (e.g. Incorrect passprase)
30+ property string wrongPlaceholderText: ""
31+ // Retries text (e.g. 3 retries left)
32+ property string retryText: ""
33+
34+ // Informational text. (e.g. some text to tell which domain this is pin is entered for.
35+ property string infoText: ""
2836
2937 // In case the Lockscreen can show a greeter message, this is the username
3038 property string username: ""
3139
32− // Set this to a value greater 0 to enable auto-confirm behavior for the lockscreen.
33− // This is ignored by the alphaNumeric lockscreen as that one is confirmed with pressing enter on the OSK.
34− property int pinLength: -1
40+ // Set those to a value greater 0 to restrict the pin length.
41+ // If both are unset, the Lockscreen will show a confirm button and allow typing any length of pin before
42+ // confirming. If minPinLength is set to a value > 0, the confirm button will only become active when the
43+ // entered pin is at least that long. If maxPinLength is set, the lockscreen won't allow entering any
44+ // more numbers than that. If both are set to the same value, the lockscreen will enter auto confirming
45+ // behavior, hiding the confirmation button and triggering that automatically when the entered pin reached
46+ // that length. This is ignored by the alphaNumeric lockscreen as that one is always confirmed by pressing
47+ // enter on the OSK.
48+ property int minPinLength: -1
49+ property int maxPinLength: -1
3550
3651 signal entered(string passphrase)
3752 signal cancel()
3853 signal emergencyCall()
54+ signal infoPopupConfirmed()
3955
4056 onRequiredChanged: {
4157 if (required && pinPadLoader.item) {
@@ -53,10 +69,51 @@ Showable {
5369 pinPadLoader.item.clear(showAnimation);
5470 }
5571
72+ function showInfoPopup(title, text) {
73+ PopupUtils.open(infoPopupComponent, root, {title: title, text: text})
74+ }
75+
5676 MouseArea {
5777 anchors.fill: root
5878 }
5979
80+ Column {
81+ spacing: units.gu(2)
82+ anchors {
83+ left: parent.left
84+ right: parent.right
85+ bottom: pinPadLoader.top
86+ bottomMargin: units.gu(2)
87+ }
88+ Label {
89+ objectName: "retryCountLabel"
90+ anchors {
91+ left: parent.left
92+ right: parent.right
93+ }
94+ text: root.retryText
95+ horizontalAlignment: Text.AlignHCenter
96+ color: "#f3f3e7"
97+ opacity: 0.6
98+ visible: root.retryText.length > 0
99+ }
100+ Label {
101+ id: infoTextLabel
102+ objectName: "infoTextLabel"
103+ anchors {
104+ left: parent.left
105+ right: parent.right
106+ }
107+ text: root.infoText
108+ horizontalAlignment: Text.AlignHCenter
109+ color: "#f3f3e7"
110+ opacity: 0.6
111+ visible: root.infoText.length > 0
112+ }
113+ }
114+
115+
116+
60117 Loader {
61118 id: pinPadLoader
62119 objectName: "pinPadLoader"
@@ -84,14 +141,24 @@ Showable {
84141
85142 Binding {
86143 target: pinPadLoader.item
87− property: "pinLength"
88− value: root.pinLength
144+ property: "minPinLength"
145+ value: root.minPinLength
146+ }
147+ Binding {
148+ target: pinPadLoader.item
149+ property: "maxPinLength"
150+ value: root.maxPinLength
89151 }
90152 Binding {
91153 target: pinPadLoader.item
92154 property: "placeholderText"
93155 value: root.placeholderText
94156 }
157+ Binding {
158+ target: pinPadLoader.item
159+ property: "wrongPlaceholderText"
160+ value: root.wrongPlaceholderText
161+ }
95162 Binding {
96163 target: pinPadLoader.item
97164 property: "username"
@@ -132,4 +199,22 @@ Showable {
132199 anchors.horizontalCenter: parent.horizontalCenter
133200 }
134201 }
202+
203+ Component {
204+ id: infoPopupComponent
205+ Dialog {
206+ id: dialog
207+ objectName: "infoPopup"
208+ modal: true
209+
210+ Button {
211+ objectName: "infoPopupOkButton"
212+ text: i18n.tr("OK")
213+ onClicked: {
214+ PopupUtils.close(dialog)
215+ root.infoPopupConfirmed();
216+ }
217+ }
218+ }
219+ }
135220}
qml/Components/PassphraseLockscreen.qml+6−2
@@ -22,7 +22,8 @@ Item {
2222 id: root
2323 height: highlightItem.height
2424
25− property alias placeholderText: pinentryField.placeholderText
25+ property string placeholderText
26+ property string wrongPlaceholderText
2627 property string username: ""
2728
2829 signal entered(string passphrase)
@@ -73,9 +74,12 @@ Item {
7374 echoMode: TextInput.Password
7475 opacity: 0.9
7576 hasClearButton: false
77+ placeholderText: wrongPasswordAnimation.running ? root.wrongPlaceholderText : root.placeholderText
7678
7779 onAccepted: {
78− root.entered(pinentryField.text);
80+ if (pinentryField.text) {
81+ root.entered(pinentryField.text);
82+ }
7983 }
8084 }
8185 }
qml/Components/PinLockscreen.qml+29−11
@@ -25,9 +25,11 @@ Column {
2525 spacing: units.gu(3.5)
2626
2727 property alias placeholderText: pinentryField.placeholderText
28+ property alias wrongPlaceholderText: pinentryField.wrongPlaceholderText
2829 property int padWidth: units.gu(34)
2930 property int padHeight: units.gu(28)
30− property int pinLength: -1
31+ property int minPinLength: -1
32+ property int maxPinLength: -1
3133
3234 signal entered(string passphrase)
3335 signal cancel()
@@ -41,6 +43,10 @@ Column {
4143 }
4244 }
4345
46+ QtObject {
47+ id: priv
48+ property bool autoConfirm: root.minPinLength == root.maxPinLength && root.minPinLength != -1
49+ }
4450
4551 UbuntuShape {
4652 id: pinentryField
@@ -52,12 +58,20 @@ Column {
5258 radius: "medium"
5359 property string text: ""
5460 property string placeholderText: ""
61+ property string wrongPlaceholderText: ""
62+
63+ function appendChar(character) {
64+ if (root.maxPinLength == -1 || pinentryField.text.length < root.maxPinLength) {
65+ pinentryField.text = pinentryField.text + character;
66+ }
67+ }
68+
5569 onTextChanged: {
5670 pinentryFieldLabel.text = "";
5771 for (var i = 0; i < text.length; ++i) {
5872 pinentryFieldLabel.text += "•";
5973 }
60− if (text.length === root.pinLength) {
74+ if (priv.autoConfirm && text.length === root.maxPinLength) {
6175 root.entered(text);
6276 }
6377 }
@@ -74,9 +88,11 @@ Column {
7488 }
7589 Label {
7690 id: pinentryFieldPlaceHolder
91+ objectName: "pinentryFieldPlaceHolder"
7792 anchors.centerIn: parent
78− color: "grey"
79− text: parent.placeholderText
93+ color: "#f3f3e7"
94+ opacity: 0.6
95+ text: wrongPasswordAnimation.running ? parent.wrongPlaceholderText : parent.placeholderText
8096 visible: pinentryFieldLabel.text.length == 0
8197 }
8298
@@ -91,9 +107,11 @@ Column {
91107 bottom: parent.bottom
92108 bottomMargin: units.gu(1)
93109 }
94− visible: root.pinLength == -1
110+ visible: !priv.autoConfirm
95111 width: height
96112 name: "erase"
113+ color: "#f3f3e7"
114+ opacity: 0.6
97115 MouseArea {
98116 anchors.fill: parent
99117 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1);
@@ -168,7 +186,7 @@ Column {
168186 enabled: entryEnabled
169187
170188 onClicked: {
171− pinentryField.text = pinentryField.text + text;
189+ pinentryField.appendChar(text);
172190 }
173191 }
174192 }
@@ -186,7 +204,7 @@ Column {
186204 width: root.padWidth / 3
187205 height: root.padHeight / 4
188206 text: "0"
189− onClicked: pinentryField.text = pinentryField.text + text
207+ onClicked: pinentryField.appendChar(text);
190208 enabled: entryEnabled
191209 }
192210
@@ -194,16 +212,16 @@ Column {
194212 objectName: "pinPadButtonErase"
195213 width: root.padWidth / 3
196214 height: root.padHeight / 4
197− iconName: root.pinLength == -1 ? "" : "erase"
198− subText: root.pinLength == -1 ? "DONE" : ""
215+ iconName: priv.autoConfirm ? "erase" : ""
216+ subText: priv.autoConfirm ? "" : "DONE"
199217 onClicked: {
200− if (root.pinLength !== -1) {
218+ if (priv.autoConfirm) {
201219 pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1);
202220 } else {
203221 root.entered(pinentryField.text);
204222 }
205223 }
206− enabled: entryEnabled
224+ enabled: priv.autoConfirm ? entryEnabled : pinentryField.text.length >= root.minPinLength
207225 }
208226 }
209227 }
qml/Components/PinPadButton.qml+2−1
@@ -19,6 +19,7 @@ import Ubuntu.Components 0.1
1919
2020Item {
2121 id: root
22+ opacity: enabled ? 1 : 0.6
2223
2324 property alias text: label.text
2425 property alias subText: subTextLabel.text
@@ -62,7 +63,7 @@ Item {
6263 Label {
6364 id: subTextLabel
6465 fontSize: "small"
65− color: "grey"
66+ color: "#f3f3e7"
6667 anchors.horizontalCenter: parent.horizontalCenter
6768 visible: text.length > 0
6869 }
qml/Dash/CardCarousel.qml+1−1
@@ -34,7 +34,7 @@ DashRenderer {
3434 Carousel {
3535 id: carousel
3636 anchors.fill: parent
37− tileAspectRatio: cardCarousel.components && cardCarousel.components["art"]["aspect-ratio"] || 1.0
37+ tileAspectRatio: cardTool.components && cardTool.components["art"]["aspect-ratio"] || 1.0
3838 // FIXME we need to "reverse" the carousel to make the selected item the size
3939 // and push others back.
4040 minimumTileWidth: cardTool.cardWidth / selectedItemScaleFactor
qml/Dash/GenericScopeView.qml+1−1
@@ -128,7 +128,7 @@ FocusScope {
128128
129129 CardTool {
130130 id: cardTool
131−
131+ objectName: "cardTool"
132132 count: results.count
133133 template: model.renderer
134134 components: model.components
qml/Dash/Previews/PreviewHeader.qml+3
@@ -56,6 +56,9 @@ PreviewWidget {
5656
5757 Loader {
5858 id: mascotShapeLoader
59+ objectName: "mascotShapeLoader"
60+ active: headerRoot.mascot != ""
61+ visible: active
5962
6063 anchors.verticalCenter: parent.verticalCenter
6164 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
qml/GreeterShell.qml+8−2
@@ -58,7 +58,8 @@ BasicShell {
5858 x: required ? 0 : - width
5959 width: parent.width
6060 height: parent.height - panel.panelHeight
61− pinLength: 4
61+ minPinLength: 4
62+ maxPinLength: 4
6263
6364 onEntered: LightDM.Greeter.respond(passphrase);
6465 onCancel: greeter.show()
@@ -116,7 +117,10 @@ BasicShell {
116117 width: parent.width
117118 height: parent.height
118119
119− Behavior on x {SmoothedAnimation{velocity: 600}}
120+ Behavior on x {
121+ enabled: !launcher.dashSwipe
122+ StandardAnimation {}
123+ }
120124
121125 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
122126 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
@@ -189,6 +193,8 @@ BasicShell {
189193 Launcher {
190194 id: launcher
191195
196+ readonly property bool dashSwipe: progress > 0
197+
192198 anchors.top: parent.top
193199 anchors.bottom: parent.bottom
194200 width: parent.width
qml/Shell.qml−9
@@ -98,15 +98,6 @@ BasicShell {
9898 // through the translucent parts of the shell surface.
9999 visible: !fullyCovered && !applicationSurfaceShouldBeSeen
100100
101− CrossFadeImage {
102− id: backgroundImage
103− objectName: "backgroundImage"
104−
105− anchors.fill: parent
106− source: shell.background
107− fillMode: Image.PreserveAspectCrop
108− }
109−
110101 Rectangle {
111102 anchors.fill: parent
112103 color: "black"
tests/autopilot/unity8/shell/emulators/main_window.py−4
@@ -114,10 +114,6 @@ class QQuickView(emulators.UnityEmulatorBase):
114114 self.wait_select_single('Indicators', fullyOpened=True)
115115 return self._get_indicator_page(indicator_name)
116116
117− def get_shell_background(self):
118− return self.select_single(
119− "CrossFadeImage", objectName="backgroundImage")
120−
121117 @autopilot_logging.log_action(logger.info)
122118 def show_dash_swiping(self):
123119 """Show the dash swiping from the left."""
tests/mocks/Unity/CMakeLists.txt−1
@@ -19,7 +19,6 @@ include_directories(
1919add_definitions(-DQT_NO_KEYWORDS)
2020
2121set(UnityQML_SOURCES
22− iconutils.cpp
2322 fake_scope.cpp
2423 fake_scopes.cpp
2524 fake_categories.cpp
tests/mocks/Unity/fake_categories.cpp+5−1
@@ -152,7 +152,11 @@ Categories::data(const QModelIndex& index, int role) const
152152 case RoleComponents:
153153 {
154154 QVariantMap map, artMap;
155− artMap["aspect-ratio"] = "1.0";
155+ if (index.row() % 2 != 0) {
156+ artMap["aspect-ratio"] = QString("1.%1").arg(index.row());
157+ } else {
158+ artMap["aspect-ratio"] = "1.0";
159+ }
156160 artMap["field"] = "art";
157161 map["art"] = artMap;
158162 map["title"] = "HOLA";
tests/mocks/Unity/iconutils.cppdeleted−124
@@ -1,124 +0,0 @@
1−/*
2− * Copyright (C) 2013 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− * Authors:
17− * Michal Hruby <michal.hruby@canonical.com>
18− */
19−
20−#include "iconutils.h"
21−
22−#include <gio/gio.h>
23−
24−#include <QStringList>
25−#include <QUrl>
26−#include <QUrlQuery>
27−
28−#define BASE_THEME_ICON_URI "image://theme/"
29−#define BASE_THUMBNAILER_URI "image://thumbnailer/"
30−#define BASE_ALBUMART_URI "image://albumart/"
31−
32−QString gIconToDeclarativeImageProviderString(QString const &giconString)
33−{
34− if (giconString.isEmpty()) return giconString;
35−
36− if (giconString.startsWith('/') || giconString.startsWith(QLatin1String("http")) ||
37− giconString.startsWith(QLatin1String("file:")) || giconString.startsWith(QLatin1String("image:"))) {
38− return giconString;
39− }
40−
41− if (!giconString.startsWith(QLatin1String(". "))) {
42− // must be a themed icon
43− QString themedIcon(BASE_THEME_ICON_URI);
44− themedIcon.append(giconString);
45− return themedIcon;
46− }
47−
48− // special case annotated icon
49− if (giconString.startsWith(QLatin1String(". UnityProtocolAnnotatedIcon "))) {
50− QString annotatedIcon;
51− QString serializedData(QUrl::fromPercentEncoding(giconString.mid(29).toUtf8()));
52− GVariant *variant = g_variant_parse(G_VARIANT_TYPE_VARDICT, serializedData.toUtf8().constData(), NULL, NULL, NULL);
53− gchar *baseUri;
54− if (variant != NULL && g_variant_lookup(variant, "base-icon", "&s", &baseUri)) {
55− annotatedIcon = gIconToDeclarativeImageProviderString(QString(baseUri));
56− // FIXME: enclose in image://annotated/... once unity supports that
57− }
58− if (variant != NULL) g_variant_unref(variant);
59−
60− return annotatedIcon;
61− }
62−
63− // handle real gicon strings
64− QString result;
65− GError *error = NULL;
66− GIcon *icon = g_icon_new_for_string(giconString.toLocal8Bit().constData(), &error);
67− if (error != NULL || icon == NULL) {
68− qWarning("Unable to deserialize icon: %s", giconString.toLocal8Bit().constData());
69− g_clear_error(&error);
70− return result;
71− }
72−
73− if (G_IS_THEMED_ICON(icon)) {
74− QString themedIcon(BASE_THEME_ICON_URI);
75− QStringList list;
76− const char* const *iconNames = g_themed_icon_get_names(G_THEMED_ICON(icon));
77− if (iconNames != NULL) {
78− for (const char * const *iter = iconNames; *iter != NULL; ++iter) {
79− list << QLatin1String(*iter);
80− }
81− }
82− themedIcon.append(list.join(QString(",")));
83− result = themedIcon;
84− } else if (G_IS_FILE_ICON(icon)) {
85− GFile *file = g_file_icon_get_file(G_FILE_ICON(icon));
86− gchar *uri = g_file_get_uri(file);
87− QString iconUri(uri);
88− g_free(uri);
89− result = iconUri;
90− }
91−
92− g_object_unref(icon);
93−
94− return result;
95−}
96−
97−QString uriToThumbnailerProviderString(QString const &uri, QString const &mimetype, QVariantHash const &metadata)
98−{
99− if (uri.startsWith(QLatin1String("file:///"))) {
100− bool isAudio = mimetype.startsWith(QLatin1String("audio/"));
101− QString thumbnailerUri;
102− if (isAudio) {
103− thumbnailerUri = BASE_ALBUMART_URI;
104− if (metadata.contains("content")) {
105− QVariantHash contentHash = metadata["content"].toHash();
106− if (contentHash.contains("content")) { // nested content in Home?
107− contentHash = contentHash["content"].toHash();
108− }
109− if (contentHash.contains("album") && contentHash.contains("artist")) {
110− QUrlQuery query;
111− query.addQueryItem(QStringLiteral("artist"), contentHash["artist"].toString());
112− query.addQueryItem(QStringLiteral("album"), contentHash["album"].toString());
113− thumbnailerUri.append(query.toString());
114− }
115− }
116− } else {
117− thumbnailerUri = BASE_THUMBNAILER_URI;
118− thumbnailerUri.append(uri.midRef(7));
119− }
120− return thumbnailerUri;
121− }
122−
123− return QString::null;
124−}
tests/mocks/Unity/iconutils.hdeleted−29
@@ -1,29 +0,0 @@
1−/*
2− * Copyright (C) 2013 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− * Authors:
17− * Michal Hruby <michal.hruby@canonical.com>
18− */
19−
20−#ifndef ICONUTILS_H
21−#define ICONUTILS_H
22−
23−#include <QString>
24−#include <QVariant>
25−
26−QString gIconToDeclarativeImageProviderString(QString const &giconString);
27−QString uriToThumbnailerProviderString(QString const &uri, QString const &mimetype, QVariantHash const &metadata);
28−
29−#endif
tests/plugins/Dash/cardcreator/1.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
33 property var template;
44 property var components;
55 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
88 property int headerAlignment: Text.AlignLeft;
99 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
1212 property bool asynchronous: true;
1313 property bool showHeader: true;
1414 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1516readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1617Item {
1718 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
3031 radius: "medium";
3132 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
3233 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
3435 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
3536 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
3737 function updateWidthHeightBindings() {
3838 if (aspectSmallerThanImageAspect) {
3939 width = Qt.binding(function() { return !visible ? 0 : image.width });
tests/plugins/Dash/cardcreator/2.res+1−1
@@ -3,7 +3,7 @@ AbstractButton {
33 property var template;
44 property var components;
55 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
88 property int headerAlignment: Text.AlignLeft;
99 property int fixedHeaderHeight: -1;
tests/plugins/Dash/cardcreator/3.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
33 property var template;
44 property var components;
55 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
88 property int headerAlignment: Text.AlignLeft;
99 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
1212 property bool asynchronous: true;
1313 property bool showHeader: true;
1414 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1516readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1617Item {
1718 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
3031 radius: "medium";
3132 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
3233 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
3435 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
3536 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
3737 function updateWidthHeightBindings() {
3838 if (aspectSmallerThanImageAspect) {
3939 width = Qt.binding(function() { return !visible ? 0 : image.width });
tests/plugins/Dash/cardcreator/4.res+1−1
@@ -3,7 +3,7 @@ AbstractButton {
33 property var template;
44 property var components;
55 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
88 property int headerAlignment: Text.AlignLeft;
99 property int fixedHeaderHeight: -1;
tests/plugins/Dash/cardcreator/5.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
33 property var template;
44 property var components;
55 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
77 property real fontScale: 1.0;
88 property int headerAlignment: Text.AlignLeft;
99 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
1212 property bool asynchronous: true;
1313 property bool showHeader: true;
1414 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1516readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1617Item {
1718 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
3031 radius: "medium";
3132 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
3233 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
3435 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
3536 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
3737 function updateWidthHeightBindings() {
3838 if (aspectSmallerThanImageAspect) {
3939 width = Qt.binding(function() { return !visible ? 0 : image.width });
tests/plugins/Dash/organicgridtest.cpp+5
@@ -514,6 +514,11 @@ private Q_SLOTS:
514514
515515 model->setCount(21);
516516
517+ QTRY_COMPARE(grid->m_visibleItems.count(), 0);
518+
519+ grid->setDisplayMarginBeginning(0);
520+ grid->setDisplayMarginEnd(0);
521+
517522 // This is exactly the same block as the first again
518523 checkInitialPositions();
519524 }
tests/qmltests/CMakeLists.txt−1
@@ -37,7 +37,6 @@ add_qml_test(Dash Dash)
3737add_qml_test(Dash DashContent)
3838add_qml_test(Dash Card)
3939add_qml_benchmark(Dash CardBenchmark 1000)
40−add_qml_test(Dash CardHeader)
4140add_qml_test(Dash CardTool)
4241add_qml_test(Dash GenericScopeView)
4342add_qml_test(Dash/Apps RunningApplicationsGrid)
tests/qmltests/Components/tst_ZoomableImage.qml+21−19
@@ -98,22 +98,23 @@ Rectangle {
9898 // move mouse to center
9999 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
100100
101+ var oldScale = image.scale;
101102 // Test Zoom-in Zoom-out twice.
102103 for (var c=0; c<2; c++) {
103104 // zoom in
104105 for (var i=0; i<10; i++) {
105106 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, 10);
106− tryCompare(image, "scale", 1.0 + (i + 1) * 0.1);
107− compare(flickable.contentWidth, lazyImage.width * image.scale);
108− compare(flickable.contentHeight, lazyImage.height * image.scale);
107+ tryCompare(image, "scale", oldScale + (i + 1) * 0.1);
108+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
109+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
109110 }
110111
111112 // zoom out
112113 for (var i=0; i<10; i++) {
113114 mouseWheel(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2, 0, -10);
114− tryCompare(image, "scale", 2.0 - (i + 1) * 0.1);
115− compare(flickable.contentWidth, lazyImage.width * image.scale);
116− compare(flickable.contentHeight, lazyImage.height * image.scale);
115+ tryCompare(image, "scale", oldScale + 1.0 - (i + 1) * 0.1);
116+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
117+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
117118 }
118119 }
119120 }
@@ -123,16 +124,12 @@ Rectangle {
123124 zoomable:false,
124125 answer1: true,
125126 answer2: false,
126− answer3: true,
127− answer4: 1.0,
128− answer5: 1.0 },
127+ answer3: true },
129128 { source:widgetData2["source"],
130129 zoomable:true,
131130 answer1: false,
132131 answer2: true,
133− answer3: false,
134− answer4: 1.7740461882048026,
135− answer5: 1.0 }
132+ answer3: false }
136133 ]
137134 }
138135
@@ -163,7 +160,7 @@ Rectangle {
163160 var y2End = zoomableImage.height * 5 / 6;
164161
165162 var oldScale = image.scale;
166−
163+ var newScale = -1;
167164 // move mouse to center
168165 mouseMove(zoomableImage, zoomableImage.width / 2, zoomableImage.height / 2);
169166
@@ -172,20 +169,25 @@ Rectangle {
172169 wait(3000); // have to delay between two consequent pinch event.
173170 // pinch zoom-in
174171 touchPinch(zoomableImage, x1Start, y1Start, x1End, y1End, x2Start, y2Start, x2End, y2End);
172+ waitForRendering(image);
175173
176− tryCompare(image, "scale", data.answer4);
177− var newScale = image.scale;
174+ if (newScale == -1) {
175+ newScale = image.scale;
176+ }
177+ tryCompare(image, "scale", newScale);
178178 compare(newScale == oldScale, data.answer1, "scale factor not equal: "+ oldScale + "=?" + newScale);
179179 compare(newScale > oldScale, data.answer2, "scale factor didn't changed");
180180 compare(signalSpy.count == 0, data.answer3, "scale signal count error");
181− compare(newScale, data.answer4, "scale factor error");
182− compare(flickable.contentWidth, lazyImage.width * image.scale);
183− compare(flickable.contentHeight, lazyImage.height * image.scale);
181+ compare(image.scale, newScale, "scale factor error");
182+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
183+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
184184
185185 wait(3000); // have to delay between two consequent pinch event.
186186 // pinch zoom-out
187187 touchPinch(zoomableImage, x1End, y1End, x1Start, y1Start, x2End, y2End, x2Start, y2Start);
188− tryCompare(image, "scale", data.answer5);
188+ tryCompare(image, "scale", oldScale);
189+ compare(flickable.contentWidth, Math.max(lazyImage.width * image.scale, flickable.width));
190+ compare(flickable.contentHeight, Math.max(lazyImage.height * image.scale, flickable.height));
189191 }
190192 }
191193 }
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+12−7
@@ -53,12 +53,12 @@ Rectangle {
5353 name: "PreviewHeaderTest"
5454 when: windowShown
5555
56− property Item mascot: findChild(previewHeader, "mascotShape")
56+ property Item mascotShapeLoader: findChild(previewHeader, "mascotShapeLoader")
5757 property Item outerRow: findChild(previewHeader, "outerRow")
5858 property Item column: findChild(previewHeader, "column")
5959
6060 function initTestCase() {
61− verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");
61+ verify(typeof testCase.mascotShapeLoader === "object", "Couldn't find mascot loader object.");
6262 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");
6363 verify(typeof testCase.column === "object", "Couldn't find column object.");
6464
@@ -70,9 +70,9 @@ Rectangle {
7070
7171 function test_mascot_data() {
7272 return [
73− { tag: "Empty", source: "", visible: false },
74− { tag: "Invalid", source: "bad_path", visible: false },
75− { tag: "Valid", source: "../graphics/play_button.png", visible: true },
73+ { tag: "Empty", source: "", loaderVisible: false, visible: false },
74+ { tag: "Invalid", source: "bad_path", loaderVisible: true, visible: false },
75+ { tag: "Valid", source: "../graphics/play_button.png", loaderVisible: true, visible: true },
7676 ]
7777 }
7878
@@ -80,12 +80,17 @@ Rectangle {
8080 headerjson.mascot = data.source;
8181 previewHeader.widgetData = headerjson;
8282
83− tryCompare(testCase.mascot, "visible", data.visible);
83+ tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);
84+ if (data.loaderVisible) {
85+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
86+ var mascot = findChild(previewHeader, "mascotShape")
87+ tryCompare(mascot, "visible", data.visible);
88+ }
8489 }
8590
8691 function test_dimensions_data() {
8792 return [
88− { tag: "Column width with mascot", object: column, width: previewHeader.width - mascot.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
93+ { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
8994 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
9095 ]
9196 }
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+7−5
@@ -26,12 +26,12 @@ Rectangle {
2626 color: "lightgrey"
2727
2828 property var widgetData0: {
29− "source": ""
29+ "source": Qt.resolvedUrl("../artwork/checkers.png"),
30+ "zoomable": false
3031 }
3132
3233 property var widgetData1: {
33− "source": Qt.resolvedUrl("../artwork/checkers.png"),
34− "zoomable": false
34+ "source": ""
3535 }
3636
3737 PreviewZoomableImage {
@@ -49,11 +49,13 @@ Rectangle {
4949
5050 zoomableImage.widgetData = widgetData0;
5151 waitForRendering(zoomableImage);
52− tryCompare(image, "imageState", "default");
52+ waitForRendering(image);
53+ tryCompare(image, "imageState", "ready");
5354
5455 zoomableImage.widgetData = widgetData1;
5556 waitForRendering(zoomableImage);
56− tryCompare(image, "imageState", "ready");
57+ waitForRendering(image);
58+ tryCompare(image, "imageState", "default");
5759 }
5860 }
5961}
tests/qmltests/Dash/tst_DashContent.qml+29−14
@@ -67,13 +67,17 @@ Item {
6767 name: "DashContent"
6868 when: scopesModel.loaded && windowShown
6969
70− function init() {
71− scopesModel.clear();
70+ function loadScopes() {
7271 scopeLoadedSpy.clear();
7372 scopesModel.load();
7473 tryCompare(scopeLoadedSpy, "count", 4);
7574 }
7675
76+ function init() {
77+ scopesModel.clear();
78+ loadScopes();
79+ }
80+
7781 function cleanup() {
7882 movementStartedSpy.clear();
7983 dashContent.visible = true;
@@ -93,9 +97,7 @@ Item {
9397 compare(dashContentList.count, 0, "DashContent should have 0 items when it starts");
9498 tryCompare(dashContentList, "currentIndex", -1);
9599
96− scopeLoadedSpy.clear();
97− scopesModel.load();
98− tryCompare(scopeLoadedSpy, "count", 4);
100+ loadScopes();
99101
100102 verify(dashContentList.currentIndex >= 0);
101103 }
@@ -109,9 +111,7 @@ Item {
109111 // pretend we're running after a model reset
110112 dashContentList.currentIndex = 27;
111113
112− scopeLoadedSpy.clear();
113− scopesModel.load();
114− tryCompare(scopeLoadedSpy, "count", 4);
114+ loadScopes();
115115
116116 verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
117117 }
@@ -326,8 +326,6 @@ Item {
326326 }
327327
328328 function test_previewOpenClose() {
329− tryCompare(scopeLoadedSpy, "count", 4);
330−
331329 var previewListView = findChild(dashContent, "dashContentPreviewList");
332330 tryCompare(previewListView, "open", false);
333331
@@ -352,8 +350,6 @@ Item {
352350 },
353351 true);
354352
355− tryCompare(scopeLoadedSpy, "count", 4);
356−
357353 var previewListView = findChild(dashContent, "dashContentPreviewList");
358354 tryCompare(previewListView, "open", false);
359355
@@ -368,8 +364,6 @@ Item {
368364 }
369365
370366 function test_previewCycle() {
371− tryCompare(scopeLoadedSpy, "count", 4);
372−
373367 var categoryListView = findChild(dashContent, "categoryListView");
374368 categoryListView.positionAtBeginning();
375369
@@ -392,5 +386,26 @@ Item {
392386 }
393387 closePreview();
394388 }
389+
390+ function test_carouselAspectRatio() {
391+ tryCompareFunction(function() {
392+ var scope = findChild(dashContent, "MockScope1 loader");
393+ if (scope != null) {
394+ var dashCategory1 = findChild(scope, "dashCategory1");
395+ if (dashCategory1 != null) {
396+ var tile = findChild(dashCategory1, "carouselDelegate1");
397+ return tile != null;
398+ }
399+ }
400+ return false;
401+ },
402+ true);
403+
404+ var scope = findChild(dashContent, "MockScope1 loader");
405+ var dashCategory1 = findChild(scope, "dashCategory1");
406+ var cardTool = findChild(dashCategory1, "cardTool");
407+ var carouselLV = findChild(dashCategory1, "listView");
408+ verify(carouselLV.tileWidth / carouselLV.tileHeight == cardTool.components["art"]["aspect-ratio"]);
409+ }
395410 }
396411}
tests/qmltests/Dash/tst_GenericScopeView.qml+1
@@ -126,6 +126,7 @@ Item {
126126
127127 function test_filter_expand_collapse() {
128128 // wait for the item to be there
129+ waitForRendering(genericScopeView);
129130 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
130131
131132 var header = findChild(genericScopeView, "dashSectionHeader0")
tests/qmltests/Greeter/tst_Lockscreen.qml+207−30
@@ -23,25 +23,33 @@ import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
2424
2525Rectangle {
26− width: units.gu(60)
26+ id: root
27+ width: units.gu(80)
2728 height: units.gu(80)
2829 color: "orange"
2930
3031 Lockscreen {
3132 id: lockscreen
3233 anchors.fill: parent
33− anchors.rightMargin: units.gu(18)
34+ anchors.rightMargin: units.gu(30)
3435 placeholderText: "Please enter your PIN"
36+ wrongPlaceholderText: "Incorrect PIN"
37+ retryText: retryCountTextField.text
3538 alphaNumeric: pinPadCheckBox.checked
36− pinLength: pinLengthTextField.text
39+ minPinLength: minPinLengthTextField.text
40+ maxPinLength: maxPinLengthTextField.text
3741 username: "Lola"
42+ infoText: infoTextTextField.text
3843 }
3944
4045 Connections {
4146 target: lockscreen
4247
4348 onEmergencyCall: emergencyCheckBox.checked = true
44− onEntered: enteredLabel.text = passphrase
49+ onEntered: {
50+ enteredLabel.text = passphrase
51+ lockscreen.clear(true)
52+ }
4553 }
4654
4755 Connections {
@@ -49,9 +57,9 @@ Rectangle {
4957
5058 onShowPrompt: {
5159 if (text.indexOf("PIN") >= 0) {
52− lockscreen.alphaNumeric = false
60+ pinPadCheckBox.checked = false
5361 } else {
54− lockscreen.alphaNumeric = true
62+ pinPadCheckBox.checked = true
5563 }
5664 lockscreen.placeholderText = text;
5765 }
@@ -65,6 +73,7 @@ Rectangle {
6573 Column {
6674 anchors.fill: parent
6775 anchors.margins: units.gu(1)
76+ spacing: units.gu(1)
6877
6978 Row {
7079 CheckBox {
@@ -86,12 +95,32 @@ Rectangle {
8695 }
8796 Row {
8897 TextField {
89− id: pinLengthTextField
98+ id: minPinLengthTextField
9099 width: units.gu(7)
91100 text: "4"
92101 }
93102 Label {
94− text: "PIN length"
103+ text: "Min PIN length"
104+ }
105+ }
106+ Row {
107+ TextField {
108+ id: maxPinLengthTextField
109+ width: units.gu(7)
110+ text: "4"
111+ }
112+ Label {
113+ text: "Max PIN length"
114+ }
115+ }
116+ Row {
117+ TextField {
118+ id: retryCountTextField
119+ width: units.gu(7)
120+ text: "3 retries left"
121+ }
122+ Label {
123+ text: "Retries left"
95124 }
96125 }
97126 Label {
@@ -108,12 +137,40 @@ Rectangle {
108137 }
109138 Button {
110139 text: "start auth (1234)"
140+ width: parent.width
111141 onClicked: LightDM.Greeter.authenticate("has-pin")
112142 }
113143 Button {
114144 text: "start auth (password)"
145+ width: parent.width
115146 onClicked: LightDM.Greeter.authenticate("has-password")
116147 }
148+
149+ TextField {
150+ id: infoTextTextField
151+ width: parent.width
152+ placeholderText: "Infotext"
153+ text: "+49 179 3253553"
154+ }
155+
156+ TextField {
157+ id: infoPopupTitleTextField
158+ width: parent.width
159+ placeholderText: "Popup title"
160+ text: "This will be the last attempt"
161+ }
162+
163+ TextArea {
164+ id: infoPopupTextArea
165+ width: parent.width
166+ text: "If the SIM PIN is entered incorrectly, your SIM will be blocked and would require the PUK code to unlock."
167+ }
168+
169+ Button {
170+ text: "open info popup"
171+ width: parent.width
172+ onClicked: lockscreen.showInfoPopup(infoPopupTitleTextField.text, infoPopupTextArea.text)
173+ }
117174 }
118175 }
119176
@@ -121,6 +178,16 @@ Rectangle {
121178 name: "Lockscreen"
122179 when: windowShown
123180
181+ function cleanup() {
182+ lockscreen.clear(false);
183+ }
184+
185+ function waitForLockscreenReady() {
186+ var pinPadLoader = findChild(lockscreen, "pinPadLoader");
187+ tryCompare(pinPadLoader, "status", Loader.Ready)
188+ waitForRendering(lockscreen)
189+ }
190+
124191 function test_loading_data() {
125192 return [
126193 {tag: "numeric", alphanumeric: false, pinPadAvailable: true },
@@ -129,8 +196,8 @@ Rectangle {
129196 }
130197
131198 function test_loading(data) {
132− lockscreen.alphaNumeric = data.alphanumeric
133− waitForRendering(lockscreen)
199+ pinPadCheckBox.checked = data.alphanumeric
200+ waitForLockscreenReady();
134201 if (data.pinPadAvailable) {
135202 compare(findChild(lockscreen, "pinPadButton8").text, "8", "Could not find number 8 on PinPad")
136203 } else {
@@ -147,8 +214,8 @@ Rectangle {
147214
148215 function test_emergency_call(data) {
149216 emergencyCheckBox.checked = false
150− lockscreen.alphaNumeric = data.alphanumeric
151− waitForRendering(lockscreen)
217+ pinPadCheckBox.checked = data.alphanumeric
218+ waitForLockscreenReady();
152219 var emergencyButton = findChild(lockscreen, "emergencyCallIcon")
153220 mouseClick(emergencyButton, units.gu(1), units.gu(1))
154221 tryCompare(emergencyCheckBox, "checked", true)
@@ -163,9 +230,9 @@ Rectangle {
163230 }
164231
165232 function test_labels(data) {
166− lockscreen.alphaNumeric = data.alphanumeric
233+ pinPadCheckBox.checked = data.alphanumeric
167234 lockscreen.placeholderText = data.placeholderText
168− waitForRendering(lockscreen)
235+ waitForLockscreenReady();
169236 compare(findChild(lockscreen, "pinentryField").placeholderText, data.placeholderText, "Placeholdertext is not what it should be")
170237 if (data.alphanumeric) {
171238 compare(findChild(lockscreen, "greeterLabel").text, "Hello " + data.username, "Greeter is not set correctly")
@@ -175,23 +242,25 @@ Rectangle {
175242
176243 function test_unlock_data() {
177244 return [
178− {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", pinLength: 4},
179− {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", pinLength: -1},
180− {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", pinLength: 4},
181− {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", pinLength: -1},
182− {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", pinLength: -1},
245+ {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", minPinLength: 4, maxPinLength: 4},
246+ {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", minPinLength: -1, maxPinLength: -1},
247+ {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", minPinLength: 4, maxPinLength: 4},
248+ {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", minPinLength: -1, maxPinLength: -1},
249+ {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", minPinLength: -1, maxPinLength: -1},
183250 ]
184251 }
185252
186253 function test_unlock(data) {
187254 enteredLabel.text = ""
188− pinLengthTextField.text = data.pinLength
255+ minPinLengthTextField.text = data.minPinLength
256+ maxPinLengthTextField.text = data.maxPinLength
189257 LightDM.Greeter.authenticate(data.username)
190− waitForRendering(lockscreen)
258+ waitForLockscreenReady();
191259
192260 var inputField = findChild(lockscreen, "pinentryField")
193261 if (data.alphanumeric) {
194262 mouseClick(inputField, units.gu(1), units.gu(1))
263+ tryCompare(inputField, "focus", true);
195264 typeString(data.password)
196265 keyClick(Qt.Key_Enter)
197266 } else {
@@ -200,7 +269,7 @@ Rectangle {
200269 var button = findChild(lockscreen, "pinPadButton" + character)
201270 mouseClick(button, units.gu(1), units.gu(1))
202271 }
203− if (data.pinLength == -1) {
272+ if (data.minPinLength !== data.maxPinLength || data.minPinLength == -1) {
204273 var pinPadButtonErase = findChild(lockscreen, "pinPadButtonErase");
205274 mouseClick(pinPadButtonErase, units.gu(1), units.gu(1));
206275 }
@@ -219,11 +288,12 @@ Rectangle {
219288
220289 function test_clear(data) {
221290 pinPadCheckBox.checked = data.alphanumeric
222− waitForRendering(lockscreen)
291+ waitForLockscreenReady();
223292
224293 var inputField = findChild(lockscreen, "pinentryField")
225294 if (data.alphanumeric) {
226295 mouseClick(inputField, units.gu(1), units.gu(1))
296+ tryCompare(inputField, "activeFocus", true);
227297 typeString("1")
228298 } else {
229299 var button = findChild(lockscreen, "pinPadButton1")
@@ -239,6 +309,16 @@ Rectangle {
239309
240310 wait(0) // Trigger event loop to make sure the animation would start running
241311 compare(animation.running, data.animation)
312+ if (data.animation) {
313+ if (data.alphanumeric) {
314+ tryCompare(inputField, "placeholderText", lockscreen.wrongPlaceholderText)
315+ tryCompare(inputField, "placeholderText", lockscreen.placeholderText)
316+ } else {
317+ var label = findChild(lockscreen, "pinentryFieldPlaceHolder");
318+ tryCompare(label, "text", lockscreen.wrongPlaceholderText)
319+ tryCompare(label, "text", lockscreen.placeholderText)
320+ }
321+ }
242322
243323 // wait for animation to finish to not disturb other tests
244324 tryCompare(animation, "running", false)
@@ -246,33 +326,130 @@ Rectangle {
246326
247327 function test_backspace_data() {
248328 return [
249− {tag: "fixed length", pinLength: 4},
250− {tag: "variable length", pinLength: -1}
329+ {tag: "fixed length", minPinLength: 4, maxPinLength: 4},
330+ {tag: "variable undefined length", minPinLength: -1, maxPinLength: -1},
331+ {tag: "variable restricted length", minPinLength: 4, maxPinLength: 8}
251332 ];
252333 }
253334
254335 function test_backspace(data) {
255336 pinPadCheckBox.checked = false
256− pinLengthTextField.text = data.pinLength
257− waitForRendering(lockscreen);
337+ minPinLengthTextField.text = data.minPinLength
338+ maxPinLengthTextField.text = data.maxPinLength
339+ waitForLockscreenReady();
258340
259341 var pinPadButtonErase = findChild(lockscreen, "pinPadButtonErase");
260342 var backspaceIcon = findChild(lockscreen, "backspaceIcon");
261343 var pinEntryField = findChild(lockscreen, "pinentryField");
262344
263− compare(pinPadButtonErase.iconName, data.pinLength == -1 ? "" : "erase");
264− compare(backspaceIcon.visible, data.pinLength == -1);
345+ var autoConfirmEnabled = data.minPinLength === data.maxPinLength && data.minPinLength !== -1;
346+ compare(pinPadButtonErase.iconName, autoConfirmEnabled ? "erase" : "");
347+ compare(backspaceIcon.visible, !autoConfirmEnabled);
265348
266349 var pinPadButton5 = findChild(lockscreen, "pinPadButton5");
267350 mouseClick(pinPadButton5, units.gu(1), units.gu(1));
268351 compare(pinEntryField.text, "5");
269352
270− if (data.pinLength == -1) {
353+ if (data.minPinLength !== data.maxPinLength) {
271354 mouseClick(backspaceIcon, units.gu(1), units.gu(1));
272355 } else {
273356 mouseClick(pinPadButtonErase, units.gu(1), units.gu(1));
274357 }
275358 compare(pinEntryField.text, "");
276359 }
360+
361+ function test_minMaxLength_data() {
362+ return [
363+ {tag: "undefined", minPinLength: -1, maxPinLength: -1},
364+ {tag: "fixed", minPinLength: 4, maxPinLength: 4},
365+ {tag: "variable, limited", minPinLength: 4, maxPinLength: 8},
366+ ];
367+ }
368+
369+ function test_minMaxLength(data) {
370+ pinPadCheckBox.checked = false
371+ minPinLengthTextField.text = data.minPinLength
372+ maxPinLengthTextField.text = data.maxPinLength
373+ waitForLockscreenReady();
374+
375+ var pinPadButton5 = findChild(lockscreen, "pinPadButton5");
376+ var pinPadButtonErase = findChild(lockscreen, "pinPadButtonErase");
377+ var inputField = findChild(lockscreen, "pinentryField")
378+
379+ for (var i = 0; i < 10; i++) {
380+ mouseClick(pinPadButton5, units.gu(1), units.gu(1));
381+
382+ if (data.minPinLength == data.maxPinLength && data.minPinLength != -1) {
383+ // auto confirm mode...
384+ compare(inputField.text.length, (i+1) % data.minPinLength);
385+ } else {
386+ // manual confirm mode
387+ tryCompare(pinPadButtonErase, "enabled", (i+1) >= data.minPinLength)
388+ if (data.maxPinLength == -1) {
389+ compare(inputField.text.length, i+1);
390+ } else {
391+ compare(inputField.text.length, Math.min(data.maxPinLength, i+1));
392+ }
393+
394+ }
395+ }
396+ }
397+
398+ function test_retryDisplay_data() {
399+ return [
400+ {tag: "empty", retryText: "", shown: false},
401+ {tag: "3 retries left", retryText: "3 retries left", shown: true},
402+ ]
403+ }
404+
405+ function test_retryDisplay(data) {
406+ pinPadCheckBox.checked = false
407+ waitForLockscreenReady();
408+
409+ retryCountTextField.text = data.retryText;
410+ var label = findChild(lockscreen, "retryCountLabel")
411+ compare(label.visible, data.shown);
412+ }
413+
414+ function test_infoPopup() {
415+ verify(findChild(root, "infoPopup") === null);
416+ lockscreen.showInfoPopup("foo", "bar");
417+ tryCompareFunction(function() { return findChild(root, "infoPopup") !== null}, true);
418+
419+ var infoPopup = findChild(root, "infoPopup");
420+ compare(infoPopup.title, "foo");
421+ compare(infoPopup.text, "bar");
422+
423+ signalSpy.signalName = "infoPopupConfirmed"
424+ signalSpy.clear();
425+
426+ var okButton = findChild(root, "infoPopupOkButton");
427+ mouseClick(okButton, okButton.width / 2, okButton.height / 2);
428+
429+ tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);
430+
431+ tryCompare(signalSpy, "count", 1);
432+ }
433+
434+ function test_infoTextDisplay_data() {
435+ return [
436+ {tag: "empty string", text: "", shown: false},
437+ {tag: "hello world", text: "hello world", shown: true},
438+ ]
439+ }
440+
441+ function test_infoTextDisplay(data) {
442+ pinPadCheckBox.checked = false
443+ waitForLockscreenReady();
444+
445+ infoTextTextField.text = data.text;
446+ var label = findChild(lockscreen, "infoTextLabel")
447+ compare(label.visible, data.shown);
448+ }
449+ }
450+
451+ SignalSpy {
452+ id: signalSpy
453+ target: lockscreen
277454 }
278455}
tests/qmltests/tst_Shell.qml−9
@@ -451,15 +451,6 @@ Item {
451451 } while (!isStill);
452452 }
453453
454− function test_background_data() {
455− return [
456− {tag: "red", url: Qt.resolvedUrl("../data/unity/backgrounds/red.png"), expectedUrl: "tests/data/unity/backgrounds/red.png"},
457− {tag: "blue", url: Qt.resolvedUrl("../data/unity/backgrounds/blue.png"), expectedUrl: "tests/data/unity/backgrounds/blue.png"},
458− {tag: "invalid", url: "invalid", expectedUrl: shell.defaultBackground},
459− {tag: "empty", url: "", expectedUrl: shell.defaultBackground}
460− ]
461− }
462−
463454 function test_DashShown_data() {
464455 return [
465456 {tag: "in focus", app: false, launcher: false, indicators: false, expectedShown: true},