Merge lp:~nik90/ubuntu-clock-app/alarm-sounds into lp:ubuntu-clock-app/saucy

Proposed by Nekhelesh Ramananthan
Status: Rejected
Rejected by: Nekhelesh Ramananthan
Proposed branch: lp:~nik90/ubuntu-clock-app/alarm-sounds
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 76 lines (+43/-1)
1 file modified
alarm/AddAlarmPage.qml (+43/-1)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/alarm-sounds
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Disapprove
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+220687@code.launchpad.net

Commit message

Added support to change alarm sounds from the UI

Description of the change

Adds the ability to change the alarm sounds from the Add Alarm dialog

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: Needs Fixing (continuous-integration)
411. By Nekhelesh Ramananthan

merge trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

#blocked on indicator-datetime

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

#blocked on pending work in indicator-datetime

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

#unblocked

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

As this is unblocked does that mean it's ready to land?

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

#blocked due to upstream bug in the SDK which does not show the chosen alarm sound when editing an alarm. https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338697

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

#unblocked I am rejecting this branch since it requires further rework before getting it to work with the old clock app. However all my attention is now directed at the clock reboot where this bug will be fixed.

review: Disapprove

Unmerged revisions

411. By Nekhelesh Ramananthan

merge trunk

410. By Nekhelesh Ramananthan

Added ability to choose alarm sounds

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'alarm/AddAlarmPage.qml'
--- alarm/AddAlarmPage.qml 2014-05-22 15:45:45 +0000
+++ alarm/AddAlarmPage.qml 2014-05-22 20:29:40 +0000
@@ -19,8 +19,8 @@
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Layouts 0.120import Ubuntu.Layouts 0.1
21import Ubuntu.Components 0.121import Ubuntu.Components 0.1
22import Qt.labs.folderlistmodel 2.1
22import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 0.1
23import Ubuntu.Components.Themes.Ambiance 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
25import "../common/ClockUtils.js" as Utils25import "../common/ClockUtils.js" as Utils
26import "../common"26import "../common"
@@ -166,6 +166,7 @@
166 alarm.daysOfWeek = temp_alarm.daysOfWeek166 alarm.daysOfWeek = temp_alarm.daysOfWeek
167 alarm.enabled = temp_alarm.enabled167 alarm.enabled = temp_alarm.enabled
168 alarm.date = temp_alarm.date168 alarm.date = temp_alarm.date
169 alarm.sound = temp_alarm.sound
169170
170 // Determining if the alarm read is set to trigger in the morning or evening171 // Determining if the alarm read is set to trigger in the morning or evening
171 isPm = Qt.formatTime(alarm.date, "AP") === "PM"172 isPm = Qt.formatTime(alarm.date, "AP") === "PM"
@@ -185,6 +186,7 @@
185 temp_alarm.type = alarm.type186 temp_alarm.type = alarm.type
186 temp_alarm.daysOfWeek = alarm.daysOfWeek187 temp_alarm.daysOfWeek = alarm.daysOfWeek
187 temp_alarm.date = alarmTime188 temp_alarm.date = alarmTime
189 temp_alarm.sound = alarm.sound
188 temp_alarm.save()190 temp_alarm.save()
189191
190 if(validateAlarm(temp_alarm))192 if(validateAlarm(temp_alarm))
@@ -652,6 +654,46 @@
652 return occurs;654 return occurs;
653 }655 }
654 }656 }
657
658 OptionSelector {
659 id: soundSelector
660 objectName: "soundSelector"
661 text: i18n.tr("Ringtone")
662 containerHeight: itemHeight * 7
663
664 // Function to retrieve the alarm sound index after comparing the sound filenames
665 function getSoundIndex(chosenSoundPath) {
666 console.log(folderModel.count + "|" + chosenSoundPath)
667 for(var i=0; i<folderModel.count; i++) {
668 // Goes through every sound file in the folder and compares their file path with
669 // the alarm sound path returned by the Alarm Model
670 if(chosenSoundPath === folderModel.get(i, "filePath"))
671 return i
672 }
673 // If no matching alarm sound is found, return the first on the list to avoid invalid results
674 return 0
675 }
676
677 onSelectedIndexChanged: alarm.sound = folderModel.get(selectedIndex, "filePath")
678
679 FolderListModel {
680 id: folderModel
681 folder: "/usr/share/sounds/ubuntu/ringtones"
682 onCountChanged: {
683 if(count > 0 && !isNewAlarm) {
684 soundSelector.selectedIndex = soundSelector.getSoundIndex(alarm.sound)
685 }
686 }
687 }
688
689 Component {
690 id: fileDelegate
691 OptionSelectorDelegate { text: fileBaseName }
692 }
693
694 model: folderModel
695 delegate: fileDelegate
696 }
655 }697 }
656 }698 }
657 }699 }

Subscribers

People subscribed via source and target branches