on xenial help sign in
Always keep indicator/launcher locked state in sync with whether the user is authenticated. (LP:# 1357230)
2756c13Michael Terry
plugins/LightDM/Greeter.cpp+2
@@ -106,6 +106,7 @@ void Greeter::authenticate(const QString &username)
106 }
106 }
107
107
108 d->m_greeter->authenticate(username);
108 d->m_greeter->authenticate(username);
109+ Q_EMIT isAuthenticatedChanged();
109 Q_EMIT authenticationUserChanged(username);
110 Q_EMIT authenticationUserChanged(username);
110}
111}
111
112
@@ -150,5 +151,6 @@ void Greeter::authenticationCompleteFilter()
150 Q_EMIT promptlessChanged();
151 Q_EMIT promptlessChanged();
151 }
152 }
152
153
154+ Q_EMIT isAuthenticatedChanged();
153 Q_EMIT authenticationComplete();
155 Q_EMIT authenticationComplete();
154}
156}
plugins/LightDM/Greeter.h+2−1
@@ -35,7 +35,7 @@ class Greeter : public QObject
35 Q_OBJECT
35 Q_OBJECT
36
36
37 Q_PROPERTY(bool active READ isActive WRITE setIsActive NOTIFY isActiveChanged)
37 Q_PROPERTY(bool active READ isActive WRITE setIsActive NOTIFY isActiveChanged)
38− Q_PROPERTY(bool authenticated READ isAuthenticated)
38+ Q_PROPERTY(bool authenticated READ isAuthenticated NOTIFY isAuthenticatedChanged)
39 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
39 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
40 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
40 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
41
41
@@ -59,6 +59,7 @@ Q_SIGNALS:
59 void authenticationComplete();
59 void authenticationComplete();
60 void authenticationUserChanged(const QString &user);
60 void authenticationUserChanged(const QString &user);
61 void isActiveChanged();
61 void isActiveChanged();
62+ void isAuthenticatedChanged();
62 void promptlessChanged();
63 void promptlessChanged();
63 void showGreeter();
64 void showGreeter();
64
65
tests/qmltests/tst_Shell.qml+11
@@ -445,6 +445,17 @@ Item {
445 touchRelease(shell);
445 touchRelease(shell);
446 }
446 }
447
447
448+ function test_unlockedProperties() {
449+ // Confirm that various properties have the correct values when unlocked
450+ tryCompare(shell, "locked", false)
451+
452+ var launcher = findChild(shell, "launcher")
453+ tryCompare(launcher, "available", true)
454+
455+ var indicators = findChild(shell, "indicators")
456+ tryCompare(indicators, "available", true)
457+ }
458+
448 function test_unlockAllModemsOnBoot() {
459 function test_unlockAllModemsOnBoot() {
449 unlockAllModemsSpy.clear()
460 unlockAllModemsSpy.clear()
450 // actually create an object so we notice the onCompleted signal
461 // actually create an object so we notice the onCompleted signal