@@ -16,7 +16,6 @@
17import QtQuick 2.3
17import QtQuick 2.3
18import AccountsService 0.1
18import AccountsService 0.1
19−import LightDM 0.1 as LightDM
20import Ubuntu.Components 1.1
19import Ubuntu.Components 1.1
21import Ubuntu.SystemImage 0.1
20import Ubuntu.SystemImage 0.1
22import Unity.Launcher 0.1
21import Unity.Launcher 0.1
@@ -43,7 +42,7 @@ Showable {
43 readonly property bool hasLockedApp: lockedApp !== ""
42 readonly property bool hasLockedApp: lockedApp !== ""
45 property bool forcedUnlock
44 property bool forcedUnlock
46− readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
45+ readonly property bool locked: lightDM.greeter.active && !lightDM.greeter.authenticated && !forcedUnlock
48 property bool tabletMode
47 property bool tabletMode
49 property url viewSource // only used for testing
48 property url viewSource // only used for testing
@@ -106,10 +105,11 @@ Showable {
106 return d.startUnlock(true /* toTheRight */);
105 return d.startUnlock(true /* toTheRight */);
108+ LightDM{id:lightDM} // Provide backend access
109 QtObject {
109 QtObject {
112− readonly property bool multiUser: LightDM.Users.count > 1
112+ readonly property bool multiUser: lightDM.users.count > 1
113 property int currentIndex
113 property int currentIndex
114 property bool waiting
114 property bool waiting
@@ -133,15 +133,15 @@ Showable {
133 loader.item.reset();
133 loader.item.reset();
135 currentIndex = uid;
135 currentIndex = uid;
136− var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
136+ var user = lightDM.users.data(uid, lightDM.userRoles.NameRole);
137 AccountsService.user = user;
137 AccountsService.user = user;
138 LauncherModel.setUser(user);
138 LauncherModel.setUser(user);
139− LightDM.Greeter.authenticate(user); // always resets auth state
139+ lightDM.greeter.authenticate(user); // always resets auth state
142 function login() {
142 function login() {
143 enabled = false;
143 enabled = false;
144− if (LightDM.Greeter.startSessionSync()) {
144+ if (lightDM.greeter.startSessionSync()) {
145 sessionStarted();
145 sessionStarted();
146 if (loader.item) {
146 if (loader.item) {
147 loader.item.notifyAuthenticationSucceeded();
147 loader.item.notifyAuthenticationSucceeded();
@@ -228,7 +228,7 @@ Showable {
228 root.lockedApp = "";
228 root.lockedApp = "";
229 root.forceActiveFocus();
229 root.forceActiveFocus();
230 d.selectUser(d.currentIndex, true);
230 d.selectUser(d.currentIndex, true);
231− LightDM.Infographic.readyForDataChange();
231+ lightDM.infographic.readyForDataChange();
234 Connections {
234 Connections {
@@ -238,9 +238,9 @@ Showable {
239 onResponded: {
239 onResponded: {
240 if (root.locked) {
240 if (root.locked) {
241− LightDM.Greeter.respond(response);
241+ lightDM.greeter.respond(response);
243− if (LightDM.Greeter.active && !LightDM.Greeter.authenticated) { // could happen if forcedUnlock
243+ if (lightDM.greeter.active && !lightDM.greeter.authenticated) { // could happen if forcedUnlock
244 d.login();
244 d.login();
246 loader.item.hide();
246 loader.item.hide();
@@ -306,18 +306,18 @@ Showable {
306 Binding {
306 Binding {
307 target: loader.item
307 target: loader.item
308 property: "userModel"
308 property: "userModel"
309− value: LightDM.Users
309+ value: lightDM.users
312 Binding {
312 Binding {
313 target: loader.item
313 target: loader.item
314 property: "infographicModel"
314 property: "infographicModel"
315− value: LightDM.Infographic
315+ value: lightDM.infographic
319 Connections {
319 Connections {
320− target: LightDM.Greeter
320+ target: lightDM.greeter
322 onShowGreeter: root.forceShow()
322 onShowGreeter: root.forceShow()
@@ -327,7 +327,7 @@ Showable {
329 onShowMessage: {
329 onShowMessage: {
330− if (!LightDM.Greeter.active) {
330+ if (!lightDM.greeter.active) {
331 return; // could happen if hideGreeter() comes in before we prompt
331 return; // could happen if hideGreeter() comes in before we prompt
@@ -346,7 +346,7 @@ Showable {
346 onShowPrompt: {
346 onShowPrompt: {
347 d.waiting = false;
347 d.waiting = false;
349− if (!LightDM.Greeter.active) {
349+ if (!lightDM.greeter.active) {
350 return; // could happen if hideGreeter() comes in before we prompt
350 return; // could happen if hideGreeter() comes in before we prompt
@@ -356,14 +356,14 @@ Showable {
356 onAuthenticationComplete: {
356 onAuthenticationComplete: {
357 d.waiting = false;
357 d.waiting = false;
359− if (LightDM.Greeter.authenticated) {
359+ if (lightDM.greeter.authenticated) {
360 AccountsService.failedLogins = 0;
360 AccountsService.failedLogins = 0;
361 d.login();
361 d.login();
362− if (!LightDM.Greeter.promptless) {
362+ if (!lightDM.greeter.promptless) {
363 loader.item.hide();
363 loader.item.hide();
366− if (!LightDM.Greeter.promptless) {
366+ if (!lightDM.greeter.promptless) {
367 AccountsService.failedLogins++;
367 AccountsService.failedLogins++;
@@ -384,7 +384,7 @@ Showable {
386 loader.item.notifyAuthenticationFailed();
386 loader.item.notifyAuthenticationFailed();
387− if (!LightDM.Greeter.promptless) {
387+ if (!lightDM.greeter.promptless) {
388 d.selectUser(d.currentIndex, false);
388 d.selectUser(d.currentIndex, false);
@@ -392,8 +392,8 @@ Showable {
393 onRequestAuthenticationUser: {
393 onRequestAuthenticationUser: {
394 // Find index for requested user, if it exists
394 // Find index for requested user, if it exists
395− for (var i = 0; i < LightDM.Users.count; i++) {
395+ for (var i = 0; i < lightDM.users.count; i++) {
396− if (user === LightDM.Users.data(i, LightDM.UserRoles.NameRole)) {
396+ if (user === lightDM.users.data(i, lightDM.userRoles.NameRole)) {
397 d.selectUser(i, true);
397 d.selectUser(i, true);
@@ -402,19 +402,19 @@ Showable {
404 Binding {
404 Binding {
405− target: LightDM.Greeter
405+ target: lightDM.greeter
406 property: "active"
406 property: "active"
407 value: root.active
407 value: root.active
410 Binding {
410 Binding {
411− target: LightDM.Infographic
411+ target: lightDM.infographic
412 property: "username"
412 property: "username"
413− value: AccountsService.statsWelcomeScreen ? LightDM.Users.data(d.currentIndex, LightDM.UserRoles.NameRole) : ""
413+ value: AccountsService.statsWelcomeScreen ? lightDM.users.data(d.currentIndex, lightDM.userRoles.NameRole) : ""
416 Connections {
416 Connections {
417 target: i18n
417 target: i18n
418− onLanguageChanged: LightDM.Infographic.readyForDataChange()
418+ onLanguageChanged: lightDM.infographic.readyForDataChange()