Merge lp:~mterry/unity8/show-greeter-dbus into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Michael Zanetti
Approved revision: 981
Merged at revision: 1049
Proposed branch: lp:~mterry/unity8/show-greeter-dbus
Merge into: lp:unity8
Prerequisite: lp:~mterry/unity8/is-active
Diff against target: 105 lines (+27/-0)
6 files modified
plugins/LightDM/DBusGreeter.cpp (+5/-0)
plugins/LightDM/DBusGreeter.h (+1/-0)
plugins/LightDM/Greeter.h (+1/-0)
qml/Shell.qml (+5/-0)
tests/plugins/LightDM/dbus.cpp (+7/-0)
tests/qmltests/tst_Shell.qml (+8/-0)
To merge this branch: bzr merge lp:~mterry/unity8/show-greeter-dbus
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+224942@code.launchpad.net

This proposal supersedes a proposal from 2014-06-29.

Commit message

Allow the session to bring up the greeter/lockscreen over DBus. The emergency dialer will need this support in order to cancel bringing it up.

Description of the change

Allow the session to bring up the greeter/lockscreen over DBus. The emergency dialer will need this support in order to cancel bringing it up.

== Checklist ==

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 - Yes, lp:~mterry/unity8/is-active, which this MP is based on

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 - Yes

 * Did you make sure that your branch does not contain spurious tags?
 - Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 - NA

 * If you changed the UI, has there been a design review?
 -NA

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/show-greeter-dbus updated
981. By Michael Terry

Merge from is-active

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

Yep, working fine

 * Did CI run pass? If not, please explain why.

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/LightDM/DBusGreeter.cpp'
2--- plugins/LightDM/DBusGreeter.cpp 2014-07-11 15:45:05 +0000
3+++ plugins/LightDM/DBusGreeter.cpp 2014-07-11 15:45:05 +0000
4@@ -34,6 +34,11 @@
5 return m_greeter->isActive();
6 }
7
8+void DBusGreeter::ShowGreeter()
9+{
10+ return Q_EMIT m_greeter->showGreeter();
11+}
12+
13 void DBusGreeter::isActiveChangedHandler()
14 {
15 notifyPropertyChanged("IsActive", isActive());
16
17=== modified file 'plugins/LightDM/DBusGreeter.h'
18--- plugins/LightDM/DBusGreeter.h 2014-07-11 15:45:05 +0000
19+++ plugins/LightDM/DBusGreeter.h 2014-07-11 15:45:05 +0000
20@@ -37,6 +37,7 @@
21 explicit DBusGreeter(Greeter *greeter, const QDBusConnection &connection, const QString &path);
22
23 bool isActive() const;
24+ Q_SCRIPTABLE void ShowGreeter(); // temporary, until we split the greeter again
25
26 Q_SIGNALS:
27 void isActiveChanged();
28
29=== modified file 'plugins/LightDM/Greeter.h'
30--- plugins/LightDM/Greeter.h 2014-07-11 15:45:05 +0000
31+++ plugins/LightDM/Greeter.h 2014-07-11 15:45:05 +0000
32@@ -60,6 +60,7 @@
33 void authenticationUserChanged(const QString &user);
34 void isActiveChanged();
35 void promptlessChanged();
36+ void showGreeter();
37
38 // This signal is emitted by external agents like indicators, and the UI
39 // should switch to this user if possible.
40
41=== modified file 'qml/Shell.qml'
42--- qml/Shell.qml 2014-07-11 15:45:05 +0000
43+++ qml/Shell.qml 2014-07-11 15:45:05 +0000
44@@ -348,6 +348,8 @@
45 Connections {
46 target: LightDM.Greeter
47
48+ onShowGreeter: greeter.show()
49+
50 onShowPrompt: {
51 if (LightDM.Users.count == 1) {
52 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
53@@ -418,6 +420,9 @@
54 onShownChanged: {
55 if (shown) {
56 lockscreen.reset();
57+ if (!LightDM.Greeter.promptless) {
58+ lockscreen.show();
59+ }
60 // If there is only one user, we start authenticating with that one here.
61 // If there are more users, the Greeter will handle that
62 if (LightDM.Users.count == 1) {
63
64=== modified file 'tests/plugins/LightDM/dbus.cpp'
65--- tests/plugins/LightDM/dbus.cpp 2014-07-11 15:45:05 +0000
66+++ tests/plugins/LightDM/dbus.cpp 2014-07-11 15:45:05 +0000
67@@ -187,6 +187,13 @@
68 QVERIFY(arguments.at(1).toMap()["IsActive"].toBool());
69 }
70
71+ void testShowGreeter()
72+ {
73+ // Just confirm the call exists and doesn't fail
74+ QDBusReply<void> reply = dbusMain->call("ShowGreeter");
75+ QVERIFY(reply.isValid());
76+ }
77+
78 private:
79 QQuickView *view;
80 Greeter *greeter;
81
82=== modified file 'tests/qmltests/tst_Shell.qml'
83--- tests/qmltests/tst_Shell.qml 2014-07-05 22:26:59 +0000
84+++ tests/qmltests/tst_Shell.qml 2014-07-11 15:45:05 +0000
85@@ -20,6 +20,7 @@
86 import QtQuick 2.0
87 import QtTest 1.0
88 import GSettings 1.0
89+import LightDM 0.1 as LightDM
90 import Unity.Application 0.1
91 import Unity.Test 0.1 as UT
92 import Powerd 0.1
93@@ -520,5 +521,12 @@
94 tryCompare(greeter, "showProgress", 0)
95 waitUntilApplicationWindowIsFullyVisible()
96 }
97+
98+ function test_showGreeterDBusCall() {
99+ var greeter = findChild(shell, "greeter")
100+ tryCompare(greeter, "showProgress", 0)
101+ LightDM.Greeter.showGreeter()
102+ tryCompare(greeter, "showProgress", 1)
103+ }
104 }
105 }

Subscribers

People subscribed via source and target branches