2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17import AccountsService 0.1
19import LightDM 0.1 as LightDM
22import SessionBroadcast 0.1
23import Ubuntu.Components 0.1
24import Unity.Application 0.1
25import Unity.Launcher 0.1
31import Unity.Notifications 1.0 as NotificationBackend
36 function activateApplication(appId) {
37 SessionBroadcast.requestApplicationStart(LightDM.Greeter.authenticationUser, appId)
42 id: backgroundSettings
43 schema.id: "org.gnome.desktop.background"
45 backgroundFallbackSource: backgroundSettings.pictureUri // for ease of customization by system builders
46 backgroundSource: AccountsService.backgroundFile
50 objectName: "lockscreen"
52 hides: [launcher, panel.indicators]
55 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
56 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
58 x: required ? 0 : - width
60 height: parent.height - panel.panelHeight
63 onEntered: LightDM.Greeter.respond(passphrase);
64 onCancel: greeter.show()
66 Component.onCompleted: {
67 if (LightDM.Users.count == 1) {
68 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
75 target: LightDM.Greeter
78 if (LightDM.Users.count == 1) {
79 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
81 lockscreen.alphaNumeric = false
83 lockscreen.alphaNumeric = true
85 lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
90 onAuthenticationComplete: {
91 if (LightDM.Greeter.promptless) {
94 if (LightDM.Greeter.authenticated) {
97 lockscreen.clear(true);
104 objectName: "greeter"
107 hides: [launcher, panel.indicators]
109 background: shell.background
113 height: parent.height - panel.panelHeight
115 dragHandleWidth: shell.edgeSize
119 LightDM.Greeter.startSessionSync();
125 // If there is only one user, we start authenticating with that one here.
126 // If there are more users, the Greeter will handle that
127 if (LightDM.Users.count == 1) {
128 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
131 greeter.forceActiveFocus();
135 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress == 0) login()
139 // Update launcher items for new user
140 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
141 AccountsService.user = user;
142 LauncherModel.setUser(user);
145 onLeftTeaserPressedChanged: {
146 if (leftTeaserPressed) {
159 objectName: "greeterRevealer"
161 property real animatedProgress: MathUtils.clamp(-dragPosition / closedValue, 0, 1)
164 height: greeter.height
165 handleSize: shell.edgeSize
166 orientation: Qt.Horizontal
167 enabled: !greeter.locked
177 anchors.fill: parent //because this draws indicator menus
178 indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
181 available: !edgeDemo.active
183 fullscreenMode: false
190 anchors.top: parent.top
191 anchors.bottom: parent.bottom
193 dragAreaWidth: shell.edgeSize
194 available: greeter.narrowMode && !edgeDemo.active
195 onLauncherApplicationSelected: {
196 shell.activateApplication(appId)
200 panel.indicators.hide()
203 onShowDashHome: greeter.show()
209 model: NotificationBackend.Model
213 bottom: parent.bottom
214 leftMargin: units.gu(1)
215 rightMargin: units.gu(1)
216 topMargin: panel.panelHeight + units.gu(1)
221 when: overlay.width <= units.gu(60)
222 AnchorChanges { target: notifications; anchors.left: parent.left }
226 when: overlay.width > units.gu(60)
227 AnchorChanges { target: notifications; anchors.left: undefined }
228 PropertyChanges { target: notifications; width: units.gu(38) }
233 anchors { left: parent.left; right: parent.right }
234 height: parent.contentHeight
235 blockInput: height > 0
244 onDisplayPowerStateChange: {
245 if (status == Powerd.Off) {
247 edgeDemo.paused = true;
248 } else if (status == Powerd.On) {
249 edgeDemo.paused = false;
256 target: applicationManager
257 ignoreUnknownSignals: true
258 // If any app is focused when greeter is open, it's due to a user action
259 // like a snap decision (say, an incoming call).
260 // TODO: these should be protected to only unlock for certain applications / certain usecases
261 // potentially only in connection with a notification.
262 // TODO: what about the app the shell will restore focus to by itself?
263 onMainStageFocusedApplicationChanged: greeter.hide()
264 onSideStageFocusedApplicationChanged: greeter.hide()
269 target: LightDM.Upstart
270 onDispatchURL: shell.activateApplication(url)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list