on xenial help sign in
* Add new files

* Also add guards to the loader that check to ensure it is actually loaded

commitd11e2c74408c8423ceb378ed517ae1e4af1d5fda authorJosh Arenson <joshua.arenson@canonical.com> dateFri 22 May 2015, 11:44 (11 years ago) parent8ddaa79
2 files changed+97
qml/Greeter/IntegratedLightDMImpl.qml+37 qml/Greeter/LightDMGreeterAPI.qml+60
qml/Greeter/IntegratedLightDMImpl.qmlnew file+37
@@ -0,0 +1,37 @@
1+import QtQuick 2.3
2+import IntegratedLightDM 0.1 as LightDM
3+
4+QtObject {
5+ property bool active: LightDM.Greeter.active
6+ property bool authenticated: LightDM.Greeter.authenticated
7+ property bool promptless: LightDM.Greeter.promptless
8+ property real userCount: LightDM.Users.count
9+
10+ property var theGreeter: LightDM.Greeter
11+ property var infographicModel: LightDM.Infographic
12+ property var userModel: LightDM.Users
13+
14+ function authenticate(user) {
15+ LightDM.Greeter.authenticate(user);
16+ }
17+
18+ function getUser(uid) {
19+ return LightDM.Users.data(uid, LightDM.UserRoles.NameRole);
20+ }
21+
22+ function infographicReadyForDataChange() {
23+ LightDM.Infographic.readyForDataChange();
24+ }
25+
26+ function respond(response) {
27+ LightDM.Greeter.respond(response);
28+ }
29+
30+ function showGreeter() {
31+ LightDM.Greeter.showGreeter();
32+ }
33+
34+ function startSessionSync() {
35+ return LightDM.Greeter.startSessionSync();
36+ }
37+}
qml/Greeter/LightDMGreeterAPI.qmlnew file+60
@@ -0,0 +1,60 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+/**
18+ * Expose an API that allows interaction with the
19+ * integrated LightDM or real LightDM depending on shell mode
20+ */
21+import QtQuick 2.3
22+
23+Loader {
24+ source: "IntegratedLightDMImpl.qml"
25+ property bool valid: item !== null
26+
27+ property bool active: item.active
28+ property bool authenticated: item.authenticated
29+ property bool promptless: item.promptless
30+ property real userCount: item.userCount
31+
32+ property var theGreeter: item.theGreeter
33+ property var infographicModel: item.infographicModel
34+ property var userModel: item.userModel
35+
36+ function authenticate(user) {
37+ if (valid) item.authenticate(user);
38+ }
39+
40+ function getUser(uid) {
41+ if (valid) item.getUser(uid);
42+ }
43+
44+ function infographicReadyForDataChange() {
45+ if (valid) return item.infographicReadyForDataChange();
46+ }
47+
48+ function respond(response) {
49+ if (valid) item.respond(response);
50+ }
51+
52+ function showGreeter() {
53+ if (valid) item.showGreeter();
54+ }
55+
56+ function startSessionSync() {
57+ if (valid) item.startSessionSync();
58+ }
59+}
60+