on xenial help sign in
Merge in show-greeter-dbus
a668badMichael Terry
plugins/LightDM/DBusGreeter.cpp+5
@@ -34,6 +34,11 @@ bool DBusGreeter::isActive() const
34 return m_greeter->isActive();
34 return m_greeter->isActive();
35}
35}
36
36
37+void DBusGreeter::ShowGreeter()
38+{
39+ return Q_EMIT m_greeter->showGreeter();
40+}
41+
37void DBusGreeter::isActiveChangedHandler()
42void DBusGreeter::isActiveChangedHandler()
38{
43{
39 notifyPropertyChanged("IsActive", isActive());
44 notifyPropertyChanged("IsActive", isActive());
plugins/LightDM/DBusGreeter.h+1
@@ -37,6 +37,7 @@ public:
37 explicit DBusGreeter(Greeter *greeter, const QDBusConnection &connection, const QString &path);
37 explicit DBusGreeter(Greeter *greeter, const QDBusConnection &connection, const QString &path);
38
38
39 bool isActive() const;
39 bool isActive() const;
40+ Q_SCRIPTABLE void ShowGreeter(); // temporary, until we split the greeter again
40
41
41Q_SIGNALS:
42Q_SIGNALS:
42 void isActiveChanged();
43 void isActiveChanged();
plugins/LightDM/Greeter.h+1
@@ -60,6 +60,7 @@ Q_SIGNALS:
60 void authenticationUserChanged(const QString &user);
60 void authenticationUserChanged(const QString &user);
61 void isActiveChanged();
61 void isActiveChanged();
62 void promptlessChanged();
62 void promptlessChanged();
63+ void showGreeter();
63
64
64 // This signal is emitted by external agents like indicators, and the UI
65 // This signal is emitted by external agents like indicators, and the UI
65 // should switch to this user if possible.
66 // should switch to this user if possible.
qml/Shell.qml+5
@@ -367,6 +367,8 @@ FocusScope {
367 Connections {
367 Connections {
368 target: LightDM.Greeter
368 target: LightDM.Greeter
369
369
370+ onShowGreeter: greeter.show()
371+
370 onShowPrompt: {
372 onShowPrompt: {
371 if (LightDM.Users.count == 1) {
373 if (LightDM.Users.count == 1) {
372 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
374 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
@@ -453,6 +455,9 @@ FocusScope {
453 onShownChanged: {
455 onShownChanged: {
454 if (shown) {
456 if (shown) {
455 lockscreen.reset();
457 lockscreen.reset();
458+ if (!LightDM.Greeter.promptless) {
459+ lockscreen.show();
460+ }
456 // If there is only one user, we start authenticating with that one here.
461 // If there is only one user, we start authenticating with that one here.
457 // If there are more users, the Greeter will handle that
462 // If there are more users, the Greeter will handle that
458 if (LightDM.Users.count == 1) {
463 if (LightDM.Users.count == 1) {
tests/plugins/LightDM/dbus.cpp+7
@@ -187,6 +187,13 @@ private Q_SLOTS:
187 QVERIFY(arguments.at(1).toMap()["IsActive"].toBool());
187 QVERIFY(arguments.at(1).toMap()["IsActive"].toBool());
188 }
188 }
189
189
190+ void testShowGreeter()
191+ {
192+ // Just confirm the call exists and doesn't fail
193+ QDBusReply<void> reply = dbusMain->call("ShowGreeter");
194+ QVERIFY(reply.isValid());
195+ }
196+
190private:
197private:
191 QQuickView *view;
198 QQuickView *view;
192 Greeter *greeter;
199 Greeter *greeter;
tests/qmltests/tst_Shell.qml+8
@@ -20,6 +20,7 @@
20import QtQuick 2.0
20import QtQuick 2.0
21import QtTest 1.0
21import QtTest 1.0
22import GSettings 1.0
22import GSettings 1.0
23+import LightDM 0.1 as LightDM
23import Unity.Application 0.1
24import Unity.Application 0.1
24import Unity.Test 0.1 as UT
25import Unity.Test 0.1 as UT
25import Powerd 0.1
26import Powerd 0.1
@@ -565,6 +566,13 @@ Item {
565 waitUntilApplicationWindowIsFullyVisible()
566 waitUntilApplicationWindowIsFullyVisible()
566 }
567 }
567
568
569+ function test_showGreeterDBusCall() {
570+ var greeter = findChild(shell, "greeter")
571+ tryCompare(greeter, "showProgress", 0)
572+ LightDM.Greeter.showGreeter()
573+ tryCompare(greeter, "showProgress", 1)
574+ }
575+
568 function test_login() {
576 function test_login() {
569 var greeter = findChild(shell, "greeter")
577 var greeter = findChild(shell, "greeter")
570 greeter.show()
578 greeter.show()