@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.3
1818import AccountsService 0.1
19−import LightDM 0.1 as LightDM
2019import Ubuntu.Components 1.1
2120import Ubuntu.SystemImage 0.1
2221import Unity.Launcher 0.1
@@ -26,6 +25,7 @@ Showable {
2625 id: root
2726 created: loader.status == Loader.Ready
2827
28+ LightDMGreeterAPI{id:lightDMGreeterAPI}
2929 property real dragHandleLeftMargin: 0
3030
3131 property url background
@@ -43,7 +43,7 @@ Showable {
4343 readonly property bool hasLockedApp: lockedApp !== ""
4444
4545 property bool forcedUnlock
46− readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
46+ readonly property bool locked: lightDMGreeterAPI.active && !lightDMGreeterAPI.authenticated && !forcedUnlock
4747
4848 property bool tabletMode
4949 property url viewSource // only used for testing
@@ -107,7 +107,7 @@ Showable {
107107 QtObject {
108108 id: d
109109
110− readonly property bool multiUser: LightDM.Users.count > 1
110+ readonly property bool multiUser: lightDMGreeterAPI.userCount > 1
111111 property int currentIndex
112112 property bool waiting
113113
@@ -131,15 +131,15 @@ Showable {
131131 loader.item.reset();
132132 }
133133 currentIndex = uid;
134− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
134+ var user = lightDMGreeterAPI.getUser(uid);
135135 AccountsService.user = user;
136136 LauncherModel.setUser(user);
137− LightDM.Greeter.authenticate(user); // always resets auth state
137+ lightDMGreeterAPI.authenticate(user); // always resets auth state
138138 }
139139
140140 function login() {
141141 enabled = false;
142− if (LightDM.Greeter.startSessionSync()) {
142+ if (lightDMGreeterAPI.startSessionSync()) {
143143 sessionStarted();
144144 if (loader.item) {
145145 loader.item.notifyAuthenticationSucceeded();
@@ -226,7 +226,7 @@ Showable {
226226 root.lockedApp = "";
227227 root.forceActiveFocus();
228228 d.selectUser(d.currentIndex, true);
229− LightDM.Infographic.readyForDataChange();
229+ lightDMGreeterAPI.infographicReadyForDataChange();
230230 }
231231
232232 Connections {
@@ -236,9 +236,9 @@ Showable {
236236 }
237237 onResponded: {
238238 if (root.locked) {
239− LightDM.Greeter.respond(response);
239+ lightDMGreeterAPI.respond(response);
240240 } else {
241− if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
241+ if (lightDMGreeterAPI.active && !lightDMGreeterAPI.authenticated) { // could happen if forcedUnlock
242242 d.login();
243243 }
244244 loader.item.hide();
@@ -304,18 +304,18 @@ Showable {
304304 Binding {
305305 target: loader.item
306306 property: "userModel"
307− value: LightDM.Users
307+ value: lightDMGreeterAPI.userModel
308308 }
309309
310310 Binding {
311311 target: loader.item
312312 property: "infographicModel"
313− value: LightDM.Infographic
313+ value: lightDMGreeterAPI.infographicModel
314314 }
315315 }
316316
317317 Connections {
318− target: LightDM.Greeter
318+ target: lightDMGreeterAPI.theGreeter
319319
320320 onShowGreeter: root.forceShow()
321321
@@ -325,7 +325,7 @@ Showable {
325325 }
326326
327327 onShowMessage: {
328− if (!LightDM.Greeter.active) {
328+ if (!lightDMGreeterAPI.active) {
329329 return; // could happen if hideGreeter() comes in before we prompt
330330 }
331331
@@ -344,7 +344,7 @@ Showable {
344344 onShowPrompt: {
345345 d.waiting = false;
346346
347− if (!LightDM.Greeter.active) {
347+ if (!lightDMGreeterAPI.active) {
348348 return; // could happen if hideGreeter() comes in before we prompt
349349 }
350350
@@ -354,14 +354,14 @@ Showable {
354354 onAuthenticationComplete: {
355355 d.waiting = false;
356356
357− if (LightDM.Greeter.authenticated) {
357+ if (lightDMGreeterAPI.authenticated) {
358358 AccountsService.failedLogins = 0;
359359 d.login();
360− if (!LightDM.Greeter.promptless) {
360+ if (!lightDMGreeterAPI.promptless) {
361361 loader.item.hide();
362362 }
363363 } else {
364− if (!LightDM.Greeter.promptless) {
364+ if (!lightDMGreeterAPI.promptless) {
365365 AccountsService.failedLogins++;
366366 }
367367
@@ -382,7 +382,7 @@ Showable {
382382 }
383383
384384 loader.item.notifyAuthenticationFailed();
385− if (!LightDM.Greeter.promptless) {
385+ if (!lightDMGreeterAPI.promptless) {
386386 d.selectUser(d.currentIndex, false);
387387 }
388388 }
@@ -390,8 +390,8 @@ Showable {
390390
391391 onRequestAuthenticationUser: {
392392 // Find index for requested user, if it exists
393− for (var i = 0; i < LightDM.Users.count; i++) {
394− if (user === LightDM.Users.data(i, LightDM.UserRoles.NameRole)) {
393+ for (var i = 0; i < lightDMGreeterAPI.userCount; i++) {
394+ if (user === lightDMGreeterAPI.getUser(i)) {
395395 d.selectUser(i, true);
396396 return;
397397 }
@@ -400,19 +400,19 @@ Showable {
400400 }
401401
402402 Binding {
403− target: LightDM.Greeter
403+ target: lightDMGreeterAPI.theGreeter
404404 property: "active"
405405 value: root.active
406406 }
407407
408408 Binding {
409− target: LightDM.Infographic
409+ target: lightDMGreeterAPI.infographicModel
410410 property: "username"
411− value: AccountsService.statsWelcomeScreen ? LightDM.Users.data(d.currentIndex, LightDM.UserRoles.NameRole) : ""
411+ value: AccountsService.statsWelcomeScreen ? lightDMGreeterAPI.getUser(d.currentIndex) : ""
412412 }
413413
414414 Connections {
415415 target: i18n
416− onLanguageChanged: LightDM.Infographic.readyForDataChange()
416+ onLanguageChanged: lightDMGreeterAPI.infographicReadyForDataChange()
417417 }
418418}