on xenial help sign in
more test fixes
e372307Michael Terry
qml/Greeter/Greeter.qml+6−3
@@ -122,6 +122,7 @@ Showable {
122
122
123 function selectUser(uid) {
123 function selectUser(uid) {
124 d.waiting = true;
124 d.waiting = true;
125+ loader.item.reset();
125 currentIndex = uid;
126 currentIndex = uid;
126 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
127 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
127 AccountsService.user = user;
128 AccountsService.user = user;
@@ -189,7 +190,6 @@ Showable {
189 (d.multiUser || root.tabletMode) ? "WideView.qml" : "NarrowView.qml"
190 (d.multiUser || root.tabletMode) ? "WideView.qml" : "NarrowView.qml"
190
191
191 onLoaded: {
192 onLoaded: {
192− loader.item.reset();
193 root.lockedApp = "";
193 root.lockedApp = "";
194 root.forceActiveFocus();
194 root.forceActiveFocus();
195 d.selectUser(d.currentIndex);
195 d.selectUser(d.currentIndex);
@@ -204,8 +204,11 @@ Showable {
204 onResponded: {
204 onResponded: {
205 if (root.locked) {
205 if (root.locked) {
206 LightDM.Greeter.respond(response);
206 LightDM.Greeter.respond(response);
207+ } else {
207− } else if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
208+ if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
208− d.login();
209+ d.login();
210+ }
211+ loader.item.hide();
209 }
212 }
210 }
213 }
211 onTease: root.tease()
214 onTease: root.tease()
qml/Greeter/LoginList.qml+13−5
@@ -40,7 +40,6 @@ Item {
40 passwordInput.forceActiveFocus();
40 passwordInput.forceActiveFocus();
41 } else {
41 } else {
42 if (root.locked) {
42 if (root.locked) {
43− root.resetAuthentication();
44 root.selected(currentIndex);
43 root.selected(currentIndex);
45 } else {
44 } else {
46 root.responded("");
45 root.responded("");
@@ -69,7 +68,9 @@ Item {
69 function showError() {
68 function showError() {
70 wrongPasswordAnimation.start();
69 wrongPasswordAnimation.start();
71 root.resetAuthentication();
70 root.resetAuthentication();
71+ if (wasPrompted) {
72− passwordInput.focus = true;
72+ passwordInput.focus = true;
73+ }
73 }
74 }
74
75
75 function reset() {
76 function reset() {
@@ -77,10 +78,13 @@ Item {
77 }
78 }
78
79
79 Keys.onEscapePressed: {
80 Keys.onEscapePressed: {
80− root.resetAuthentication();
81 selected(currentIndex);
81 selected(currentIndex);
82 }
82 }
83
83
84+ onCurrentIndexChanged: {
85+ userList.currentIndex = currentIndex;
86+ }
87+
84 Rectangle {
88 Rectangle {
85 id: highlightItem
89 id: highlightItem
86 anchors {
90 anchors {
@@ -109,8 +113,12 @@ Item {
109 flickDeceleration: 10000
113 flickDeceleration: 10000
110
114
111 readonly property bool movingInternally: moveTimer.running || userList.moving
115 readonly property bool movingInternally: moveTimer.running || userList.moving
116+ onMovingInternallyChanged: {
117+ if (!movingInternally) {
118+ root.selected(currentIndex);
119+ }
120+ }
112
121
113− currentIndex: root.currentIndex
114 onCurrentIndexChanged: {
122 onCurrentIndexChanged: {
115 root.resetAuthentication();
123 root.resetAuthentication();
116 moveTimer.start();
124 moveTimer.start();
@@ -222,6 +230,7 @@ Item {
222 height: units.gu(4.5)
230 height: units.gu(4.5)
223 width: parent.width - anchors.margins * 2
231 width: parent.width - anchors.margins * 2
224 opacity: userList.movingInternally ? 0 : 1
232 opacity: userList.movingInternally ? 0 : 1
233+ enabled: root.wasPrompted
225
234
226 property string promptText
235 property string promptText
227 placeholderText: root.wasPrompted ? promptText
236 placeholderText: root.wasPrompted ? promptText
@@ -240,7 +249,6 @@ Item {
240 root.responded(text);
249 root.responded(text);
241 }
250 }
242 Keys.onEscapePressed: {
251 Keys.onEscapePressed: {
243− root.resetAuthentication();
244 root.selected(currentIndex);
252 root.selected(currentIndex);
245 }
253 }
246
254
tests/qmltests/tst_TabletShell.qml+1−2
@@ -183,8 +183,7 @@ Item {
183 if (userlist.currentIndex > i) {
183 if (userlist.currentIndex > i) {
184 next = userlist.currentIndex - 1
184 next = userlist.currentIndex - 1
185 }
185 }
186− var account = findChild(greeter, "username"+next)
186+ tap(findChild(greeter, "username"+next));
187− mouseClick(account, 1, 1)
188 tryCompare(userlist, "currentIndex", next)
187 tryCompare(userlist, "currentIndex", next)
189 tryCompare(userlist, "movingInternally", false)
188 tryCompare(userlist, "movingInternally", false)
190 }
189 }