Merge lp:~mterry/ubuntu-system-settings/interactive-while-locked into lp:ubuntu-system-settings

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 922
Merged at revision: 966
Proposed branch: lp:~mterry/ubuntu-system-settings/interactive-while-locked
Merge into: lp:ubuntu-system-settings
Diff against target: 178 lines (+92/-16)
4 files modified
debian/control (+1/-1)
plugins/security-privacy/PhoneLocking.qml (+29/-8)
plugins/security-privacy/securityprivacy.cpp (+48/-7)
plugins/security-privacy/securityprivacy.h (+14/-0)
To merge this branch: bzr merge lp:~mterry/ubuntu-system-settings/interactive-while-locked
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Ken VanDine Needs Fixing
Matthew Paul Thomas design Pending
Review via email: mp+231567@code.launchpad.net

Commit message

Implement the "When locked, allow:" portion of the Security & Privacy panel, so now the user can control whether the launcher and/or indicators are available while locked. (LP: #1358340)

Description of the change

Implement the "When locked, allow:" portion of the Security & Privacy panel, so now the user can control whether the launcher and/or indicators are available while locked. (LP: #1358340)

The spec for this is here: https://wiki.ubuntu.com/SecurityAndPrivacySettings#Locking

And this needs to land and be tested with: https://code.launchpad.net/~mterry/gsettings-ubuntu-touch-schemas/enable-edges-while-locked/+merge/231562

== Checklist ==

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
 - Yes

 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
 - Yes

 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
 - Yes

 * Has your component "TestPlan” been executed successfully on emulator, N4?
 - Yes

 * Has a 5 minute exploratory testing run been executed on N4?
 - Yes

 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
 - I'm a core-dev

 * If you changed the UI, did you subscribe the design-reviewers to this MP?
 - Will do

 * What components might get impacted by your changes?
 - Security & Privacy only

 * Have you requested review by the teams of these owning components?
 - Who owns that?

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I've not reviewed it yet, but could you drop the translation template update from there? We don't do it from individual merge requests because it easily leads to conflicts, we rather commit manually an update after doing a landing that change strings

review: Needs Fixing
Revision history for this message
Michael Terry (mterry) wrote :

Done, I've reverted the pot changes.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Looks fine to me, thanks!

review: Approve
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This no longer merges cleanly now that the lock timeout settings has landed.

review: Needs Fixing
922. By Michael Terry

Merge from trunk

Revision history for this message
Michael Terry (mterry) wrote :

Merged from trunk!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, is there an unity8 side to that? I tried that update (with the corresponding schemas update) and the settings don't seem to work, I can't display the launcher or indicator on the lockscreen when using a password or pin code

review: Needs Information
Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, apparently the unity8 side didn't land yet, the changes look fine on principle, comment approving but needs to be tested with unity8 before landing

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-08-21 14:07:14 +0000
3+++ debian/control 2014-08-26 13:23:13 +0000
4@@ -52,7 +52,7 @@
5 Depends: ${misc:Depends},
6 ${shlibs:Depends},
7 accountsservice,
8- accountsservice-ubuntu-schemas (>= 0.0.2),
9+ accountsservice-ubuntu-schemas (>= 0.0.3),
10 bluez (>= 4.36),
11 dbus-property-service [amd64 armhf i386],
12 gsettings-desktop-schemas,
13
14=== modified file 'plugins/security-privacy/PhoneLocking.qml'
15--- plugins/security-privacy/PhoneLocking.qml 2014-08-26 00:54:38 +0000
16+++ plugins/security-privacy/PhoneLocking.qml 2014-08-26 13:23:13 +0000
17@@ -102,13 +102,34 @@
18 visible: showAllUI
19 }
20
21- /* TODO: once we know how to do this
22- ListItem.Standard {
23- text: i18n.tr("When locked, allow:")
24- }
25- Launcher,
26- Camera,
27- ...
28- */
29+ ListItem.Standard {
30+ text: i18n.tr("When locked, allow:")
31+ }
32+
33+ ListItem.Standard {
34+ text: i18n.tr("Launcher")
35+ control: CheckBox {
36+ id: launcherCheck
37+ enabled: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe
38+ checked: securityPrivacy.enableLauncherWhileLocked || !enabled
39+ onClicked: securityPrivacy.enableLauncherWhileLocked = checked
40+ }
41+ }
42+
43+ ListItem.Standard {
44+ text: i18n.tr("Notifications and quick settings")
45+ control: CheckBox {
46+ id: indicatorsCheck
47+ enabled: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe
48+ checked: securityPrivacy.enableIndicatorsWhileLocked || !enabled
49+ onClicked: securityPrivacy.enableIndicatorsWhileLocked = checked
50+ }
51+ }
52+
53+ ListItem.Caption {
54+ text: securityPrivacy.securityType === UbuntuSecurityPrivacyPanel.Swipe ?
55+ i18n.tr("Turn on lock security to restrict access when the phone is locked.") :
56+ i18n.tr("Other apps and functions will prompt you to unlock.")
57+ }
58 }
59 }
60
61=== modified file 'plugins/security-privacy/securityprivacy.cpp'
62--- plugins/security-privacy/securityprivacy.cpp 2014-08-04 19:36:55 +0000
63+++ plugins/security-privacy/securityprivacy.cpp 2014-08-26 13:23:13 +0000
64@@ -85,13 +85,18 @@
65 void SecurityPrivacy::slotChanged(QString interface,
66 QString property)
67 {
68- if (interface != AS_TOUCH_INTERFACE)
69- return;
70-
71- if (property == "MessagesWelcomeScreen") {
72- Q_EMIT messagesWelcomeScreenChanged();
73- } else if (property == "StatsWelcomeScreen") {
74- Q_EMIT statsWelcomeScreenChanged();
75+ if (interface == AS_INTERFACE) {
76+ if (property == "EnableLauncherWhileLocked") {
77+ Q_EMIT enableLauncherWhileLockedChanged();
78+ } else if (property == "EnableIndicatorsWhileLocked") {
79+ Q_EMIT enableIndicatorsWhileLockedChanged();
80+ }
81+ } else if (interface == AS_TOUCH_INTERFACE) {
82+ if (property == "MessagesWelcomeScreen") {
83+ Q_EMIT messagesWelcomeScreenChanged();
84+ } else if (property == "StatsWelcomeScreen") {
85+ Q_EMIT statsWelcomeScreenChanged();
86+ }
87 }
88 }
89
90@@ -100,6 +105,8 @@
91 // Tell QML so that it refreshes its view of the property
92 Q_EMIT messagesWelcomeScreenChanged();
93 Q_EMIT statsWelcomeScreenChanged();
94+ Q_EMIT enableLauncherWhileLockedChanged();
95+ Q_EMIT enableIndicatorsWhileLockedChanged();
96 }
97
98 bool SecurityPrivacy::getStatsWelcomeScreen()
99@@ -136,6 +143,40 @@
100 Q_EMIT(messagesWelcomeScreenChanged());
101 }
102
103+bool SecurityPrivacy::getEnableLauncherWhileLocked()
104+{
105+ return m_accountsService.getUserProperty(AS_INTERFACE,
106+ "EnableLauncherWhileLocked").toBool();
107+}
108+
109+void SecurityPrivacy::setEnableLauncherWhileLocked(bool enabled)
110+{
111+ if (enabled == getEnableLauncherWhileLocked())
112+ return;
113+
114+ m_accountsService.setUserProperty(AS_INTERFACE,
115+ "EnableLauncherWhileLocked",
116+ QVariant::fromValue(enabled));
117+ Q_EMIT enableLauncherWhileLockedChanged();
118+}
119+
120+bool SecurityPrivacy::getEnableIndicatorsWhileLocked()
121+{
122+ return m_accountsService.getUserProperty(AS_INTERFACE,
123+ "EnableIndicatorsWhileLocked").toBool();
124+}
125+
126+void SecurityPrivacy::setEnableIndicatorsWhileLocked(bool enabled)
127+{
128+ if (enabled == getEnableIndicatorsWhileLocked())
129+ return;
130+
131+ m_accountsService.setUserProperty(AS_INTERFACE,
132+ "EnableIndicatorsWhileLocked",
133+ QVariant::fromValue(enabled));
134+ Q_EMIT enableIndicatorsWhileLockedChanged();
135+}
136+
137 SecurityPrivacy::SecurityType SecurityPrivacy::getSecurityType()
138 {
139 if (m_user == NULL || !act_user_is_loaded(m_user))
140
141=== modified file 'plugins/security-privacy/securityprivacy.h'
142--- plugins/security-privacy/securityprivacy.h 2014-07-15 22:44:45 +0000
143+++ plugins/security-privacy/securityprivacy.h 2014-08-26 13:23:13 +0000
144@@ -48,6 +48,14 @@
145 READ getMessagesWelcomeScreen
146 WRITE setMessagesWelcomeScreen
147 NOTIFY messagesWelcomeScreenChanged)
148+ Q_PROPERTY (bool enableLauncherWhileLocked
149+ READ getEnableLauncherWhileLocked
150+ WRITE setEnableLauncherWhileLocked
151+ NOTIFY enableLauncherWhileLockedChanged)
152+ Q_PROPERTY (bool enableIndicatorsWhileLocked
153+ READ getEnableIndicatorsWhileLocked
154+ WRITE setEnableIndicatorsWhileLocked
155+ NOTIFY enableIndicatorsWhileLockedChanged)
156 Q_PROPERTY (SecurityType securityType
157 READ getSecurityType
158 NOTIFY securityTypeChanged)
159@@ -66,6 +74,10 @@
160 void setStatsWelcomeScreen(bool enabled);
161 bool getMessagesWelcomeScreen();
162 void setMessagesWelcomeScreen(bool enabled);
163+ bool getEnableLauncherWhileLocked();
164+ void setEnableLauncherWhileLocked(bool enabled);
165+ bool getEnableIndicatorsWhileLocked();
166+ void setEnableIndicatorsWhileLocked(bool enabled);
167 SecurityType getSecurityType();
168
169 // Returns error text, if an error occurred
170@@ -78,6 +90,8 @@
171 Q_SIGNALS:
172 void statsWelcomeScreenChanged();
173 void messagesWelcomeScreenChanged();
174+ void enableLauncherWhileLockedChanged();
175+ void enableIndicatorsWhileLockedChanged();
176 void securityTypeChanged();
177
178 private:

Subscribers

People subscribed via source and target branches