on xenial help sign in
Always keep indicator/launcher locked state in sync with whether the user is authenticated. (LP:# 1357230)
commit2756c137dad605c6bd62f6dacd36e78892be6b47 authorMichael Terry <michael.terry@canonical.com> dateFri 22 Aug 2014, 09:28 (12 years ago) parent66d3f209e784f8
3 files changed+15−1
plugins/LightDM/Greeter.cpp+2 plugins/LightDM/Greeter.h+2−1 tests/qmltests/tst_Shell.qml+11
plugins/LightDM/Greeter.cpp+2
@@ -106,6 +106,7 @@ void Greeter::authenticate(const QString &username)
106106 }
107107
108108 d->m_greeter->authenticate(username);
109+ Q_EMIT isAuthenticatedChanged();
109110 Q_EMIT authenticationUserChanged(username);
110111}
111112
@@ -150,5 +151,6 @@ void Greeter::authenticationCompleteFilter()
150151 Q_EMIT promptlessChanged();
151152 }
152153
154+ Q_EMIT isAuthenticatedChanged();
153155 Q_EMIT authenticationComplete();
154156}
plugins/LightDM/Greeter.h+2−1
@@ -35,7 +35,7 @@ class Greeter : public QObject
3535 Q_OBJECT
3636
3737 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)
3939 Q_PROPERTY(QString authenticationUser READ authenticationUser NOTIFY authenticationUserChanged)
4040 Q_PROPERTY(bool promptless READ promptless NOTIFY promptlessChanged)
4141
@@ -59,6 +59,7 @@ Q_SIGNALS:
5959 void authenticationComplete();
6060 void authenticationUserChanged(const QString &user);
6161 void isActiveChanged();
62+ void isAuthenticatedChanged();
6263 void promptlessChanged();
6364 void showGreeter();
6465
tests/qmltests/tst_Shell.qml+11
@@ -445,6 +445,17 @@ Item {
445445 touchRelease(shell);
446446 }
447447
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+
448459 function test_unlockAllModemsOnBoot() {
449460 unlockAllModemsSpy.clear()
450461 // actually create an object so we notice the onCompleted signal