on xenial help sign in
More fixes/cleanup
8a968c8Michael Terry
qml/Greeter/CoverPage.qml+2
@@ -55,6 +55,8 @@ Showable {
55 // We don't directly bind "x" because that's owned by the DragHandle. So
55 // We don't directly bind "x" because that's owned by the DragHandle. So
56 // instead, we can get a little extra horizontal push by using transforms.
56 // instead, we can get a little extra horizontal push by using transforms.
57 transform: Translate { id: translation; x: root.draggable ? launcherOffset : 0 }
57 transform: Translate { id: translation; x: root.draggable ? launcherOffset : 0 }
58+
59+ MouseArea { anchors.fill: parent; }
58
60
59 Rectangle {
61 Rectangle {
60 // In case background fails to load
62 // In case background fails to load
qml/Greeter/Greeter.qml+19−10
@@ -19,6 +19,7 @@ import AccountsService 0.1
19import LightDM 0.1 as LightDM
19import LightDM 0.1 as LightDM
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Ubuntu.SystemImage 0.1
21import Ubuntu.SystemImage 0.1
22+import Unity.Connectivity 0.1
22import Unity.Launcher 0.1
23import Unity.Launcher 0.1
23import "../Components"
24import "../Components"
24
25
@@ -56,6 +57,11 @@ Showable {
56 signal sessionStarted()
57 signal sessionStarted()
57 signal emergencyCall()
58 signal emergencyCall()
58
59
60+ function forceShow() {
61+ showNow();
62+ loader.item.reset();
63+ }
64+
59 function notifyAppFocused(appId) {
65 function notifyAppFocused(appId) {
60 if (!active) {
66 if (!active) {
61 return;
67 return;
@@ -120,9 +126,11 @@ Showable {
120 StandardAnimation {}
126 StandardAnimation {}
121 }
127 }
122
128
123− function selectUser(uid) {
129+ function selectUser(uid, reset) {
124 d.waiting = true;
130 d.waiting = true;
131+ if (reset) {
125− loader.item.reset();
132+ loader.item.reset();
133+ }
126 currentIndex = uid;
134 currentIndex = uid;
127 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
135 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
128 AccountsService.user = user;
136 AccountsService.user = user;
@@ -162,6 +170,10 @@ Showable {
162 }
170 }
163 }
171 }
164
172
173+ Component.onCompleted: {
174+ Connectivity.unlockAllModems();
175+ }
176+
165 Timer {
177 Timer {
166 id: forcedDelayTimer
178 id: forcedDelayTimer
167 interval: 1000 * 60
179 interval: 1000 * 60
@@ -192,14 +204,14 @@ Showable {
192 onLoaded: {
204 onLoaded: {
193 root.lockedApp = "";
205 root.lockedApp = "";
194 root.forceActiveFocus();
206 root.forceActiveFocus();
195− d.selectUser(d.currentIndex);
207+ d.selectUser(d.currentIndex, true);
196 LightDM.Infographic.readyForDataChange();
208 LightDM.Infographic.readyForDataChange();
197 }
209 }
198
210
199 Connections {
211 Connections {
200 target: loader.item
212 target: loader.item
201 onSelected: {
213 onSelected: {
202− d.selectUser(index);
214+ d.selectUser(index, true);
203 }
215 }
204 onResponded: {
216 onResponded: {
205 if (root.locked) {
217 if (root.locked) {
@@ -284,10 +296,7 @@ Showable {
284 Connections {
296 Connections {
285 target: LightDM.Greeter
297 target: LightDM.Greeter
286
298
287− onShowGreeter: {
299+ onShowGreeter: root.forceShow()
288− root.show();
289− loader.item.reset();
290− }
291
300
292 onHideGreeter: {
301 onHideGreeter: {
293 d.login();
302 d.login();
@@ -352,7 +361,7 @@ Showable {
352
361
353 loader.item.authenticated(false);
362 loader.item.authenticated(false);
354 if (!LightDM.Greeter.promptless) {
363 if (!LightDM.Greeter.promptless) {
355− d.selectUser(d.currentIndex);
364+ d.selectUser(d.currentIndex, false);
356 }
365 }
357 }
366 }
358 }
367 }
@@ -361,7 +370,7 @@ Showable {
361 // Find index for requested user, if it exists
370 // Find index for requested user, if it exists
362 for (var i = 0; i < LightDM.Users.count; i++) {
371 for (var i = 0; i < LightDM.Users.count; i++) {
363 if (user === LightDM.Users.data(i, LightDM.UserRoles.NameRole)) {
372 if (user === LightDM.Users.data(i, LightDM.UserRoles.NameRole)) {
364− d.selectUser(i);
373+ d.selectUser(i, true);
365 return;
374 return;
366 }
375 }
367 }
376 }
qml/Greeter/LoginList.qml−1
@@ -230,7 +230,6 @@ Item {
230 height: units.gu(4.5)
230 height: units.gu(4.5)
231 width: parent.width - anchors.margins * 2
231 width: parent.width - anchors.margins * 2
232 opacity: userList.movingInternally ? 0 : 1
232 opacity: userList.movingInternally ? 0 : 1
233− enabled: root.wasPrompted
234
233
235 property string promptText
234 property string promptText
236 placeholderText: root.wasPrompted ? promptText
235 placeholderText: root.wasPrompted ? promptText
qml/Shell.qml+1−3
@@ -23,7 +23,6 @@ import Ubuntu.Components 0.1
23import Ubuntu.Components.Popups 1.0
23import Ubuntu.Components.Popups 1.0
24import Ubuntu.Gestures 0.1
24import Ubuntu.Gestures 0.1
25import Ubuntu.Telephony 0.1 as Telephony
25import Ubuntu.Telephony 0.1 as Telephony
26−import Unity.Connectivity 0.1
27import Unity.Launcher 0.1
26import Unity.Launcher 0.1
28import Utils 0.1
27import Utils 0.1
29import LightDM 0.1 as LightDM
28import LightDM 0.1 as LightDM
@@ -139,7 +138,6 @@ Item {
139 if (orientationLockEnabled) {
138 if (orientationLockEnabled) {
140 orientation = OrientationLock.savedOrientation;
139 orientation = OrientationLock.savedOrientation;
141 }
140 }
142− Connectivity.unlockAllModems();
143 }
141 }
144
142
145 VolumeControl {
143 VolumeControl {
@@ -373,7 +371,7 @@ Item {
373 id: showGreeterDelayed
371 id: showGreeterDelayed
374 interval: 1
372 interval: 1
375 onTriggered: {
373 onTriggered: {
376− greeter.showNow();
374+ greeter.forceShow();
377 }
375 }
378 }
376 }
379
377
tests/mocks/libusermetrics/UserMetrics.cpp−1
@@ -26,7 +26,6 @@
26
26
27#include <functional>
27#include <functional>
28#include <random>
28#include <random>
29−#include <QDebug>
30
29
31using namespace UserMetricsOutput;
30using namespace UserMetricsOutput;
32
31
tests/qmltests/Dash/tst_DashContent.qml+1−1
@@ -71,7 +71,7 @@ Item {
71 scopeLoadedSpy.clear();
71 scopeLoadedSpy.clear();
72 scopesModel.load();
72 scopesModel.load();
73 tryCompare(scopeLoadedSpy, "count", 6, 15000);
73 tryCompare(scopeLoadedSpy, "count", 6, 15000);
74− tryCompare(scopesModel, "loaded", true, 1000, typeof scopesModel.loaded);
74+ tryCompare(scopesModel, "loaded", true);
75 tryCompareFunction(function() {
75 tryCompareFunction(function() {
76 var mockScope1Loader = findChild(shell, "scopeLoader0");
76 var mockScope1Loader = findChild(shell, "scopeLoader0");
77 return mockScope1Loader && mockScope1Loader.item != null; },
77 return mockScope1Loader && mockScope1Loader.item != null; },
tests/qmltests/Greeter/tst_Greeter.qml+4−1
@@ -430,11 +430,14 @@ Item {
430
430
431 function test_dbusShowGreeterFromShownState() {
431 function test_dbusShowGreeterFromShownState() {
432 selectUser("has-password");
432 selectUser("has-password");
433+ compare(viewResetSpy.count, 1);
433 tryCompare(viewShowPromptSpy, "count", 1);
434 tryCompare(viewShowPromptSpy, "count", 1);
435+
436+ viewResetSpy.clear();
434 viewShowPromptSpy.clear();
437 viewShowPromptSpy.clear();
438+
435 LightDM.Greeter.showGreeter();
439 LightDM.Greeter.showGreeter();
436 compare(viewResetSpy.count, 1);
440 compare(viewResetSpy.count, 1);
437− tryCompare(viewShowPromptSpy, "count", 1);
438 }
441 }
439 }
442 }
440}
443}
tests/qmltests/Greeter/tst_WideView.qml+4−2
@@ -397,10 +397,12 @@ Item {
397
397
398 compare(selectedSpy.count, 0);
398 compare(selectedSpy.count, 0);
399 keyClick(Qt.Key_Escape);
399 keyClick(Qt.Key_Escape);
400− compare(passwordInput.focus, false);
401− compare(passwordInput.enabled, true);
402 compare(selectedSpy.count, 1);
400 compare(selectedSpy.count, 1);
403 compare(selectedSpy.signalArguments[0][0], 1);
401 compare(selectedSpy.signalArguments[0][0], 1);
402+
403+ view.reset();
404+ compare(passwordInput.focus, false);
405+ compare(passwordInput.enabled, true);
404 }
406 }
405
407
406 function test_unicode() {
408 function test_unicode() {
tests/qmltests/tst_ShellWithPin.qml+4−11
@@ -81,15 +81,7 @@ Item {
81 Button {
81 Button {
82 anchors { left: parent.left; right: parent.right }
82 anchors { left: parent.left; right: parent.right }
83 text: "Show Greeter"
83 text: "Show Greeter"
84− onClicked: {
84+ onClicked: LightDM.Greeter.showGreeter()
85− if (shellLoader.status !== Loader.Ready)
86− return
87−
88− var greeter = testCase.findChild(shellLoader.item, "greeter")
89− if (!greeter.shown) {
90− greeter.show()
91− }
92− }
93 }
85 }
94
86
95 Label {
87 Label {
@@ -191,7 +183,8 @@ Item {
191 function swipeAwayGreeter(waitForCoverPage) {
183 function swipeAwayGreeter(waitForCoverPage) {
192 var greeter = findChild(shell, "greeter");
184 var greeter = findChild(shell, "greeter");
193 waitForRendering(greeter)
185 waitForRendering(greeter)
194− tryCompare(greeter, "fullyShown", true);
186+ var coverPage = findChild(shell, "coverPage");
187+ tryCompare(coverPage, "showProgress", 1);
195
188
196 var touchX = shell.width - (shell.edgeSize / 2);
189 var touchX = shell.width - (shell.edgeSize / 2);
197 var touchY = shell.height / 2;
190 var touchY = shell.height / 2;
@@ -212,10 +205,10 @@ Item {
212 }
205 }
213
206
214 function enterPin(pin) {
207 function enterPin(pin) {
215− var inputField = findChild(shell, "pinentryField")
216 for (var i = 0; i < pin.length; ++i) {
208 for (var i = 0; i < pin.length; ++i) {
217 var character = pin.charAt(i)
209 var character = pin.charAt(i)
218 var button = findChild(shell, "pinPadButton" + character)
210 var button = findChild(shell, "pinPadButton" + character)
211+ tryCompare(button, "enabled", true);
219 tap(button)
212 tap(button)
220 }
213 }
221 }
214 }