on xenial help sign in
Split the one setting into two
b3578c1Michael Terry
plugins/AccountsService/AccountsService.cpp+30−11
@@ -26,7 +26,8 @@ AccountsService::AccountsService(QObject* parent)
26 m_service(new AccountsServiceDBusAdaptor(this)),
26 m_service(new AccountsServiceDBusAdaptor(this)),
27 m_user(qgetenv("USER")),
27 m_user(qgetenv("USER")),
28 m_demoEdges(false),
28 m_demoEdges(false),
29− m_interactiveWhileLocked(false),
29+ m_enableLauncherWhileLocked(false),
30+ m_enableIndicatorsWhileLocked(false),
30 m_statsWelcomeScreen(false),
31 m_statsWelcomeScreen(false),
31 m_passwordDisplayHint(Keyboard),
32 m_passwordDisplayHint(Keyboard),
32 m_failedLogins(0)
33 m_failedLogins(0)
@@ -48,7 +49,8 @@ void AccountsService::setUser(const QString &user)
48 Q_EMIT userChanged();
49 Q_EMIT userChanged();
49
50
50 updateDemoEdges();
51 updateDemoEdges();
51− updateInteractiveWhileLocked();
52+ updateEnableLauncherWhileLocked();
53+ updateEnableIndicatorsWhileLocked();
52 updateBackgroundFile();
54 updateBackgroundFile();
53 updateStatsWelcomeScreen();
55 updateStatsWelcomeScreen();
54 updatePasswordDisplayHint();
56 updatePasswordDisplayHint();
@@ -66,9 +68,14 @@ void AccountsService::setDemoEdges(bool demoEdges)
66 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
68 m_service->setUserProperty(m_user, "com.canonical.unity.AccountsService", "demo-edges", demoEdges);
67}
69}
68
70
69−bool AccountsService::interactiveWhileLocked() const
71+bool AccountsService::enableLauncherWhileLocked() const
70{
72{
71− return m_interactiveWhileLocked;
73+ return m_enableLauncherWhileLocked;
74+}
75+
76+bool AccountsService::enableIndicatorsWhileLocked() const
77+{
78+ return m_enableIndicatorsWhileLocked;
72}
79}
73
80
74QString AccountsService::backgroundFile() const
81QString AccountsService::backgroundFile() const
@@ -95,12 +102,21 @@ void AccountsService::updateDemoEdges()
95 }
102 }
96}
103}
97
104
98−void AccountsService::updateInteractiveWhileLocked()
105+void AccountsService::updateEnableLauncherWhileLocked()
106+{
107+ auto enableLauncherWhileLocked = m_service->getUserProperty(m_user, "com.canonical.unity.AccountsService", "EnableLauncherWhileLocked").toBool();
108+ if (m_enableLauncherWhileLocked != enableLauncherWhileLocked) {
109+ m_enableLauncherWhileLocked = enableLauncherWhileLocked;
110+ Q_EMIT enableLauncherWhileLockedChanged();
111+ }
112+}
113+
114+void AccountsService::updateEnableIndicatorsWhileLocked()
99{
115{
100− auto interactiveWhileLocked = m_service->getUserProperty(m_user, "com.canonical.unity.AccountsService", "InteractiveWhileLocked").toBool();
116+ auto enableIndicatorsWhileLocked = m_service->getUserProperty(m_user, "com.canonical.unity.AccountsService", "EnableIndicatorsWhileLocked").toBool();
101− if (m_interactiveWhileLocked != interactiveWhileLocked) {
117+ if (m_enableIndicatorsWhileLocked != enableIndicatorsWhileLocked) {
102− m_interactiveWhileLocked = interactiveWhileLocked;
118+ m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
103− Q_EMIT interactiveWhileLockedChanged();
119+ Q_EMIT enableIndicatorsWhileLockedChanged();
104 }
120 }
105}
121}
106
122
@@ -161,8 +177,11 @@ void AccountsService::propertiesChanged(const QString &user, const QString &inte
161 if (changed.contains("demo-edges")) {
177 if (changed.contains("demo-edges")) {
162 updateDemoEdges();
178 updateDemoEdges();
163 }
179 }
164− if (changed.contains("InteractiveWhileLocked")) {
180+ if (changed.contains("EnableLauncherWhileLocked")) {
165− updateInteractiveWhileLocked();
181+ updateEnableLauncherWhileLocked();
182+ }
183+ if (changed.contains("EnableIndicatorsWhileLocked")) {
184+ updateEnableIndicatorsWhileLocked();
166 }
185 }
167 } else if (interface == "com.canonical.unity.AccountsService.Private") {
186 } else if (interface == "com.canonical.unity.AccountsService.Private") {
168 if (changed.contains("FailedLogins")) {
187 if (changed.contains("FailedLogins")) {
plugins/AccountsService/AccountsService.h+14−7
@@ -36,9 +36,12 @@ class AccountsService: public QObject
36 READ demoEdges
36 READ demoEdges
37 WRITE setDemoEdges
37 WRITE setDemoEdges
38 NOTIFY demoEdgesChanged)
38 NOTIFY demoEdgesChanged)
39− Q_PROPERTY (bool interactiveWhileLocked
39+ Q_PROPERTY (bool enableLauncherWhileLocked
40− READ interactiveWhileLocked
40+ READ enableLauncherWhileLocked
41− NOTIFY interactiveWhileLockedChanged)
41+ NOTIFY enableLauncherWhileLockedChanged)
42+ Q_PROPERTY (bool enableIndicatorsWhileLocked
43+ READ enableIndicatorsWhileLocked
44+ NOTIFY enableIndicatorsWhileLockedChanged)
42 Q_PROPERTY (QString backgroundFile
45 Q_PROPERTY (QString backgroundFile
43 READ backgroundFile
46 READ backgroundFile
44 NOTIFY backgroundFileChanged)
47 NOTIFY backgroundFileChanged)
@@ -65,7 +68,8 @@ public:
65 void setUser(const QString &user);
68 void setUser(const QString &user);
66 bool demoEdges() const;
69 bool demoEdges() const;
67 void setDemoEdges(bool demoEdges);
70 void setDemoEdges(bool demoEdges);
68− bool interactiveWhileLocked() const;
71+ bool enableLauncherWhileLocked() const;
72+ bool enableIndicatorsWhileLocked() const;
69 QString backgroundFile() const;
73 QString backgroundFile() const;
70 bool statsWelcomeScreen() const;
74 bool statsWelcomeScreen() const;
71 PasswordDisplayHint passwordDisplayHint() const;
75 PasswordDisplayHint passwordDisplayHint() const;
@@ -75,7 +79,8 @@ public:
75Q_SIGNALS:
79Q_SIGNALS:
76 void userChanged();
80 void userChanged();
77 void demoEdgesChanged();
81 void demoEdgesChanged();
78− void interactiveWhileLockedChanged();
82+ void enableLauncherWhileLockedChanged();
83+ void enableIndicatorsWhileLockedChanged();
79 void backgroundFileChanged();
84 void backgroundFileChanged();
80 void statsWelcomeScreenChanged();
85 void statsWelcomeScreenChanged();
81 void passwordDisplayHintChanged();
86 void passwordDisplayHintChanged();
@@ -87,7 +92,8 @@ private Q_SLOTS:
87
92
88private:
93private:
89 void updateDemoEdges();
94 void updateDemoEdges();
90− void updateInteractiveWhileLocked();
95+ void updateEnableLauncherWhileLocked();
96+ void updateEnableIndicatorsWhileLocked();
91 void updateBackgroundFile();
97 void updateBackgroundFile();
92 void updateStatsWelcomeScreen();
98 void updateStatsWelcomeScreen();
93 void updatePasswordDisplayHint();
99 void updatePasswordDisplayHint();
@@ -96,7 +102,8 @@ private:
96 AccountsServiceDBusAdaptor *m_service;
102 AccountsServiceDBusAdaptor *m_service;
97 QString m_user;
103 QString m_user;
98 bool m_demoEdges;
104 bool m_demoEdges;
99− bool m_interactiveWhileLocked;
105+ bool m_enableLauncherWhileLocked;
106+ bool m_enableIndicatorsWhileLocked;
100 QString m_backgroundFile;
107 QString m_backgroundFile;
101 bool m_statsWelcomeScreen;
108 bool m_statsWelcomeScreen;
102 PasswordDisplayHint m_passwordDisplayHint;
109 PasswordDisplayHint m_passwordDisplayHint;
plugins/AccountsService/com.canonical.unity.AccountsService.xml+5−1
@@ -9,7 +9,11 @@
9 <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny"
9 <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny"
10 value="com.ubuntu.AccountsService.GreeterChangeAny"/>
10 value="com.ubuntu.AccountsService.GreeterChangeAny"/>
11
11
12− <property name="InteractiveWhileLocked" type="b" access="readwrite">
12+ <property name="EnableLauncherWhileLocked" type="b" access="readwrite">
13+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
14+ </property>
15+
16+ <property name="EnableIndicatorsWhileLocked" type="b" access="readwrite">
13 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
17 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
14 </property>
18 </property>
15
19
qml/Shell.qml+2−2
@@ -496,7 +496,7 @@ Item {
496 anchors.fill: parent //because this draws indicator menus
496 anchors.fill: parent //because this draws indicator menus
497 indicators {
497 indicators {
498 hides: [launcher]
498 hides: [launcher]
499− available: edgeDemo.panelEnabled && (!shell.locked || AccountsService.interactiveWhileLocked) && greeter.fakeActiveForApp === ""
499+ available: edgeDemo.panelEnabled && (!shell.locked || AccountsService.enableIndicatorsWhileLocked) && greeter.fakeActiveForApp === ""
500 contentEnabled: edgeDemo.panelContentEnabled
500 contentEnabled: edgeDemo.panelContentEnabled
501 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
501 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
502 panelHeight: units.gu(3)
502 panelHeight: units.gu(3)
@@ -520,7 +520,7 @@ Item {
520 anchors.bottom: parent.bottom
520 anchors.bottom: parent.bottom
521 width: parent.width
521 width: parent.width
522 dragAreaWidth: shell.edgeSize
522 dragAreaWidth: shell.edgeSize
523− available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.interactiveWhileLocked) && greeter.fakeActiveForApp === ""
523+ available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
524
524
525 onShowDashHome: showHome()
525 onShowDashHome: showHome()
526 onDash: showDash()
526 onDash: showDash()
tests/mocks/AccountsService/AccountsService.cpp+18−6
@@ -22,7 +22,8 @@
22
22
23AccountsService::AccountsService(QObject* parent)
23AccountsService::AccountsService(QObject* parent)
24 : QObject(parent),
24 : QObject(parent),
25− m_interactiveWhileLocked(true),
25+ m_enableLauncherWhileLocked(true),
26+ m_enableIndicatorsWhileLocked(true),
26 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
27 m_backgroundFile(qmlDirectory() + "graphics/phone_background.jpg"),
27 m_statsWelcomeScreen(true),
28 m_statsWelcomeScreen(true),
28 m_failedLogins(0)
29 m_failedLogins(0)
@@ -51,15 +52,26 @@ void AccountsService::setDemoEdges(bool demoEdges)
51 Q_UNUSED(demoEdges)
52 Q_UNUSED(demoEdges)
52}
53}
53
54
54−bool AccountsService::interactiveWhileLocked() const
55+bool AccountsService::enableLauncherWhileLocked() const
55{
56{
56− return m_interactiveWhileLocked;
57+ return m_enableLauncherWhileLocked;
57}
58}
58
59
59−void AccountsService::setInteractiveWhileLocked(bool interactiveWhileLocked)
60+void AccountsService::setEnableLauncherWhileLocked(bool enableLauncherWhileLocked)
60{
61{
61− m_interactiveWhileLocked = interactiveWhileLocked;
62+ m_enableLauncherWhileLocked = enableLauncherWhileLocked;
62− Q_EMIT interactiveWhileLockedChanged();
63+ Q_EMIT enableLauncherWhileLockedChanged();
64+}
65+
66+bool AccountsService::enableIndicatorsWhileLocked() const
67+{
68+ return m_enableIndicatorsWhileLocked;
69+}
70+
71+void AccountsService::setEnableIndicatorsWhileLocked(bool enableIndicatorsWhileLocked)
72+{
73+ m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
74+ Q_EMIT enableIndicatorsWhileLockedChanged();
63}
75}
64
76
65QString AccountsService::backgroundFile() const
77QString AccountsService::backgroundFile() const
tests/mocks/AccountsService/AccountsService.h+16−8
@@ -36,10 +36,14 @@ class AccountsService: public QObject
36 READ demoEdges
36 READ demoEdges
37 WRITE setDemoEdges
37 WRITE setDemoEdges
38 NOTIFY demoEdgesChanged)
38 NOTIFY demoEdgesChanged)
39− Q_PROPERTY (bool interactiveWhileLocked
39+ Q_PROPERTY (bool enableLauncherWhileLocked
40− READ interactiveWhileLocked
40+ READ enableLauncherWhileLocked
41+ WRITE setEnableLauncherWhileLocked // only available in mock
42+ NOTIFY enableLauncherWhileLockedChanged)
43+ Q_PROPERTY (bool enableIndicatorsWhileLocked
44+ READ enableIndicatorsWhileLocked
41− WRITE setInteractiveWhileLocked // only available in mock
45+ WRITE setEnableIndicatorsWhileLocked // only available in mock
42− NOTIFY interactiveWhileLockedChanged)
46+ NOTIFY enableIndicatorsWhileLockedChanged)
43 Q_PROPERTY (QString backgroundFile
47 Q_PROPERTY (QString backgroundFile
44 READ backgroundFile
48 READ backgroundFile
45 WRITE setBackgroundFile // only available in mock
49 WRITE setBackgroundFile // only available in mock
@@ -68,8 +72,10 @@ public:
68 void setUser(const QString &user);
72 void setUser(const QString &user);
69 bool demoEdges() const;
73 bool demoEdges() const;
70 void setDemoEdges(bool demoEdges);
74 void setDemoEdges(bool demoEdges);
71− bool interactiveWhileLocked() const;
75+ bool enableLauncherWhileLocked() const;
72− void setInteractiveWhileLocked(bool interactiveWhileLocked);
76+ void setEnableLauncherWhileLocked(bool enableLauncherWhileLocked);
77+ bool enableIndicatorsWhileLocked() const;
78+ void setEnableIndicatorsWhileLocked(bool enableIndicatorsWhileLocked);
73 QString backgroundFile() const;
79 QString backgroundFile() const;
74 void setBackgroundFile(const QString &backgroundFile);
80 void setBackgroundFile(const QString &backgroundFile);
75 bool statsWelcomeScreen() const;
81 bool statsWelcomeScreen() const;
@@ -81,14 +87,16 @@ public:
81Q_SIGNALS:
87Q_SIGNALS:
82 void userChanged();
88 void userChanged();
83 void demoEdgesChanged();
89 void demoEdgesChanged();
84− void interactiveWhileLockedChanged();
90+ void enableLauncherWhileLockedChanged();
91+ void enableIndicatorsWhileLockedChanged();
85 void backgroundFileChanged();
92 void backgroundFileChanged();
86 void statsWelcomeScreenChanged();
93 void statsWelcomeScreenChanged();
87 void passwordDisplayHintChanged();
94 void passwordDisplayHintChanged();
88 void failedLoginsChanged();
95 void failedLoginsChanged();
89
96
90private:
97private:
91− bool m_interactiveWhileLocked;
98+ bool m_enableLauncherWhileLocked;
99+ bool m_enableIndicatorsWhileLocked;
92 QString m_backgroundFile;
100 QString m_backgroundFile;
93 QString m_user;
101 QString m_user;
94 bool m_statsWelcomeScreen;
102 bool m_statsWelcomeScreen;
tests/qmltests/tst_ShellWithPin.qml+7−5
@@ -75,7 +75,8 @@ Item {
75 swipeAwayGreeter()
75 swipeAwayGreeter()
76 shell.failedLoginsDelayAttempts = -1
76 shell.failedLoginsDelayAttempts = -1
77 shell.maxFailedLogins = -1
77 shell.maxFailedLogins = -1
78− AccountsService.interactiveWhileLocked = true
78+ AccountsService.enableLauncherWhileLocked = true
79+ AccountsService.enableIndicatorsWhileLocked = true
79 }
80 }
80
81
81 function cleanup() {
82 function cleanup() {
@@ -131,12 +132,13 @@ Item {
131
132
132 function test_disabledEdges() {
133 function test_disabledEdges() {
133 var launcher = findChild(shell, "launcher")
134 var launcher = findChild(shell, "launcher")
134− var indicators = findChild(shell, "indicators")
135 tryCompare(launcher, "available", true)
135 tryCompare(launcher, "available", true)
136− tryCompare(indicators, "available", true)
137−
138− AccountsService.interactiveWhileLocked = false
136+ AccountsService.enableLauncherWhileLocked = false
139 tryCompare(launcher, "available", false)
137 tryCompare(launcher, "available", false)
138+
139+ var indicators = findChild(shell, "indicators")
140+ tryCompare(indicators, "available", true)
141+ AccountsService.enableIndicatorsWhileLocked = false
140 tryCompare(indicators, "available", false)
142 tryCompare(indicators, "available", false)
141 }
143 }
142
144