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
64 onEntered: LightDM.Greeter.respond(passphrase);
65 onCancel: greeter.show()
67 Component.onCompleted: {
68 if (LightDM.Users.count == 1) {
69 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
75 target: LightDM.Greeter
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
120 enabled: !launcher.dashSwipe
124 readonly property real showProgress: MathUtils.clamp((1 - x/width) + greeter.showProgress - 1, 0, 1)
125 onShowProgressChanged: if (LightDM.Greeter.promptless && showProgress === 0) greeter.login()
129 objectName: "greeter"
132 hides: [launcher, panel.indicators]
134 background: shell.background
138 height: parent.height - panel.panelHeight
140 dragHandleWidth: shell.edgeSize
144 LightDM.Greeter.startSessionSync();
151 // If there is only one user, we start authenticating with that one here.
152 // If there are more users, the Greeter will handle that
153 if (LightDM.Users.count == 1) {
154 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
156 greeter.forceActiveFocus();
162 // Update launcher items for new user
163 var user = LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
164 AccountsService.user = user;
165 LauncherModel.setUser(user);
167 onTease: launcher.tease()
183 anchors.fill: parent //because this draws indicator menus
184 indicatorsMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
187 available: !edgeDemo.active
189 fullscreenMode: false
196 readonly property bool dashSwipe: progress > 0
198 anchors.top: parent.top
199 anchors.bottom: parent.bottom
201 dragAreaWidth: shell.edgeSize
202 available: !edgeDemo.active
203 onLauncherApplicationSelected: {
204 shell.activateApplication(LauncherModel.getUrlForAppId(appId))
208 panel.indicators.hide()
216 SessionBroadcast.requestHomeShown(LightDM.Greeter.authenticationUser)
224 model: NotificationBackend.Model
230 bottom: parent.bottom
231 topMargin: panel.panelHeight
236 when: overlay.width <= units.gu(60)
237 AnchorChanges { target: notifications; anchors.left: parent.left }
241 when: overlay.width > units.gu(60)
242 AnchorChanges { target: notifications; anchors.left: undefined }
243 PropertyChanges { target: notifications; width: units.gu(38) }
248 anchors { left: parent.left; right: parent.right }
249 height: parent.contentHeight
250 blockInput: height > 0
256 anchors.topMargin: panel.panelHeight
257 anchors.fill: parent // as needs to know the geometry of the shell
264 onDisplayPowerStateChange: {
265 if (status == Powerd.Off) {
267 edgeDemo.paused = true;
268 } else if (status == Powerd.On) {
269 edgeDemo.paused = false;
275 target: LightDM.URLDispatcher
276 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