Merge lp:~vthompson/ubuntu-clock-app/sound-and-repeat-on-click into lp:ubuntu-clock-app

Proposed by Victor Thompson
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 203
Merged at revision: 209
Proposed branch: lp:~vthompson/ubuntu-clock-app/sound-and-repeat-on-click
Merge into: lp:ubuntu-clock-app
Diff against target: 71 lines (+21/-6)
3 files modified
app/alarm/AlarmRepeat.qml (+4/-0)
app/alarm/AlarmSound.qml (+13/-6)
debian/changelog (+4/-0)
To merge this branch: bzr merge lp:~vthompson/ubuntu-clock-app/sound-and-repeat-on-click
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Approve
Review via email: mp+250546@code.launchpad.net

Commit message

Allow tapping repeat and sound ListItems to trigger action.

Description of the change

Allow tapping repeat and sound ListItems to trigger action. Currently the user has to tap the CheckBox in order to toggle to the selection. It'd be preferable to be able to tap the ListItem to toggle the action.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> Allow tapping repeat and sound ListItems to trigger action. Currently the user has to tap the CheckBox in order to toggle to the selection. It'd be preferable to be able to tap the ListItem to toggle the action.

I noticed this "regression" a couple of weeks ago which caused the clock app tests to fail. After some investigation, I noticed that

- In Ubuntu-RTM the listitems have the behaviour where the user can click anywhere and to check/uncheck the checkbox.

- In Ubuntu-Vivid, the user has to explicitly click on the checkbox to check/uncheck it.

On talking to zsombor, he said the ubuntu-rtm behaviour was a SDK bug and that it was fixed in vivid. So naturally I just fixed the clock app tests with the new behavior although I prefer the ubuntu-rtm solution.

Can you check what the behavior is for listitems shown in the indicator panels on vivid? I would prefer we stick to their solution to maintain consistency with the platform. And if this usability issue is present throughout the platform we can take it up on the mailing list to fix it in the SDK itself.

review: Needs Information
Revision history for this message
Victor Thompson (vthompson) wrote :

I was almost 100% sure it's always been like this. I might flash back to RTM to verify, though.

On Vivid, the indicator values are toggled and any corresponding action is executed by tapping the ListItem--the icon/switch does not need to be explicitly tapped.

Revision history for this message
Victor Thompson (vthompson) wrote :

After flashing RTM, I agree that this seems like a "regression" since it behaved as expected in RTM. However, it makes sense that the SDK shouldn't automatically assume a certain action is taken when a ListItem is clicked. So it does seem like something that should be application specific.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

I believe the following code,

51 + onClicked: {
52 + if (!_soundStatus.checked) {
53 + // Ensures only one alarm sound is selected
54 + for(var i=0; i<soundModel.count; i++) {
55 + if(_alarmSounds.itemAt(i).isChecked &&
56 + i !== index) {
57 + _alarmSounds.itemAt(i).isChecked = false
58 + }
59 + }
60 + _soundStatus.checked = true
61 }
62 }

can be refactored into,

onClicked: {
     if (!_soundStatus.checked) {
          _soundStatus.checked = true
     }
}

We don't need to do the "ensure only one alarm" loop again since it will be done automatically inside the onCheckedChanged signal. Do you agree?

Also please update the debian changelog with your change. Please add to the existing version 3.3 by nano editing it directly.

Everything else looks good.

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

I agree, ensuring that the other CheckBox components are not checked is no longer necessary.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

LGTM! Thnx for the fix Victor.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://91.189.93.70:8080/job/ubuntu-clock-app-autolanding/226/
Executed test runs:
    FAILURE: http://91.189.93.70:8080/job/generic-mediumtests-utopic/2270/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Looks like there were 3 QML test failures. It looks random since the code wasn't changed there. Reapproving.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmRepeat.qml'
2--- app/alarm/AlarmRepeat.qml 2015-01-22 00:26:16 +0000
3+++ app/alarm/AlarmRepeat.qml 2015-03-06 01:09:34 +0000
4@@ -154,6 +154,10 @@
5 }
6 }
7 }
8+
9+ onClicked: {
10+ daySwitch.checked = !daySwitch.checked
11+ }
12 }
13 }
14 }
15
16=== modified file 'app/alarm/AlarmSound.qml'
17--- app/alarm/AlarmSound.qml 2014-10-16 19:03:51 +0000
18+++ app/alarm/AlarmSound.qml 2015-03-06 01:09:34 +0000
19@@ -95,11 +95,10 @@
20
21 checked: alarmSound.subText === _soundName.text ? true
22 : false
23- onClicked: {
24- previewAlarmSound.source = fileURL
25- previewAlarmSound.play()
26-
27+ onCheckedChanged: {
28 if (checked) {
29+ previewAlarmSound.source = fileURL
30+ previewAlarmSound.play()
31 alarmSound.subText = _soundName.text
32 alarm.sound = fileURL
33
34@@ -111,12 +110,20 @@
35 }
36 }
37 }
38+ }
39
40- else {
41- checked = !checked
42+ onClicked: {
43+ if (!checked) {
44+ checked = true
45 }
46 }
47 }
48+
49+ onClicked: {
50+ if (!_soundStatus.checked) {
51+ _soundStatus.checked = true
52+ }
53+ }
54 }
55 }
56 }
57
58=== modified file 'debian/changelog'
59--- debian/changelog 2015-03-05 12:57:41 +0000
60+++ debian/changelog 2015-03-06 01:09:34 +0000
61@@ -19,6 +19,10 @@
62 * Fixed one-time alarms not being able to be re-enabled using the alarm switch
63 after they have gone off once (LP: #1413027)
64
65+ [Victor Thompson]
66+ * Fixed a regression in vivid where clicking an alarm sound ListItem was not
67+ causing the CheckBox to be checked.
68+
69 -- Nekhelesh Ramananthan <krnekhelesh@gmail.com> Wed, 21 Jan 2015 21:05:24 +0100
70
71 ubuntu-clock-app (3.2) utopic; urgency=medium

Subscribers

People subscribed via source and target branches