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.requestUrlStart(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))
74 target: LightDM.Greeter
77 greeter.enabled = true
82 if (LightDM.Users.count == 1) {
83 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
85 lockscreen.alphaNumeric = false
87 lockscreen.alphaNumeric = true
89 lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
94 onAuthenticationComplete: {
95 if (LightDM.Greeter.promptless) {
98 if (LightDM.Greeter.authenticated) {
101 lockscreen.clear(true);
109 opacity: greeterWrapper.showProgress * 0.8
113 // Just a tiny wrapper to adjust greeter's x without messing with its own dragging
117 height: parent.height
119 Behavior on x {SmoothedAnimation{velocity: 600}}
121 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
122 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
126 objectName: "greeter"
129 hides: [launcher, panel.indicators]
131 background: shell.background
135 height: parent.height - panel.panelHeight
137 dragHandleWidth: shell.edgeSize
141 LightDM.Greeter.startSessionSync();
147 // If there is only one user, we start authenticating with that one here.
148 // If there are more users, the Greeter will handle that
149 if (LightDM.Users.count == 1) {
150 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
152 greeter.forceActiveFocus();
158 // Update launcher items for new user
159 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
160 AccountsService.user = user;
161 LauncherModel.setUser(user);
163 onTease: launcher.tease()
174 objectName: "greeterRevealer"
176 property real animatedProgress: MathUtils.clamp(-dragPosition / closedValue, 0, 1)
179 height: greeter.height
180 handleSize: shell.edgeSize
181 orientation: Qt.Horizontal
182 enabled: !greeter.locked
192 anchors.fill: parent //because this draws indicator menus
193 indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
196 available: !edgeDemo.active
198 fullscreenMode: initialPanelDelay.running
203 id: initialPanelDelay
211 anchors.top: parent.top
212 anchors.bottom: parent.bottom
214 dragAreaWidth: shell.edgeSize
215 available: greeter.narrowMode && !edgeDemo.active
216 onLauncherApplicationSelected: {
217 shell.activateApplication("application:///" + appId + ".desktop")
221 panel.indicators.hide()
228 onShowDashHome: greeter.show()
234 model: NotificationBackend.Model
238 bottom: parent.bottom
239 leftMargin: units.gu(1)
240 rightMargin: units.gu(1)
241 topMargin: panel.panelHeight + units.gu(1)
246 when: overlay.width <= units.gu(60)
247 AnchorChanges { target: notifications; anchors.left: parent.left }
251 when: overlay.width > units.gu(60)
252 AnchorChanges { target: notifications; anchors.left: undefined }
253 PropertyChanges { target: notifications; width: units.gu(38) }
258 anchors { left: parent.left; right: parent.right }
259 height: parent.contentHeight
260 blockInput: height > 0
266 anchors.topMargin: panel.panelHeight
267 anchors.fill: parent // as needs to know the geometry of the shell
274 onDisplayPowerStateChange: {
275 if (status == Powerd.Off) {
277 edgeDemo.paused = true;
278 } else if (status == Powerd.On) {
279 edgeDemo.paused = false;
285 target: LightDM.URLDispatcher
286 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