on xenial help sign in
more test fixes
commite372307e9a70e60e8d6aeb55d754708c1bb90180 authorMichael Terry <michael.terry@canonical.com> dateFri 30 Jan 2015, 11:46 (12 years ago) parentf8c442f
3 files changed+20−10
qml/Greeter/Greeter.qml+6−3 qml/Greeter/LoginList.qml+13−5 tests/qmltests/tst_TabletShell.qml+1−2
qml/Greeter/Greeter.qml+6−3
@@ -122,6 +122,7 @@ Showable {
122122
123123 function selectUser(uid) {
124124 d.waiting = true;
125+ loader.item.reset();
125126 currentIndex = uid;
126127 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
127128 AccountsService.user = user;
@@ -189,7 +190,6 @@ Showable {
189190 (d.multiUser || root.tabletMode) ? "WideView.qml" : "NarrowView.qml"
190191
191192 onLoaded: {
192− loader.item.reset();
193193 root.lockedApp = "";
194194 root.forceActiveFocus();
195195 d.selectUser(d.currentIndex);
@@ -204,8 +204,11 @@ Showable {
204204 onResponded: {
205205 if (root.locked) {
206206 LightDM.Greeter.respond(response);
207− } else if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
208− d.login();
207+ } else {
208+ if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
209+ d.login();
210+ }
211+ loader.item.hide();
209212 }
210213 }
211214 onTease: root.tease()
qml/Greeter/LoginList.qml+13−5
@@ -40,7 +40,6 @@ Item {
4040 passwordInput.forceActiveFocus();
4141 } else {
4242 if (root.locked) {
43− root.resetAuthentication();
4443 root.selected(currentIndex);
4544 } else {
4645 root.responded("");
@@ -69,7 +68,9 @@ Item {
6968 function showError() {
7069 wrongPasswordAnimation.start();
7170 root.resetAuthentication();
72− passwordInput.focus = true;
71+ if (wasPrompted) {
72+ passwordInput.focus = true;
73+ }
7374 }
7475
7576 function reset() {
@@ -77,10 +78,13 @@ Item {
7778 }
7879
7980 Keys.onEscapePressed: {
80− root.resetAuthentication();
8181 selected(currentIndex);
8282 }
8383
84+ onCurrentIndexChanged: {
85+ userList.currentIndex = currentIndex;
86+ }
87+
8488 Rectangle {
8589 id: highlightItem
8690 anchors {
@@ -109,8 +113,12 @@ Item {
109113 flickDeceleration: 10000
110114
111115 readonly property bool movingInternally: moveTimer.running || userList.moving
116+ onMovingInternallyChanged: {
117+ if (!movingInternally) {
118+ root.selected(currentIndex);
119+ }
120+ }
112121
113− currentIndex: root.currentIndex
114122 onCurrentIndexChanged: {
115123 root.resetAuthentication();
116124 moveTimer.start();
@@ -222,6 +230,7 @@ Item {
222230 height: units.gu(4.5)
223231 width: parent.width - anchors.margins * 2
224232 opacity: userList.movingInternally ? 0 : 1
233+ enabled: root.wasPrompted
225234
226235 property string promptText
227236 placeholderText: root.wasPrompted ? promptText
@@ -240,7 +249,6 @@ Item {
240249 root.responded(text);
241250 }
242251 Keys.onEscapePressed: {
243− root.resetAuthentication();
244252 root.selected(currentIndex);
245253 }
246254
tests/qmltests/tst_TabletShell.qml+1−2
@@ -183,8 +183,7 @@ Item {
183183 if (userlist.currentIndex > i) {
184184 next = userlist.currentIndex - 1
185185 }
186− var account = findChild(greeter, "username"+next)
187− mouseClick(account, 1, 1)
186+ tap(findChild(greeter, "username"+next));
188187 tryCompare(userlist, "currentIndex", next)
189188 tryCompare(userlist, "movingInternally", false)
190189 }