@@ -19,7 +19,6 @@ 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 Ubuntu.Telephony 0.1 as Telephony
23import Unity.Launcher 0.1
22import Unity.Launcher 0.1
24import "../Components"
23import "../Components"
@@ -42,10 +41,8 @@ Showable {
42 property string lockedApp: ""
41 property string lockedApp: ""
43 property bool hasLockedApp: lockedApp !== ""
42 property bool hasLockedApp: lockedApp !== ""
45− showAnimation: StandardAnimation { property: "dragOffset"; to: 0; duration: UbuntuAnimation.FastDuration }
44+ showAnimation: d.showAnimation
46− hideAnimation: __leftHideAnimation
45+ hideAnimation: d.leftHideAnimation
48− property alias lockscreen: lockscreen
50 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
47 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
51 property bool forcedUnlock
48 property bool forcedUnlock
@@ -57,9 +54,6 @@ Showable {
58 readonly property int currentIndex: greeterContentLoader.currentIndex
55 readonly property int currentIndex: greeterContentLoader.currentIndex
60− property var __leftHideAnimation: StandardAnimation { property: "dragOffset"; to: -width }
61− property var __rightHideAnimation: StandardAnimation { property: "dragOffset"; to: width }
63 property real dragOffset
57 property real dragOffset
65 // We define a proxy and "is valid" property for launcherOffset because of
59 // We define a proxy and "is valid" property for launcherOffset because of
@@ -84,35 +78,13 @@ Showable {
85 function hideRight() {
79 function hideRight() {
86 if (shown) {
80 if (shown) {
87− hideAnimation = __rightHideAnimation
81+ hideAnimation = d.rightHideAnimation;
93− if (greeterContentLoader.item) {
94− greeterContentLoader.item.reset()
100− if (LightDM.Greeter.startSessionSync()) {
108 function notifyAppFocused(appId) {
86 function notifyAppFocused(appId) {
109 if (narrowMode) {
87 if (narrowMode) {
110− if (appId === "dialer-app" && callManager.hasCalls && locked) {
111− // If we are in the middle of a call, make dialer lockedApp and show it.
112− // This can happen if user backs out of dialer back to greeter, then
113− // launches dialer again.
116 if (hasLockedApp) {
88 if (hasLockedApp) {
117 if (appId === lockedApp) {
89 if (appId === lockedApp) {
118 lockscreen.hide(); // show locked app
90 lockscreen.hide(); // show locked app
@@ -168,7 +140,7 @@ Showable {
168 // Reset hide animation to default once we're finished with it
140 // Reset hide animation to default once we're finished with it
169 if (required) {
141 if (required) {
170 // Reset hide animation so that a hide() call is reliably left
142 // Reset hide animation so that a hide() call is reliably left
171− hideAnimation = __leftHideAnimation
143+ hideAnimation = d.leftHideAnimation;
@@ -179,7 +151,7 @@ Showable {
179 if (narrowMode) {
151 if (narrowMode) {
180 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
152 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
182− reset();
154+ d.reset();
184 lockedApp = "";
156 lockedApp = "";
185 forceActiveFocus();
157 forceActiveFocus();
@@ -197,7 +169,7 @@ Showable {
197 onShowProgressChanged: {
169 onShowProgressChanged: {
198 if (showProgress === 0) {
170 if (showProgress === 0) {
199 if ((LightDM.Greeter.promptless && LightDM.Greeter.authenticated) || forcedUnlock) {
171 if ((LightDM.Greeter.promptless && LightDM.Greeter.authenticated) || forcedUnlock) {
200− greeter.login();
172+ d.login();
201 } else if (narrowMode) {
173 } else if (narrowMode) {
202 lockscreen.clear(false); // to reset focus if necessary
174 lockscreen.clear(false); // to reset focus if necessary
@@ -207,12 +179,32 @@ Showable {
207 QtObject {
179 QtObject {
182+ property var showAnimation: StandardAnimation { property: "dragOffset"; to: 0; duration: UbuntuAnimation.FastDuration }
183+ property var leftHideAnimation: StandardAnimation { property: "dragOffset"; to: -width }
184+ property var rightHideAnimation: StandardAnimation { property: "dragOffset"; to: width }
210 function selectUser(uid) {
186 function selectUser(uid) {
211 // Update launcher items for new user
187 // Update launcher items for new user
212 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
188 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
213 AccountsService.user = user;
189 AccountsService.user = user;
214 LauncherModel.setUser(user);
190 LauncherModel.setUser(user);
194+ if (greeterContentLoader.item) {
195+ greeterContentLoader.item.reset()
201+ if (LightDM.Greeter.startSessionSync()) {
218 Lockscreen {
210 Lockscreen {
@@ -321,7 +313,7 @@ Showable {
321 target: LightDM.Greeter
313 target: LightDM.Greeter
323 onShowGreeter: greeter.show()
315 onShowGreeter: greeter.show()
324− onHideGreeter: greeter.login()
316+ onHideGreeter: d.login()
326 onShowPrompt: {
318 onShowPrompt: {
327 waiting = false;
319 waiting = false;
@@ -364,7 +356,7 @@ Showable {
366 if (LightDM.Greeter.authenticated) {
358 if (LightDM.Greeter.authenticated) {
367− greeter.login();
359+ d.login();
369 AccountsService.failedLogins++
361 AccountsService.failedLogins++
370 if (maxFailedLogins >= 2) { // require at least a warning
362 if (maxFailedLogins >= 2) { // require at least a warning
@@ -397,6 +389,6 @@ Showable {
397 Binding {
389 Binding {
398 target: LightDM.Greeter
390 target: LightDM.Greeter
399 property: "active"
391 property: "active"
400− value: greeter.shown || lockscreen.shown || greeter.hasLockedApp
392+ value: greeter.fullyShown || greeter.hasLockedApp