Merge lp:~ken-vandine/ubuntu-system-settings/dim-timeout-1437510 into lp:ubuntu-system-settings

Proposed by Ken VanDine
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 1389
Merged at revision: 1422
Proposed branch: lp:~ken-vandine/ubuntu-system-settings/dim-timeout-1437510
Merge into: lp:ubuntu-system-settings
Diff against target: 63 lines (+18/-1)
2 files modified
plugins/battery/SleepValues.qml (+5/-1)
tests/autopilot/ubuntu_system_settings/tests/test_security.py (+13/-0)
To merge this branch: bzr merge lp:~ken-vandine/ubuntu-system-settings/dim-timeout-1437510
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+256685@code.launchpad.net

Commit message

Ensure dim-timeout is 10 seconds less than activity-timeout

Description of the change

Ensure dim-timeout is 10 seconds less than activity-timeout

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks Ken, that looks fine as a workaround, as you wrote on the bug ideally the system would do that for us. Not sure about the minimum value, we could just ensure it's > 10 as well, but I don't think it really makes a difference either way

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/battery/SleepValues.qml'
2--- plugins/battery/SleepValues.qml 2015-01-30 18:09:06 +0000
3+++ plugins/battery/SleepValues.qml 2015-04-17 15:26:50 +0000
4@@ -45,12 +45,16 @@
5 id: powerSettings
6 schema.id: usePowerd ? "com.ubuntu.touch.system" : "org.gnome.desktop.session"
7 onChanged: {
8- if (key == "activityTimeout" || key == "idleDelay")
9+ if (key == "activityTimeout" || key == "idleDelay") {
10 var curIndex = idleValues.indexOf(value)
11 if( curIndex != -1)
12 sleepSelector.selectedIndex = curIndex
13 else if(value === 0)
14 sleepSelector.selectedIndex = 6
15+ // ensure dimTimeout is 10 seconds less than activityTimeout
16+ if (usePowerd)
17+ dimTimeout = Math.max(activityTimeout - 10, 50)
18+ }
19 }
20 Component.onCompleted: {
21 if (usePowerd)
22
23=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_security.py'
24--- tests/autopilot/ubuntu_system_settings/tests/test_security.py 2015-02-19 15:18:09 +0000
25+++ tests/autopilot/ubuntu_system_settings/tests/test_security.py 2015-04-17 15:26:50 +0000
26@@ -62,6 +62,14 @@
27 prev = gsettings.get_uint('idle-delay')
28 return prev
29
30+ def _get_dim_timeout(self):
31+ if self.use_powerd:
32+ gsettings = Gio.Settings.new('com.ubuntu.touch.system')
33+ prev = gsettings.get_uint('dim-timeout')
34+ return prev
35+ else:
36+ return None
37+
38 def _go_to_phone_lock(self):
39 selector = self.security_page.select_single(
40 objectName='lockingControl'
41@@ -112,6 +120,7 @@
42
43 def test_locking_control_value(self):
44 actTimeout = self._get_activity_timeout()
45+ dimTimeout = self._get_dim_timeout()
46 activityTimeout = self.security_page.select_single(
47 objectName='lockingControl').value
48 if actTimeout is 0:
49@@ -120,10 +129,14 @@
50 self.assertEquals(
51 activityTimeout,
52 ('After {:d} minute').format(int(actTimeout/60)))
53+ if dimTimeout:
54+ self.assertEquals(dimTimeout, actTimeout - 10)
55 else:
56 self.assertEquals(
57 activityTimeout,
58 ('After {:d} minutes').format(int(actTimeout/60)))
59+ if dimTimeout:
60+ self.assertEquals(dimTimeout, actTimeout - 10)
61
62 def test_phone_lock_page(self):
63 self._go_to_phone_lock()

Subscribers

People subscribed via source and target branches