Merge lp:~ahayzen/music-app/remix-seeking-workaround into lp:music-app/trusty

Proposed by Andrew Hayzen
Status: Superseded
Proposed branch: lp:~ahayzen/music-app/remix-seeking-workaround
Merge into: lp:music-app/trusty
Diff against target: 4396 lines (+1479/-1622) (has conflicts)
24 files modified
MusicAlbums.qml (+21/-123)
MusicArtists.qml (+3/-2)
MusicNowPlaying.qml (+333/-26)
MusicPlaylists.qml (+3/-2)
MusicSettings.qml (+0/-11)
MusicToolbar.qml (+169/-951)
MusicTracks.qml (+3/-2)
MusicaddtoPlaylist.qml (+0/-1)
Player.qml (+5/-1)
Style.qml (+2/-2)
com.ubuntu.music_music.desktop.in.in (+3/-0)
common/AlbumsPage.qml (+0/-2)
common/BlurredBackground.qml (+11/-9)
common/Card.qml (+157/-0)
common/CardView.qml (+41/-0)
common/ColumnFlow.qml (+159/-0)
common/MusicPage.qml (+4/-0)
common/MusicRow.qml (+7/-4)
common/SongsPage.qml (+142/-119)
music-app.qml (+16/-27)
po/com.ubuntu.music.pot (+69/-59)
po/pt_BR.po (+172/-154)
tests/autopilot/music_app/__init__.py (+99/-81)
tests/autopilot/music_app/tests/test_music.py (+60/-46)
Text conflict in po/pt_BR.po
To merge this branch: bzr merge lp:~ahayzen/music-app/remix-seeking-workaround
Reviewer Review Type Date Requested Status
Music App Developers Pending
Review via email: mp+237668@code.launchpad.net

Commit message

* Ignore first value back after seeking [Workaround]

Description of the change

* Ignore first value back after seeking [Workaround]

Until it is fixed in media-hub ignore the first value back so the progress bar doesn't jump to 0 and then to the real position. Note this is a *workaround*.

To post a comment you must log in.
657. By Andrew Hayzen

* Fix for label not updating while seeking
* Add code comments

Unmerged revisions

657. By Andrew Hayzen

* Fix for label not updating while seeking
* Add code comments

656. By Andrew Hayzen

* Ignore first value back after seeking [Workaround]

655. By Andrew Hayzen

* Remove legacy toolbar code
* Make full (non listview) now playing default
* Fix header disappearing in full now playing.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

654. By Victor Thompson

* Use model.art property in AlbumsPage. Fixes: https://bugs.launchpad.net/bugs/1378157.

Approved by Andrew Hayzen, Ubuntu Phone Apps Jenkins Bot.

653. By Andrew Hayzen

* Add CardView and Card
* Implement in Albums tab.

Approved by Victor Thompson, Ubuntu Phone Apps Jenkins Bot.

652. By Victor Thompson

* Make the Ubuntu Slider leftColor UbuntuColors.blue.

Approved by Andrew Hayzen, Ubuntu Phone Apps Jenkins Bot.

651. By Victor Thompson

* Fix elide in Songs Page header
* Fix elide in MusicRow for Songs Page items.

Approved by Andrew Hayzen, Ubuntu Phone Apps Jenkins Bot.

650. By Victor Thompson

Used new desktop entries to show a fake application page during the startup. Fixes: https://bugs.launchpad.net/bugs/1377638.

Approved by Andrew Hayzen, Ubuntu Phone Apps Jenkins Bot.

649. By Launchpad Translations on behalf of music-app-dev

Launchpad automatic translations update.

648. By Victor Thompson

Initial Now Playing toggle.

Approved by Ubuntu Phone Apps Jenkins Bot, Andrew Hayzen.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicAlbums.qml'
2--- MusicAlbums.qml 2014-09-20 15:41:33 +0000
3+++ MusicAlbums.qml 2014-10-08 18:55:11 +0000
4@@ -19,37 +19,17 @@
5
6 import QtQuick 2.3
7 import Ubuntu.Components 1.1
8-import Ubuntu.Components.Popups 1.0
9 import Ubuntu.MediaScanner 0.1
10-import Ubuntu.Thumbnailer 0.1
11-import QtMultimedia 5.0
12-import QtQuick.LocalStorage 2.0
13-import QtGraphicalEffects 1.0
14-import "settings.js" as Settings
15-import "playlists.js" as Playlists
16 import "common"
17
18+
19 MusicPage {
20- id: mainpage
21+ id: albumsPage
22 objectName: "albumsPage"
23 title: i18n.tr("Albums")
24
25- // TODO: This ListView is empty and causes the header to get painted with the desired background color because the
26- // page is now vertically flickable.
27- ListView {
28- anchors.fill: parent
29- anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
30- }
31-
32- GridView {
33- id: albumlist
34- anchors.fill: parent
35- anchors.leftMargin: units.gu(1)
36- anchors.top: parent.top
37- anchors.topMargin: mainView.header.height + units.gu(1)
38- anchors.bottomMargin: units.gu(1)
39- cellHeight: height/3
40- cellWidth: height/3
41+ CardView {
42+ id: albumCardView
43 model: SortFilterModel {
44 id: albumsModelFilter
45 property alias rowCount: albumsModel.rowCount
46@@ -60,106 +40,24 @@
47 sort.property: "title"
48 sort.order: Qt.AscendingOrder
49 }
50-
51- delegate: albumDelegate
52- flow: GridView.TopToBottom
53-
54- Component {
55- id: albumDelegate
56- Item {
57- property string artist: model.artist
58- property string album: model.title
59- property var covers: [{art: model.art}]
60-
61- id: albumItem
62- height: albumlist.cellHeight - units.gu(1)
63- objectName: "albumsPageGridItem" + index
64- width: albumlist.cellHeight - units.gu(1)
65- anchors.margins: units.gu(1)
66-
67- CoverRow {
68- id: albumShape
69- anchors {
70- top: parent.top
71- left: parent.left
72- verticalCenter: parent.verticalCenter
73- }
74- count: albumItem.covers.length
75- size: albumItem.width
76- covers: albumItem.covers
77- spacing: units.gu(2)
78- }
79- Item { // Background so can see text in current state
80- id: albumBg
81- anchors {
82- bottom: parent.bottom
83- left: parent.left
84- right: parent.right
85- }
86- height: units.gu(6)
87- clip: true
88- UbuntuShape{
89- anchors {
90- bottom: parent.bottom
91- left: parent.left
92- right: parent.right
93- }
94- height: albumShape.height
95- radius: "medium"
96- color: styleMusic.common.black
97- opacity: 0.6
98- }
99- }
100- Label {
101- id: albumArtist
102- objectName: "albums-albumartist"
103- anchors.bottom: parent.bottom
104- anchors.bottomMargin: units.gu(1)
105- anchors.left: parent.left
106- anchors.leftMargin: units.gu(1)
107- anchors.right: parent.right
108- anchors.rightMargin: units.gu(1)
109- color: styleMusic.common.white
110- elide: Text.ElideRight
111- text: model.artist
112- fontSize: "x-small"
113- }
114- Label {
115- id: albumLabel
116- anchors.bottom: parent.bottom
117- anchors.bottomMargin: units.gu(3)
118- anchors.left: parent.left
119- anchors.leftMargin: units.gu(1)
120- anchors.right: parent.right
121- anchors.rightMargin: units.gu(1)
122- color: styleMusic.common.white
123- elide: Text.ElideRight
124- text: model.title
125- fontSize: "small"
126- font.weight: Font.DemiBold
127- }
128-
129-
130- MouseArea {
131- anchors.fill: parent
132- onClicked: {
133- songsPage.album = model.title;
134- songsPage.covers = [{art: model.art}]
135- songsPage.genre = undefined
136- songsPage.isAlbum = true
137- songsPage.line1 = model.artist
138- songsPage.line2 = model.title
139- songsPage.title = i18n.tr("Album")
140-
141- mainPageStack.push(songsPage)
142- }
143-
144- // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well.
145- onPressedChanged: albumShape.pressed = pressed
146- }
147+ delegate: Card {
148+ id: albumCard
149+ imageSource: model.art
150+ objectName: "albumsPageGridItem" + index
151+ primaryText: model.title
152+ secondaryText: model.artist
153+
154+ onClicked: {
155+ songsPage.album = model.title;
156+ songsPage.covers = [{art: model.art}]
157+ songsPage.genre = undefined
158+ songsPage.isAlbum = true
159+ songsPage.line1 = model.artist
160+ songsPage.line2 = model.title
161+ songsPage.title = i18n.tr("Album")
162+
163+ mainPageStack.push(songsPage)
164 }
165 }
166 }
167 }
168-
169-
170
171=== modified file 'MusicArtists.qml'
172--- MusicArtists.qml 2014-09-20 15:41:33 +0000
173+++ MusicArtists.qml 2014-10-08 18:55:11 +0000
174@@ -38,8 +38,9 @@
175
176 ListView {
177 id: artistlist
178- anchors.fill: parent
179- anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
180+ anchors {
181+ fill: parent
182+ }
183 model: ArtistsModel {
184 id: artistsModel
185 albumArtists: true
186
187=== modified file 'MusicNowPlaying.qml'
188--- MusicNowPlaying.qml 2014-09-20 15:41:33 +0000
189+++ MusicNowPlaying.qml 2014-10-08 18:55:11 +0000
190@@ -17,7 +17,6 @@
191 * along with this program. If not, see <http://www.gnu.org/licenses/>.
192 */
193
194-
195 import QtMultimedia 5.0
196 import QtQuick 2.3
197 import QtQuick.LocalStorage 2.0
198@@ -29,23 +28,42 @@
199
200 MusicPage {
201 id: nowPlaying
202+ flickable: isListView ? queuelist : null // Ensures that the header is shown in fullview
203 objectName: "nowPlayingPage"
204 title: i18n.tr("Now Playing")
205 visible: false
206+ onVisibleChanged: {
207+ if (!visible) {
208+ // Reset the isListView property
209+ isListView = false
210+ }
211+ }
212
213 property int ensureVisibleIndex: 0 // ensure first index is visible at startup
214-
215- Rectangle {
216- anchors.fill: parent
217- color: styleMusic.nowPlaying.backgroundColor
218- opacity: 0.75 // change later
219- MouseArea { // Block events to lower layers
220- anchors.fill: parent
221+ property bool isListView: false
222+
223+ head.backAction: Action {
224+ iconName: "back";
225+ objectName: "backButton"
226+ onTriggered: {
227+ mainPageStack.pop();
228+
229+ while (mainPageStack.depth > 1) { // jump back to the tab layer if via SongsPage
230+ mainPageStack.pop();
231+ }
232 }
233 }
234
235- Component.onCompleted: {
236- onToolbarShownChanged.connect(jumpToCurrent)
237+ head {
238+ actions: [
239+ Action {
240+ objectName: "toggleView"
241+ iconName: "media-playlist"
242+ onTriggered: {
243+ isListView = !isListView
244+ }
245+ }
246+ ]
247 }
248
249 Connections {
250@@ -59,9 +77,10 @@
251
252 customdebug("MusicQueue update currentIndex: " + player.source);
253
254- // Always jump to current track
255- nowPlaying.jumpToCurrent(musicToolbar.opened, nowPlaying, musicToolbar.currentTab)
256-
257+ // TODO: Never jump to track? Or only jump to track in queue view?
258+ if (isListView) {
259+ nowPlaying.jumpToCurrent(musicToolbar.opened, nowPlaying, musicToolbar.currentTab)
260+ }
261 }
262 }
263
264@@ -77,17 +96,311 @@
265
266 function positionAt(index) {
267 queuelist.positionViewAtIndex(index, ListView.Beginning);
268- queuelist.contentY -= header.height;
269+ }
270+
271+ Rectangle {
272+ id: fullview
273+ anchors.fill: parent
274+ color: "transparent"
275+ visible: !isListView
276+
277+ BlurredBackground {
278+ id: blurredBackground
279+ anchors.top: parent.top
280+ anchors.topMargin: mainView.header.height
281+ height: units.gu(27)
282+ art: albumImage.source
283+
284+ Image {
285+ id: albumImage
286+ anchors.centerIn: parent
287+ width: units.gu(18)
288+ height: width
289+ smooth: true
290+ source: player.currentMetaArt === "" ?
291+ decodeURIComponent("image://albumart/artist=" +
292+ player.currentMetaArtist +
293+ "&album=" + player.currentMetaAlbum)
294+ : player.currentMetaArt
295+ }
296+ }
297+
298+ /* Full toolbar */
299+ Item {
300+ id: musicToolbarFullContainer
301+ anchors.top: blurredBackground.bottom
302+ anchors.topMargin: units.gu(4)
303+ width: blurredBackground.width
304+
305+ /* Column for labels in wideAspect */
306+ Column {
307+ id: nowPlayingWideAspectLabels
308+ spacing: units.gu(1)
309+ anchors {
310+ left: parent.left
311+ leftMargin: units.gu(2)
312+ right: parent.right
313+ rightMargin: units.gu(2)
314+ }
315+
316+ /* Title of track */
317+ Label {
318+ id: nowPlayingWideAspectTitle
319+ anchors {
320+ left: parent.left
321+ leftMargin: units.gu(1)
322+ right: parent.right
323+ rightMargin: units.gu(1)
324+ }
325+ color: styleMusic.playerControls.labelColor
326+ elide: Text.ElideRight
327+ fontSize: "x-large"
328+ objectName: "playercontroltitle"
329+ text: trackQueue.model.count === 0 ? "" : player.currentMetaTitle === "" ? player.currentMetaFile : player.currentMetaTitle
330+ }
331+
332+ /* Artist of track */
333+ Label {
334+ id: nowPlayingWideAspectArtist
335+ anchors {
336+ left: parent.left
337+ leftMargin: units.gu(1)
338+ right: parent.right
339+ rightMargin: units.gu(1)
340+ }
341+ color: styleMusic.nowPlaying.labelSecondaryColor
342+ elide: Text.ElideRight
343+ fontSize: "small"
344+ text: trackQueue.model.count === 0 ? "" : player.currentMetaArtist
345+ }
346+ }
347+
348+ /* Progress bar component */
349+ MouseArea {
350+ id: musicToolbarFullProgressContainer
351+ anchors.left: parent.left
352+ anchors.leftMargin: units.gu(3)
353+ anchors.right: parent.right
354+ anchors.rightMargin: units.gu(3)
355+ anchors.top: nowPlayingWideAspectLabels.bottom
356+ anchors.topMargin: units.gu(3)
357+ height: units.gu(3)
358+ width: parent.width
359+
360+ /* Position label */
361+ Label {
362+ id: musicToolbarFullPositionLabel
363+ anchors.top: progressSliderMusic.bottom
364+ anchors.topMargin: units.gu(-2)
365+ anchors.left: parent.left
366+ color: styleMusic.nowPlaying.labelSecondaryColor
367+ fontSize: "small"
368+ height: parent.height
369+ horizontalAlignment: Text.AlignHCenter
370+ text: durationToString(player.position)
371+ verticalAlignment: Text.AlignVCenter
372+ width: units.gu(3)
373+ }
374+
375+ Slider {
376+ id: progressSliderMusic
377+ anchors.left: parent.left
378+ anchors.right: parent.right
379+ objectName: "progressSliderShape"
380+ function formatValue(v) { return durationToString(v) }
381+
382+ property bool seeking: false
383+ property bool seeked: false
384+
385+ onSeekingChanged: {
386+ if (seeking === false) {
387+ musicToolbarFullPositionLabel.text = durationToString(player.position)
388+ }
389+ }
390+
391+ Component.onCompleted: {
392+ Theme.palette.selected.foreground = UbuntuColors.blue
393+ }
394+
395+ onPressedChanged: {
396+ seeking = pressed
397+ if (!pressed) {
398+ seeked = true
399+ player.seek(value)
400+ }
401+ }
402+
403+ Connections {
404+ target: player
405+ onDurationChanged: {
406+ musicToolbarFullDurationLabel.text = durationToString(player.duration)
407+ progressSliderMusic.maximumValue = player.duration
408+ }
409+ onPositionChanged: {
410+ if (progressSliderMusic.seeking === false && !progressSliderMusic.seeked) {
411+ progressSliderMusic.value = player.position
412+ musicToolbarFullPositionLabel.text = durationToString(player.position)
413+ musicToolbarFullDurationLabel.text = durationToString(player.duration)
414+ }
415+
416+ progressSliderMusic.seeked = false;
417+ }
418+ onStopped: {
419+ musicToolbarFullPositionLabel.text = durationToString(0);
420+ musicToolbarFullDurationLabel.text = durationToString(0);
421+ }
422+ }
423+ }
424+
425+ /* Duration label */
426+ Label {
427+ id: musicToolbarFullDurationLabel
428+ anchors.top: progressSliderMusic.bottom
429+ anchors.topMargin: units.gu(-2)
430+ anchors.right: parent.right
431+ color: styleMusic.nowPlaying.labelSecondaryColor
432+ fontSize: "small"
433+ height: parent.height
434+ horizontalAlignment: Text.AlignHCenter
435+ text: durationToString(player.duration)
436+ verticalAlignment: Text.AlignVCenter
437+ width: units.gu(3)
438+ }
439+ }
440+
441+ /* Repeat button */
442+ MouseArea {
443+ id: nowPlayingRepeatButton
444+ anchors.right: nowPlayingPreviousButton.left
445+ anchors.rightMargin: units.gu(1)
446+ anchors.verticalCenter: nowPlayingPlayButton.verticalCenter
447+ height: units.gu(6)
448+ opacity: player.repeat && !emptyPage.noMusic ? 1 : .4
449+ width: height
450+ onClicked: player.repeat = !player.repeat
451+
452+ Icon {
453+ id: repeatIcon
454+ height: units.gu(3)
455+ width: height
456+ anchors.verticalCenter: parent.verticalCenter
457+ anchors.horizontalCenter: parent.horizontalCenter
458+ color: "white"
459+ name: "media-playlist-repeat"
460+ objectName: "repeatShape"
461+ opacity: player.repeat && !emptyPage.noMusic ? 1 : .4
462+ }
463+ }
464+
465+ /* Previous button */
466+ MouseArea {
467+ id: nowPlayingPreviousButton
468+ anchors.right: nowPlayingPlayButton.left
469+ anchors.rightMargin: units.gu(1)
470+ anchors.verticalCenter: nowPlayingPlayButton.verticalCenter
471+ height: units.gu(6)
472+ opacity: trackQueue.model.count === 0 ? .4 : 1
473+ width: height
474+ onClicked: player.previousSong()
475+
476+ Icon {
477+ id: nowPlayingPreviousIndicator
478+ height: units.gu(3)
479+ width: height
480+ anchors.verticalCenter: parent.verticalCenter
481+ anchors.horizontalCenter: parent.horizontalCenter
482+ color: "white"
483+ name: "media-skip-backward"
484+ objectName: "previousShape"
485+ opacity: 1
486+ }
487+ }
488+
489+ /* Play/Pause button */
490+ MouseArea {
491+ id: nowPlayingPlayButton
492+ anchors.horizontalCenter: parent.horizontalCenter
493+ anchors.top: musicToolbarFullProgressContainer.bottom
494+ anchors.topMargin: units.gu(2)
495+ height: units.gu(12)
496+ width: height
497+ onClicked: player.toggle()
498+
499+ Icon {
500+ id: nowPlayingPlayIndicator
501+ height: units.gu(6)
502+ width: height
503+ anchors.verticalCenter: parent.verticalCenter
504+ anchors.horizontalCenter: parent.horizontalCenter
505+ opacity: emptyPage.noMusic ? .4 : 1
506+ color: "white"
507+ name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start"
508+ objectName: "playShape"
509+ }
510+ }
511+
512+ /* Next button */
513+ MouseArea {
514+ id: nowPlayingNextButton
515+ anchors.left: nowPlayingPlayButton.right
516+ anchors.leftMargin: units.gu(1)
517+ anchors.verticalCenter: nowPlayingPlayButton.verticalCenter
518+ height: units.gu(6)
519+ opacity: trackQueue.model.count === 0 ? .4 : 1
520+ width: height
521+ onClicked: player.nextSong()
522+
523+ Icon {
524+ id: nowPlayingNextIndicator
525+ height: units.gu(3)
526+ width: height
527+ anchors.verticalCenter: parent.verticalCenter
528+ anchors.horizontalCenter: parent.horizontalCenter
529+ color: "white"
530+ name: "media-skip-forward"
531+ objectName: "forwardShape"
532+ opacity: 1
533+ }
534+ }
535+
536+ /* Shuffle button */
537+ MouseArea {
538+ id: nowPlayingShuffleButton
539+ anchors.left: nowPlayingNextButton.right
540+ anchors.leftMargin: units.gu(1)
541+ anchors.verticalCenter: nowPlayingPlayButton.verticalCenter
542+ height: units.gu(6)
543+ opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4
544+ width: height
545+ onClicked: player.shuffle = !player.shuffle
546+
547+ Icon {
548+ id: shuffleIcon
549+ height: units.gu(3)
550+ width: height
551+ anchors.verticalCenter: parent.verticalCenter
552+ anchors.horizontalCenter: parent.horizontalCenter
553+ color: "white"
554+ name: "media-playlist-shuffle"
555+ objectName: "shuffleShape"
556+ opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4
557+ }
558+ }
559+ }
560 }
561
562 ListView {
563 id: queuelist
564- objectName: "nowPlayingQueueList"
565- anchors.fill: parent
566- anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
567+ anchors {
568+ fill: parent
569+ }
570 delegate: queueDelegate
571+ footer: Item {
572+ height: mainView.height - (styleMusic.common.expandHeight + queuelist.currentHeight) + units.gu(8)
573+ }
574+ highlightFollowsCurrentItem: false
575 model: trackQueue.model
576- highlightFollowsCurrentItem: false
577+ objectName: "nowPlayingQueueList"
578 state: "normal"
579 states: [
580 State {
581@@ -105,9 +418,7 @@
582 }
583 }
584 ]
585- footer: Item {
586- height: mainView.height - (styleMusic.common.expandHeight + queuelist.currentHeight) + units.gu(8)
587- }
588+ visible: isListView
589
590 property int normalHeight: units.gu(12)
591 property int currentHeight: units.gu(40)
592@@ -117,10 +428,6 @@
593 customdebug("Queue: Now has: " + queuelist.count + " tracks")
594 }
595
596- onMovementStarted: {
597- musicToolbar.hideToolbar();
598- }
599-
600 Component {
601 id: queueDelegate
602 ListItemWithActions {
603@@ -218,7 +525,7 @@
604 ? queuelist.currentHeight
605 : mainView.width - (trackImage.anchors.leftMargin * 2))
606 : queuelist.normalHeight) - units.gu(2)
607- covers: [{art: model.art}]
608+ covers: [{art: model.art, album: model.album, author: model.author}]
609
610 spacing: units.gu(2)
611
612
613=== modified file 'MusicPlaylists.qml'
614--- MusicPlaylists.qml 2014-09-20 10:50:45 +0000
615+++ MusicPlaylists.qml 2014-10-08 18:55:11 +0000
616@@ -116,8 +116,9 @@
617 ListView {
618 id: playlistslist
619 objectName: "playlistsListView"
620- anchors.fill: parent
621- anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
622+ anchors {
623+ fill: parent
624+ }
625 model: playlistModel.model
626 delegate: playlistDelegate
627 onCountChanged: {
628
629=== modified file 'MusicSettings.qml'
630--- MusicSettings.qml 2014-09-20 10:50:45 +0000
631+++ MusicSettings.qml 2014-10-08 18:55:11 +0000
632@@ -30,17 +30,6 @@
633 title: i18n.tr("Settings")
634 contentsHeight: parent.height;
635
636- onVisibleChanged: {
637- if (visible === true)
638- {
639- musicToolbar.disableToolbar()
640- }
641- else
642- {
643- musicToolbar.enableToolbar()
644- }
645- }
646-
647 onCancelClicked: PopupUtils.close(musicSettings)
648 onConfirmClicked: {
649 PopupUtils.close(musicSettings)
650
651=== modified file 'MusicToolbar.qml'
652--- MusicToolbar.qml 2014-09-23 20:45:41 +0000
653+++ MusicToolbar.qml 2014-10-08 18:55:11 +0000
654@@ -35,59 +35,13 @@
655 property var currentPage: null
656 property var currentSheet: []
657 property var currentTab: null
658- property var previousPage: null
659
660 // Properties and signals for the toolbar
661- property var cachedStates: []
662- property bool shown: false
663- property int transitionDuration: 100
664-
665 property alias currentHeight: musicToolbarPanel.height
666- property alias minimizedHeight: musicToolbarPanel.minimizedHeight
667- property alias expandedHeight: musicToolbarPanel.expandedHeight
668- property alias fullHeight: musicToolbarPanel.fullHeight
669- property alias mouseAreaOffset: musicToolbarPanel.hintSize
670-
671- property alias animating: musicToolbarPanel.animating
672 property alias opened: musicToolbarPanel.opened
673
674- // Alias for autopilot
675- property alias currentMode: musicToolbarPanel.currentMode
676-
677- Connections {
678- id: pageStackConn
679- target: mainPageStack
680-
681- onCurrentPageChanged: {
682- previousPage = currentPage;
683-
684- // If going back from nowPlaying jump back to tabs
685- if (previousPage === nowPlaying && mainPageStack.currentPage !== nowPlaying) {
686- while (mainPageStack.depth > 1) {
687- mainPageStack.pop(mainPageStack.currentPage)
688- }
689- }
690- }
691- }
692-
693 /* Helper functions */
694
695- // Disable the toolbar for this page/view (eg a dialog)
696- function disableToolbar()
697- {
698- cachedStates.push(state);
699- musicToolbarPanel.state = "hidden";
700- }
701-
702- // Enable the toolbar (run when closing a page that disabled it)
703- function enableToolbar()
704- {
705- if (cachedStates.length > 0)
706- {
707- musicToolbarPanel.state = cachedStates.pop();
708- }
709- }
710-
711 // Back button has been pressed, jump up pageStack or back to parent page
712 function goBack()
713 {
714@@ -98,18 +52,6 @@
715 else if (mainPageStack !== null && mainPageStack.depth > 1) {
716 mainPageStack.pop(currentPage)
717 }
718-
719- startAutohideTimer()
720- }
721-
722- // Hide the toolbar
723- function hideToolbar()
724- {
725- if (!wideAspect) {
726- musicToolbarPanel.close();
727- }
728-
729- toolbarAutoHideTimer.stop(); // cancel any autohide
730 }
731
732 // Remove sheet as it has been closed
733@@ -126,8 +68,6 @@
734 function setPage(childPage)
735 {
736 currentPage = childPage;
737- // note: If pageStack tracking is needed readd here
738- //currentPageStack = pageStack === undefined ? null : pageStack;
739 }
740
741 // Set the current sheet (overrides page)
742@@ -135,32 +75,6 @@
743 currentSheet.push(sheet)
744 }
745
746- // Show the toolbar
747- function showToolbar()
748- {
749- startAutohideTimer(); // always attempt to autohide toolbar
750-
751- if (!musicToolbarPanel.opened) {
752- musicToolbarPanel.open();
753- }
754- }
755-
756- // Start the autohidetimer
757- function startAutohideTimer()
758- {
759- toolbarAutoHideTimer.restart();
760- }
761-
762- Connections {
763- target: mainView
764- onWideAspectChanged: {
765- // Force toolbar to show if in wideAspect
766- if (wideAspect && !opened) {
767- showToolbar();
768- }
769- }
770- }
771-
772 Panel {
773 id: musicToolbarPanel
774 anchors {
775@@ -168,543 +82,9 @@
776 right: parent.right
777 bottom: parent.bottom
778 }
779- height: currentMode === "full" ? fullHeight : expandedHeight
780- locked: wideAspect
781-
782- __closeOnContentsClicks: false // TODO: fix bug 1295720
783-
784- // The current mode of the controls
785- property string currentMode: wideAspect || (currentPage === nowPlaying)
786- ? "full" : "expanded"
787-
788- // Properties for the different heights
789- property int minimizedHeight: units.gu(0.5)
790- property int expandedHeight: units.gu(8)
791- property int fullHeight: units.gu(11)
792-
793- onCurrentModeChanged: {
794- musicToolbarFullProgressMouseArea.enabled = currentMode === "full"
795- }
796-
797- onOpenedChanged: {
798- onToolbarShownChanged(opened, currentPage, currentTab);
799-
800- if (opened) {
801- startAutohideTimer();
802- }
803- }
804-
805- /* Full toolbar */
806- Rectangle {
807- id: musicToolbarFullContainer
808- anchors {
809- fill: parent
810- }
811- color: styleMusic.toolbar.fullBackgroundColor
812- visible: musicToolbarPanel.currentMode === "full"
813-
814- /* Buttons component */
815- Rectangle {
816- id: musicToolbarFullButtonsContainer
817- anchors.left: parent.left
818- anchors.top: musicToolbarFullProgressContainer.bottom
819- color: "transparent"
820- height: parent.height - musicToolbarFullProgressContainer.height
821- width: parent.width
822-
823- /* Column for labels in wideAspect */
824- Column {
825- id: nowPlayingWideAspectLabels
826- anchors {
827- left: parent.left
828- leftMargin: units.gu(1)
829- right: nowPlayingRepeatButton.left
830- rightMargin: units.gu(1)
831- verticalCenter: parent.verticalCenter
832- }
833- visible: wideAspect
834-
835- /* Clicking in the area shows the queue */
836- function trigger() {
837- if (trackQueue.model.count !== 0 && currentPage !== nowPlaying) {
838- tabs.pushNowPlaying();
839- }
840- else if (currentPage === nowPlaying) {
841- musicToolbar.goBack();
842- }
843- }
844-
845- /* Title of track */
846- Label {
847- id: nowPlayingWideAspectTitle
848- anchors {
849- left: parent.left
850- leftMargin: units.gu(1)
851- right: parent.right
852- rightMargin: units.gu(1)
853- }
854- color: styleMusic.playerControls.labelColor
855- elide: Text.ElideRight
856- fontSize: "medium"
857- objectName: "playercontroltitle"
858- text: trackQueue.model.count === 0 ? "" : player.currentMetaTitle === "" ? player.currentMetaFile : player.currentMetaTitle
859- }
860-
861- /* Artist of track */
862- Label {
863- id: nowPlayingWideAspectArtist
864- anchors {
865- left: parent.left
866- leftMargin: units.gu(1)
867- right: parent.right
868- rightMargin: units.gu(1)
869- }
870- color: styleMusic.playerControls.labelColor
871- elide: Text.ElideRight
872- fontSize: "small"
873- text: trackQueue.model.count === 0 ? "" : player.currentMetaArtist
874- }
875-
876- /* Album of track */
877- Label {
878- id: nowPlayingWideAspectAlbum
879- anchors {
880- left: parent.left
881- leftMargin: units.gu(1)
882- right: parent.right
883- rightMargin: units.gu(1)
884- }
885- color: styleMusic.playerControls.labelColor
886- elide: Text.ElideRight
887- fontSize: "small"
888- text: trackQueue.model.count === 0 ? "" : player.currentMetaAlbum
889- }
890- }
891-
892- /* Repeat button */
893- Item {
894- id: nowPlayingRepeatButton
895- objectName: "repeatShape"
896- anchors.right: nowPlayingPreviousButton.left
897- anchors.rightMargin: units.gu(1)
898- anchors.verticalCenter: parent.verticalCenter
899- height: units.gu(6)
900- opacity: player.repeat && !emptyPage.noMusic ? 1 : .4
901- width: height
902-
903- function trigger() {
904- if (emptyPage.noMusic) {
905- return;
906- }
907-
908- // Invert repeat settings
909- player.repeat = !player.repeat
910- }
911-
912- Image {
913- id: repeatIcon
914- height: units.gu(3)
915- width: height
916- anchors.verticalCenter: parent.verticalCenter
917- anchors.horizontalCenter: parent.horizontalCenter
918- source: Qt.resolvedUrl("images/media-playlist-repeat.svg")
919- verticalAlignment: Text.AlignVCenter
920- opacity: player.repeat && !emptyPage.noMusic ? 1 : .4
921- }
922- }
923-
924- /* Previous button */
925- Item {
926- id: nowPlayingPreviousButton
927- anchors.right: nowPlayingPlayButton.left
928- anchors.rightMargin: units.gu(1)
929- anchors.verticalCenter: parent.verticalCenter
930- height: units.gu(6)
931- objectName: "previousShape"
932- opacity: trackQueue.model.count === 0 ? .4 : 1
933- width: height
934-
935- function trigger() {
936- if (trackQueue.model.count === 0) {
937- return;
938- }
939-
940- player.previousSong()
941- }
942-
943- Image {
944- id: nowPlayingPreviousIndicator
945- height: units.gu(3)
946- width: height
947- anchors.horizontalCenter: parent.horizontalCenter
948- anchors.verticalCenter: parent.verticalCenter
949- source: Qt.resolvedUrl("images/media-skip-backward.svg")
950- opacity: 1
951- }
952- }
953-
954- /* Play/Pause button */
955- Rectangle {
956- id: nowPlayingPlayButton
957- anchors.horizontalCenter: parent.horizontalCenter
958- anchors.verticalCenter: parent.verticalCenter
959- antialiasing: true
960- color: styleMusic.toolbar.fullOuterPlayCircleColor
961- height: units.gu(12)
962- radius: height / 2
963- width: height
964-
965- // draws the outter shadow/highlight
966- Rectangle {
967- id: sourceOutterFull
968- anchors { fill: parent; margins: -units.gu(0.1) }
969- radius: (width / 2)
970- antialiasing: true
971- gradient: Gradient {
972- GradientStop { position: 0.0; color: "black" }
973- GradientStop { position: 0.5; color: "transparent" }
974- GradientStop { position: 1.0; color: UbuntuColors.warmGrey }
975- }
976-
977- Rectangle {
978- anchors.horizontalCenter: parent.horizontalCenter
979- anchors.verticalCenter: parent.verticalCenter
980- antialiasing: true
981- color: styleMusic.toolbar.fullOuterPlayCircleColor
982- height: nowPlayingPlayButton.height - units.gu(.1)
983- radius: height / 2
984- width: height
985-
986- Rectangle {
987- id: nowPlayingPlayButtonInner
988- anchors.horizontalCenter: parent.horizontalCenter
989- anchors.verticalCenter: parent.verticalCenter
990- antialiasing: true
991- color: styleMusic.toolbar.fullInnerPlayCircleColor
992- height: units.gu(7)
993- radius: height / 2
994- width: height
995-
996- // draws the inner shadow/highlight
997- Rectangle {
998- id: sourceInnerFull
999- anchors { fill: parent; margins: -units.gu(0.1) }
1000- radius: (width / 2)
1001- antialiasing: true
1002- gradient: Gradient {
1003- GradientStop { position: 0.0; color: UbuntuColors.warmGrey }
1004- GradientStop { position: 0.5; color: "transparent" }
1005- GradientStop { position: 1.0; color: "black" }
1006- }
1007-
1008- Rectangle {
1009- anchors.horizontalCenter: parent.horizontalCenter
1010- anchors.verticalCenter: parent.verticalCenter
1011- antialiasing: true
1012- color: styleMusic.toolbar.fullInnerPlayCircleColor
1013- height: nowPlayingPlayButtonInner.height - units.gu(.1)
1014- objectName: "playShape"
1015- radius: height / 2
1016- width: height
1017-
1018- function trigger() {
1019- if (emptyPage.noMusic) {
1020- return;
1021- }
1022-
1023- if (trackQueue.model.count === 0) {
1024- playRandomSong();
1025- }
1026- else {
1027- player.toggle();
1028- }
1029- }
1030-
1031- Image {
1032- id: nowPlayingPlayIndicator
1033- height: units.gu(6)
1034- width: height
1035- anchors.horizontalCenter: parent.horizontalCenter
1036- anchors.verticalCenter: parent.verticalCenter
1037- opacity: emptyPage.noMusic ? .4 : 1
1038- source: player.playbackState === MediaPlayer.PlayingState ?
1039- Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg")
1040- }
1041- }
1042- }
1043- }
1044- }
1045- }
1046- }
1047-
1048- /* Next button */
1049- Item {
1050- id: nowPlayingNextButton
1051- anchors.left: nowPlayingPlayButton.right
1052- anchors.leftMargin: units.gu(1)
1053- anchors.verticalCenter: parent.verticalCenter
1054- height: units.gu(6)
1055- objectName: "forwardShape"
1056- opacity: trackQueue.model.count === 0 ? .4 : 1
1057- width: height
1058-
1059- function trigger() {
1060- if (trackQueue.model.count === 0 || emptyPage.noMusic) {
1061- return;
1062- }
1063-
1064- player.nextSong()
1065- }
1066-
1067- Image {
1068- id: nowPlayingNextIndicator
1069- height: units.gu(3)
1070- width: height
1071- anchors.horizontalCenter: parent.horizontalCenter
1072- anchors.verticalCenter: parent.verticalCenter
1073- source: Qt.resolvedUrl("images/media-skip-forward.svg")
1074- opacity: 1
1075- }
1076- }
1077-
1078- /* Shuffle button */
1079- Item {
1080- id: nowPlayingShuffleButton
1081- objectName: "shuffleShape"
1082- anchors.left: nowPlayingNextButton.right
1083- anchors.leftMargin: units.gu(1)
1084- anchors.verticalCenter: parent.verticalCenter
1085- height: units.gu(6)
1086- opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4
1087- width: height
1088-
1089- function trigger() {
1090- if (emptyPage.noMusic) {
1091- return;
1092- }
1093-
1094- // Invert shuffle settings
1095- player.shuffle = !player.shuffle
1096- }
1097-
1098- Image {
1099- id: shuffleIcon
1100- height: units.gu(3)
1101- width: height
1102- anchors.verticalCenter: parent.verticalCenter
1103- anchors.horizontalCenter: parent.horizontalCenter
1104- source: Qt.resolvedUrl("images/media-playlist-shuffle.svg")
1105- opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4
1106- }
1107- }
1108-
1109- /* Search button in wideAspect */
1110- Item {
1111- id: nowPlayingSearchButton
1112- objectName: "searchShape"
1113- anchors {
1114- right: parent.right
1115- rightMargin: units.gu(1)
1116- verticalCenter: parent.verticalCenter
1117- }
1118- height: units.gu(6)
1119- opacity: !emptyPage.noMusic ? 1 : .4
1120- width: height
1121- visible: wideAspect
1122-
1123- function trigger() {
1124- if (emptyPage.noMusic) {
1125- return;
1126- }
1127-
1128- if (!searchSheet.sheetVisible) {
1129- PopupUtils.open(searchSheet.sheet,
1130- mainView, { title: i18n.tr("Search")} )
1131- }
1132- }
1133-
1134- Image {
1135- id: searchIcon
1136- anchors {
1137- horizontalCenter: parent.horizontalCenter
1138- verticalCenter: parent.verticalCenter
1139- }
1140- height: units.gu(3)
1141- opacity: !emptyPage.noMusic ? 1 : .4
1142- source: Qt.resolvedUrl("images/search.svg")
1143- width: height
1144- }
1145- }
1146- }
1147-
1148- /* Progress bar component */
1149- Rectangle {
1150- id: musicToolbarFullProgressContainer
1151- anchors.left: parent.left
1152- anchors.top: parent.top
1153- color: styleMusic.toolbar.fullBackgroundColor
1154- height: units.gu(3)
1155- width: parent.width
1156-
1157- /* Position label */
1158- Label {
1159- id: musicToolbarFullPositionLabel
1160- anchors.left: parent.left
1161- anchors.leftMargin: units.gu(2)
1162- anchors.top: parent.top
1163- color: styleMusic.nowPlaying.labelColor
1164- fontSize: "x-small"
1165- height: parent.height
1166- horizontalAlignment: Text.AlignHCenter
1167- text: durationToString(player.position)
1168- verticalAlignment: Text.AlignVCenter
1169- width: units.gu(3)
1170- }
1171-
1172- /* Progress bar */
1173- Rectangle {
1174- id: musicToolbarFullProgressBarContainer
1175- objectName: "progressBarShape"
1176- anchors.left: musicToolbarFullPositionLabel.right
1177- anchors.leftMargin: units.gu(2)
1178- anchors.right: musicToolbarFullDurationLabel.left
1179- anchors.rightMargin: units.gu(2)
1180- anchors.verticalCenter: parent.verticalCenter
1181- color: "transparent"
1182- height: units.gu(1);
1183- state: trackQueue.model.count === 0 ? "disabled" : "enabled"
1184-
1185- states: [
1186- State {
1187- name: "disabled"
1188- PropertyChanges {
1189- target: musicToolbarFullProgressMouseArea
1190- enabled: false
1191- }
1192- PropertyChanges {
1193- target: musicToolbarFullProgressTrough
1194- visible: false
1195- }
1196- PropertyChanges {
1197- target: musicToolbarFullProgressHandle
1198- visible: false
1199- }
1200- },
1201- State {
1202- name: "enabled"
1203- PropertyChanges {
1204- target: musicToolbarFullProgressMouseArea
1205- enabled: true
1206- }
1207- PropertyChanges {
1208- target: musicToolbarFullProgressTrough
1209- visible: true
1210- }
1211- PropertyChanges {
1212- target: musicToolbarFullProgressHandle
1213- visible: true
1214- }
1215- }
1216- ]
1217-
1218- property bool seeking: false
1219-
1220- onSeekingChanged: {
1221- if (seeking === false) {
1222- musicToolbarFullPositionLabel.text = durationToString(player.position)
1223- }
1224- }
1225-
1226- Connections {
1227- target: player
1228- onDurationChanged: {
1229- console.debug("Duration changed: " + player.duration)
1230- musicToolbarFullDurationLabel.text = durationToString(player.duration)
1231- }
1232- onPositionChanged: {
1233- if (musicToolbarFullProgressBarContainer.seeking === false)
1234- {
1235- musicToolbarFullPositionLabel.text = durationToString(player.position)
1236- musicToolbarFullDurationLabel.text = durationToString(player.duration)
1237- musicToolbarFullProgressHandle.x = (player.position / player.duration) * musicToolbarFullProgressBarContainer.width
1238- - musicToolbarFullProgressHandle.width / 2;
1239- }
1240- }
1241- onStopped: {
1242- musicToolbarFullProgressHandle.x = -musicToolbarFullProgressHandle.width / 2;
1243-
1244- musicToolbarFullPositionLabel.text = durationToString(0);
1245- musicToolbarFullDurationLabel.text = durationToString(0);
1246- }
1247- }
1248-
1249- // Black background behind the progress bar
1250- Rectangle {
1251- id: musicToolbarFullProgressBackground
1252- anchors.verticalCenter: parent.verticalCenter;
1253- color: styleMusic.toolbar.fullProgressBackgroundColor;
1254- height: parent.height;
1255- radius: units.gu(0.5)
1256- width: parent.width;
1257- }
1258-
1259- // The orange fill of the progress bar
1260- Rectangle {
1261- id: musicToolbarFullProgressTrough
1262- anchors.verticalCenter: parent.verticalCenter;
1263- antialiasing: true
1264- color: styleMusic.toolbar.fullProgressTroughColor;
1265- height: parent.height;
1266- radius: units.gu(0.5)
1267- width: musicToolbarFullProgressHandle.x + (height / 2); // +radius
1268- }
1269-
1270- // The current position (handle) of the progress bar
1271- Rectangle {
1272- id: musicToolbarFullProgressHandle
1273- anchors.verticalCenter: musicToolbarFullProgressBackground.verticalCenter
1274- antialiasing: true
1275- color: styleMusic.nowPlaying.progressHandleColor
1276- height: units.gu(1.5)
1277- radius: height / 2
1278- width: height
1279-
1280- // On X change update the position string
1281- onXChanged: {
1282- if (musicToolbarFullProgressBarContainer.seeking) {
1283- var fraction = (x + (width / 2)) / parent.width;
1284- musicToolbarFullPositionLabel.text = durationToString(fraction * player.duration)
1285- }
1286- }
1287- }
1288- }
1289-
1290- /* Duration label */
1291- Label {
1292- id: musicToolbarFullDurationLabel
1293- anchors.right: parent.right
1294- anchors.rightMargin: units.gu(2)
1295- anchors.top: parent.top
1296- color: styleMusic.nowPlaying.labelColor
1297- fontSize: "x-small"
1298- height: parent.height
1299- horizontalAlignment: Text.AlignHCenter
1300- text: durationToString(player.duration)
1301- verticalAlignment: Text.AlignVCenter
1302- width: units.gu(3)
1303- }
1304-
1305- /* Border at the bottom */
1306- Rectangle {
1307- anchors.bottom: parent.bottom
1308- anchors.left: parent.left
1309- anchors.right: parent.right
1310- color: styleMusic.common.white
1311- height: units.gu(0.1)
1312- opacity: 0.1
1313- }
1314- }
1315- }
1316+ height: units.gu(7.25)
1317+ locked: true
1318+ opened: true
1319
1320 /* Expanded toolbar */
1321 Rectangle {
1322@@ -713,12 +93,13 @@
1323 fill: parent
1324 }
1325 color: "transparent"
1326- visible: musicToolbarPanel.currentMode === "expanded"
1327
1328 Rectangle {
1329 id: musicToolbarPlayerControls
1330- anchors.fill: parent
1331- color: styleMusic.playerControls.backgroundColor
1332+ anchors {
1333+ fill: parent
1334+ }
1335+ color: "#000"
1336 state: trackQueue.model.count === 0 ? "disabled" : "enabled"
1337 states: [
1338 State {
1339@@ -745,39 +126,55 @@
1340 }
1341 ]
1342
1343+ /* Disabled (empty state) controls */
1344 Rectangle {
1345 id: disabledPlayerControlsGroup
1346- anchors.fill: parent
1347+ anchors {
1348+ bottom: playerControlsProgressBar.top
1349+ left: parent.left
1350+ right: parent.right
1351+ top: parent.top
1352+ }
1353 color: "transparent"
1354- visible: trackQueue.model.count === 0
1355
1356 Label {
1357 id: noSongsInQueueLabel
1358 anchors {
1359 left: parent.left
1360+ leftMargin: units.gu(2)
1361 right: disabledPlayerControlsPlayButton.left
1362- margins: units.gu(1)
1363- top: parent.top
1364+ rightMargin: units.gu(2)
1365+ verticalCenter: parent.verticalCenter
1366 }
1367 color: styleMusic.playerControls.labelColor
1368- text: i18n.tr("Tap play to shuffle music")
1369+ text: i18n.tr("Tap to shuffle music")
1370 fontSize: "large"
1371 wrapMode: Text.WordWrap
1372 maximumLineCount: 2
1373 }
1374
1375- Rectangle {
1376+ /* Play/Pause button */
1377+ Icon {
1378 id: disabledPlayerControlsPlayButton
1379- anchors.right: parent.right
1380- anchors.rightMargin: units.gu(1)
1381- anchors.verticalCenter: parent.verticalCenter
1382- antialiasing: true
1383- color: "#444"
1384- height: units.gu(7)
1385- radius: height / 2
1386+ anchors {
1387+ right: parent.right
1388+ rightMargin: units.gu(3)
1389+ verticalCenter: parent.verticalCenter
1390+ }
1391+ color: "#FFF"
1392+ height: units.gu(2.5)
1393+ name: player.playbackState === MediaPlayer.PlayingState ?
1394+ "media-playback-pause" : "media-playback-start"
1395+ objectName: "disabledSmallPlayShape"
1396 width: height
1397+ }
1398
1399- function trigger() {
1400+ /* Click to shuffle music */
1401+ MouseArea {
1402+ anchors {
1403+ fill: parent
1404+ }
1405+ onClicked: {
1406 if (emptyPage.noMusic) {
1407 return;
1408 }
1409@@ -789,230 +186,65 @@
1410 player.toggle();
1411 }
1412 }
1413-
1414- // draws the outer shadow/highlight
1415- Rectangle {
1416- id: disabledSourceOutter
1417- anchors { fill: parent; margins: -units.gu(0.1) }
1418- radius: (width / 2)
1419- antialiasing: true
1420- gradient: Gradient {
1421- GradientStop { position: 0.0; color: "black" }
1422- GradientStop { position: 0.5; color: "transparent" }
1423- GradientStop { position: 1.0; color: UbuntuColors.warmGrey }
1424- }
1425-
1426- Rectangle {
1427- anchors.verticalCenter: parent.verticalCenter
1428- anchors.horizontalCenter: parent.horizontalCenter
1429- antialiasing: true
1430- color: "#444"
1431- height: playerControlsPlayButton.height - units.gu(.1)
1432- radius: height / 2
1433- width: height
1434-
1435- Rectangle {
1436- id: disabledPlayerControlsPlayInnerCircle
1437- anchors.horizontalCenter: parent.horizontalCenter
1438- anchors.verticalCenter: parent.verticalCenter
1439- antialiasing: true
1440- height: units.gu(4.5)
1441- radius: height / 2
1442- width: height
1443- color: styleMusic.toolbar.fullInnerPlayCircleColor
1444-
1445- // draws the inner shadow/highlight
1446- Rectangle {
1447- id: disabledSourceInner
1448- anchors { fill: parent; margins: -units.gu(0.1) }
1449- radius: (width / 2)
1450- antialiasing: true
1451- gradient: Gradient {
1452- GradientStop { position: 0.0; color: UbuntuColors.warmGrey }
1453- GradientStop { position: 0.5; color: "transparent" }
1454- GradientStop { position: 1.0; color: "black" }
1455- }
1456-
1457- Rectangle {
1458- anchors.verticalCenter: parent.verticalCenter
1459- anchors.horizontalCenter: parent.horizontalCenter
1460- antialiasing: true
1461- height: playerControlsPlayInnerCircle.height - units.gu(.1)
1462- radius: height / 2
1463- width: height
1464- color: styleMusic.toolbar.fullInnerPlayCircleColor
1465-
1466- Image {
1467- id: disabledPlayIndicator
1468- height: units.gu(4)
1469- width: height
1470- anchors.horizontalCenter: parent.horizontalCenter
1471- anchors.verticalCenter: parent.verticalCenter
1472- opacity: emptyPage.noMusic ? .4 : 1
1473- source: player.playbackState === MediaPlayer.PlayingState ?
1474- Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg")
1475- }
1476- }
1477- }
1478- }
1479- }
1480- }
1481 }
1482 }
1483
1484+ /* Enabled (queue > 0) controls */
1485 Rectangle {
1486 id: enabledPlayerControlsGroup
1487- anchors.fill: parent
1488+ anchors {
1489+ bottom: playerControlsProgressBar.top
1490+ left: parent.left
1491+ right: parent.right
1492+ top: parent.top
1493+ }
1494 color: "transparent"
1495- visible: trackQueue.model.count !== 0
1496-
1497- /* Settings button */
1498- // TODO: Enable settings when it is practical
1499- /* Rectangle {
1500- id: playerControlsSettings
1501- anchors.right: parent.right
1502- anchors.verticalCenter: parent.verticalCenter
1503- width: units.gu(6)
1504- height: width
1505- color: "transparent"
1506-
1507- Image {
1508- anchors.horizontalCenter: parent.horizontalCenter
1509- anchors.verticalCenter: parent.verticalCenter
1510- height: units.gu(3)
1511- source: Qt.resolvedUrl("images/settings.png")
1512- width: height
1513- }
1514-
1515- MouseArea {
1516- anchors.fill: parent
1517- onClicked: {
1518- console.debug('Debug: Show settings')
1519- PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,
1520- {
1521- title: i18n.tr("Settings")
1522- } )
1523- }
1524- }
1525- } */
1526-
1527- /* Play/Pause button TODO: image and colours needs updating */
1528- Rectangle {
1529- id: playerControlsPlayButton
1530- anchors.right: parent.right
1531- anchors.rightMargin: units.gu(1)
1532- anchors.verticalCenter: parent.verticalCenter
1533- antialiasing: true
1534- color: "#444"
1535- height: units.gu(7)
1536- objectName: "smallPlayShape"
1537- radius: height / 2
1538- width: height
1539-
1540- function trigger() {
1541- if (emptyPage.noMusic) {
1542- return;
1543- }
1544-
1545- if (trackQueue.model.count === 0) {
1546- playRandomSong();
1547- }
1548- else {
1549- player.toggle();
1550- }
1551- }
1552-
1553- // draws the outer shadow/highlight
1554- Rectangle {
1555- id: sourceOutter
1556- anchors { fill: parent; margins: -units.gu(0.1) }
1557- radius: (width / 2)
1558- antialiasing: true
1559- gradient: Gradient {
1560- GradientStop { position: 0.0; color: "black" }
1561- GradientStop { position: 0.5; color: "transparent" }
1562- GradientStop { position: 1.0; color: UbuntuColors.warmGrey }
1563- }
1564-
1565- Rectangle {
1566- anchors.verticalCenter: parent.verticalCenter
1567- anchors.horizontalCenter: parent.horizontalCenter
1568- antialiasing: true
1569- color: "#444"
1570- height: playerControlsPlayButton.height - units.gu(.1)
1571- radius: height / 2
1572- width: height
1573-
1574- Rectangle {
1575- id: playerControlsPlayInnerCircle
1576- anchors.horizontalCenter: parent.horizontalCenter
1577- anchors.verticalCenter: parent.verticalCenter
1578- antialiasing: true
1579- height: units.gu(4.5)
1580- radius: height / 2
1581- width: height
1582- color: styleMusic.toolbar.fullInnerPlayCircleColor
1583-
1584- // draws the inner shadow/highlight
1585- Rectangle {
1586- id: sourceInner
1587- anchors { fill: parent; margins: -units.gu(0.1) }
1588- radius: (width / 2)
1589- antialiasing: true
1590- gradient: Gradient {
1591- GradientStop { position: 0.0; color: UbuntuColors.warmGrey }
1592- GradientStop { position: 0.5; color: "transparent" }
1593- GradientStop { position: 1.0; color: "black" }
1594- }
1595-
1596- Rectangle {
1597- anchors.verticalCenter: parent.verticalCenter
1598- anchors.horizontalCenter: parent.horizontalCenter
1599- antialiasing: true
1600- height: playerControlsPlayInnerCircle.height - units.gu(.1)
1601- radius: height / 2
1602- width: height
1603- color: styleMusic.toolbar.fullInnerPlayCircleColor
1604-
1605- Image {
1606- id: playindicator
1607- height: units.gu(4)
1608- width: height
1609- anchors.horizontalCenter: parent.horizontalCenter
1610- anchors.verticalCenter: parent.verticalCenter
1611- opacity: emptyPage.noMusic ? .4 : 1
1612- source: player.playbackState === MediaPlayer.PlayingState ?
1613- Qt.resolvedUrl("images/media-playback-pause.svg") : Qt.resolvedUrl("images/media-playback-start.svg")
1614- }
1615- }
1616- }
1617- }
1618+
1619+ /* Album art in player controls */
1620+ Image {
1621+ id: playerControlsImage
1622+ anchors {
1623+ bottom: parent.bottom
1624+ left: parent.left
1625+ top: parent.top
1626+ }
1627+ smooth: true
1628+ source: player.currentMetaArt === "" ?
1629+ decodeURIComponent("image://albumart/artist=" +
1630+ player.currentMetaArtist +
1631+ "&album=" + player.currentMetaAlbum)
1632+ : player.currentMetaArt
1633+ width: parent.height
1634+
1635+ onStatusChanged: {
1636+ if (status === Image.Error) {
1637+ source = Qt.resolvedUrl("../images/music-app-cover@30.png")
1638 }
1639 }
1640 }
1641
1642- /* Container holding the labels for the toolbar */
1643- Rectangle {
1644- id: playerControlLabelContainer
1645- anchors.bottom: parent.bottom
1646- anchors.left: parent.left
1647- anchors.right: playerControlsPlayButton.left
1648- anchors.top: parent.top
1649- color: "transparent"
1650+ /* Column of meta labels */
1651+ Column {
1652+ id: playerControlsLabels
1653+ anchors {
1654+ left: playerControlsImage.right
1655+ leftMargin: units.gu(1.5)
1656+ right: playerControlsPlayButton.left
1657+ rightMargin: units.gu(1)
1658+ verticalCenter: parent.verticalCenter
1659+ }
1660
1661 /* Title of track */
1662 Label {
1663 id: playerControlsTitle
1664- anchors.left: parent.left
1665- anchors.leftMargin: units.gu(1)
1666- anchors.right: parent.right
1667- anchors.rightMargin: units.gu(1)
1668- anchors.top: parent.top
1669- anchors.topMargin: units.gu(1)
1670- color: styleMusic.playerControls.labelColor
1671+ anchors {
1672+ left: parent.left
1673+ right: parent.right
1674+ }
1675+ color: "#FFF"
1676 elide: Text.ElideRight
1677- fontSize: "medium"
1678- objectName: "playercontroltitle"
1679+ fontSize: "small"
1680+ font.weight: Font.DemiBold
1681 text: player.currentMetaTitle === ""
1682 ? player.source : player.currentMetaTitle
1683 }
1684@@ -1020,119 +252,105 @@
1685 /* Artist of track */
1686 Label {
1687 id: playerControlsArtist
1688- anchors.left: parent.left
1689- anchors.leftMargin: units.gu(1)
1690- anchors.right: parent.right
1691- anchors.rightMargin: units.gu(1)
1692- anchors.top: playerControlsTitle.bottom
1693- color: styleMusic.playerControls.labelColor
1694+ anchors {
1695+ left: parent.left
1696+ right: parent.right
1697+ }
1698+ color: "#FFF"
1699 elide: Text.ElideRight
1700 fontSize: "small"
1701+ opacity: 0.4
1702 text: player.currentMetaArtist
1703 }
1704-
1705- /* Album of track */
1706- Label {
1707- id: playerControlsAlbum
1708- anchors.left: parent.left
1709- anchors.leftMargin: units.gu(1)
1710- anchors.right: parent.right
1711- anchors.rightMargin: units.gu(1)
1712- anchors.top: playerControlsArtist.bottom
1713- color: styleMusic.playerControls.labelColor
1714- elide: Text.ElideRight
1715- fontSize: "small"
1716- text: player.currentMetaAlbum
1717- }
1718- }
1719-
1720+ }
1721+
1722+ /* Play/Pause button */
1723+ Icon {
1724+ id: playerControlsPlayButton
1725+ anchors {
1726+ right: parent.right
1727+ rightMargin: units.gu(3)
1728+ verticalCenter: parent.verticalCenter
1729+ }
1730+ color: "#FFF"
1731+ height: units.gu(2.5)
1732+ name: player.playbackState === MediaPlayer.PlayingState ?
1733+ "media-playback-pause" : "media-playback-start"
1734+ objectName: "playShape"
1735+ width: height
1736+ }
1737+
1738+ MouseArea {
1739+ anchors {
1740+ bottom: parent.bottom
1741+ horizontalCenter: playerControlsPlayButton.horizontalCenter
1742+ top: parent.top
1743+ }
1744+ onClicked: player.toggle()
1745+ width: units.gu(8)
1746+
1747+ Rectangle {
1748+ anchors {
1749+ fill: parent
1750+ }
1751+ color: "#FFF"
1752+ opacity: parent.pressed ? 0.1 : 0
1753+
1754+ Behavior on opacity {
1755+ UbuntuNumberAnimation {
1756+ duration: UbuntuAnimation.FastDuration
1757+ }
1758+ }
1759+ }
1760+ }
1761+
1762+ /* Mouse area to jump to now playing */
1763 Rectangle {
1764- anchors.fill: playerControlLabelContainer
1765+ anchors {
1766+ bottom: parent.bottom
1767+ left: parent.left
1768+ right: playerControlsLabels.right
1769+ top: parent.top
1770+ }
1771 color: "transparent"
1772+ objectName: "jumpNowPlaying"
1773 function trigger() {
1774 tabs.pushNowPlaying();
1775 }
1776 }
1777 }
1778- }
1779- }
1780-
1781- /* Object which provides the progress bar when toolbar is minimized */
1782- Rectangle {
1783- id: musicToolbarSmallProgressBackground
1784- anchors {
1785- bottom: parent.top
1786- left: parent.left
1787- right: parent.right
1788- }
1789- color: styleMusic.common.black
1790- height: musicToolbarPanel.minimizedHeight
1791- visible: (!musicToolbarPanel.animating &&
1792- !musicToolbarPanel.opened)
1793- || musicToolbarPanel.currentMode == "expanded"
1794-
1795- Rectangle {
1796- id: musicToolbarSmallProgressHint
1797- anchors.left: parent.left
1798- anchors.top: parent.top
1799- color: styleMusic.nowPlaying.progressForegroundColor
1800- height: parent.height
1801- width: 0
1802-
1803- Connections {
1804- target: player
1805- onPositionChanged: {
1806- musicToolbarSmallProgressHint.width = (player.position / player.duration) * musicToolbarSmallProgressBackground.width
1807- }
1808- onStopped: {
1809- musicToolbarSmallProgressHint.width = 0;
1810- }
1811- }
1812- }
1813- }
1814-
1815- /* Mouse events for the progress bar
1816- is after musicToolbarMouseArea so that it captures mouse events for dragging */
1817- MouseArea {
1818- id: musicToolbarFullProgressMouseArea
1819- height: units.gu(2)
1820- width: musicToolbarFullProgressBarContainer.width
1821- x: musicToolbarFullProgressBarContainer.x
1822- y: musicToolbarFullProgressBarContainer.y
1823-
1824- drag.axis: Drag.XAxis
1825- drag.minimumX: -(musicToolbarFullProgressHandle.width / 2)
1826- drag.maximumX: musicToolbarFullProgressBarContainer.width - (musicToolbarFullProgressHandle.width / 2)
1827- drag.target: musicToolbarFullProgressHandle
1828-
1829- onPressed: {
1830- musicToolbarFullProgressBarContainer.seeking = true;
1831-
1832- // Jump the handle to the current mouse position
1833- musicToolbarFullProgressHandle.x = mouse.x - (musicToolbarFullProgressHandle.width / 2);
1834- }
1835-
1836- onReleased: {
1837- var fraction = mouse.x / musicToolbarFullProgressBarContainer.width;
1838-
1839- // Limit the bounds of the fraction
1840- fraction = fraction < 0 ? 0 : fraction
1841- fraction = fraction > 1 ? 1 : fraction
1842-
1843- player.seek((fraction) * player.duration);
1844- musicToolbarFullProgressBarContainer.seeking = false;
1845- }
1846- }
1847-
1848- // Timer for autohide
1849- Timer {
1850- id: toolbarAutoHideTimer
1851- interval: 5000
1852- repeat: false
1853- running: false
1854- onTriggered: {
1855- if (currentPage !== nowPlaying) { // don't autohide on now playing
1856- hideToolbar();
1857+
1858+ /* Object which provides the progress bar when toolbar is minimized */
1859+ Rectangle {
1860+ id: playerControlsProgressBar
1861+ anchors {
1862+ bottom: parent.bottom
1863+ left: parent.left
1864+ right: parent.right
1865+ }
1866+ color: styleMusic.common.black
1867+ height: units.gu(0.25)
1868+
1869+ Rectangle {
1870+ id: playerControlsProgressBarHint
1871+ anchors {
1872+ left: parent.left
1873+ top: parent.top
1874+ }
1875+ color: UbuntuColors.blue
1876+ height: parent.height
1877+ width: 0
1878+
1879+ Connections {
1880+ target: player
1881+ onPositionChanged: {
1882+ playerControlsProgressBarHint.width = (player.position / player.duration) * playerControlsProgressBar.width
1883+ }
1884+ onStopped: {
1885+ playerControlsProgressBarHint.width = 0;
1886+ }
1887+ }
1888+ }
1889 }
1890 }
1891 }
1892
1893=== modified file 'MusicTracks.qml'
1894--- MusicTracks.qml 2014-09-20 15:41:33 +0000
1895+++ MusicTracks.qml 2014-10-08 18:55:11 +0000
1896@@ -36,8 +36,9 @@
1897
1898 ListView {
1899 id: tracklist
1900- anchors.fill: parent
1901- anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
1902+ anchors {
1903+ fill: parent
1904+ }
1905 highlightFollowsCurrentItem: false
1906 objectName: "trackstab-listview"
1907 model: SortFilterModel {
1908
1909=== modified file 'MusicaddtoPlaylist.qml'
1910--- MusicaddtoPlaylist.qml 2014-09-20 10:50:45 +0000
1911+++ MusicaddtoPlaylist.qml 2014-10-08 18:55:11 +0000
1912@@ -65,7 +65,6 @@
1913 ListView {
1914 id: addtoPlaylistView
1915 anchors {
1916- bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
1917 fill: parent
1918 }
1919 clip: true
1920
1921=== modified file 'Player.qml'
1922--- Player.qml 2014-09-20 15:41:33 +0000
1923+++ Player.qml 2014-10-08 18:55:11 +0000
1924@@ -187,7 +187,11 @@
1925 else {
1926 var obj = trackQueue.model.get(player.currentIndex);
1927 currentMetaAlbum = obj.album;
1928- currentMetaArt = obj.art;
1929+
1930+ if (obj.art !== undefined) { // FIXME: protect against not art property in playlists
1931+ currentMetaArt = obj.art;
1932+ }
1933+
1934 currentMetaArtist = obj.author;
1935 currentMetaFile = obj.filename;
1936 currentMetaTitle = obj.title;
1937
1938=== modified file 'Style.qml'
1939--- Style.qml 2014-09-20 10:50:45 +0000
1940+++ Style.qml 2014-10-08 18:55:11 +0000
1941@@ -34,8 +34,8 @@
1942 property QtObject common: QtObject {
1943 property color black: "#000000";
1944 property color white: "#FFFFFF";
1945- property color music: "#333333";
1946- property color subtitle: "#666666";
1947+ property color music: "#FFFFFF";
1948+ property color subtitle: "#999999";
1949 property color expandedColor: "#000000";
1950 property int albumSize: units.gu(10);
1951 property int itemHeight: units.gu(12);
1952
1953=== modified file 'com.ubuntu.music_music.desktop.in.in'
1954--- com.ubuntu.music_music.desktop.in.in 2014-07-21 14:49:14 +0000
1955+++ com.ubuntu.music_music.desktop.in.in 2014-10-08 18:55:11 +0000
1956@@ -9,4 +9,7 @@
1957 StartupNotify=true
1958 X-Ubuntu-Touch=true
1959 X-Ubuntu-Single-Instance=true
1960+X-Ubuntu-Splash-Show-Header=true
1961+_X-Ubuntu-Splash-Title=Music
1962+_X-Ubuntu-Splash-Color=#1e1e23
1963 X-Ubuntu-Default-Department-ID=sound-video
1964
1965=== modified file 'common/AlbumsPage.qml'
1966--- common/AlbumsPage.qml 2014-10-07 02:15:06 +0000
1967+++ common/AlbumsPage.qml 2014-10-08 18:55:11 +0000
1968@@ -28,7 +28,6 @@
1969
1970 MusicPage {
1971 id: albumStackPage
1972- anchors.bottomMargin: units.gu(.5)
1973 objectName: "albumsArtistPage"
1974 visible: false
1975
1976@@ -38,7 +37,6 @@
1977 ListView {
1978 id: albumtrackslist
1979 anchors {
1980- bottomMargin: wideAspect ? musicToolbar.fullHeight : musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
1981 fill: parent
1982 }
1983 delegate: albumTracksDelegate
1984
1985=== modified file 'common/BlurredBackground.qml'
1986--- common/BlurredBackground.qml 2014-09-20 15:41:33 +0000
1987+++ common/BlurredBackground.qml 2014-10-08 18:55:11 +0000
1988@@ -23,8 +23,14 @@
1989
1990 // Blurred background
1991 Rectangle {
1992- anchors.fill: parent
1993- property string art: player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt
1994+ width: parent.width
1995+ property string art // : player.currentMetaFile === "" ? Qt.resolvedUrl("../images/music-app-cover@30.png") : player.currentMetaArt
1996+
1997+ // dark layer
1998+ Rectangle {
1999+ anchors.fill: parent
2000+ color: "black"
2001+ }
2002
2003 // the album art
2004 Image {
2005@@ -32,7 +38,8 @@
2006 anchors.horizontalCenter: parent.horizontalCenter
2007 anchors.verticalCenter: parent.verticalCenter
2008 source: art // this has to be fixed for the default cover art to work - cant find in this dir
2009- height: Math.max(parent.height, parent.width)
2010+ fillMode: Image.PreserveAspectCrop
2011+ height: parent.height
2012 width: Math.max(parent.height, parent.width)
2013 visible: false
2014 onStatusChanged: {
2015@@ -47,12 +54,7 @@
2016 anchors.fill: backgroundImage
2017 source: backgroundImage
2018 radius: units.dp(42)
2019- }
2020- // transparent white layer
2021- Rectangle {
2022- anchors.fill: parent
2023- color: "white"
2024- opacity: 0.7
2025+ opacity: 0.2
2026 }
2027 onArtChanged: {
2028 // TODO: This is a work around for LP:1261078 and LP:1306845. Ideally,
2029
2030=== added file 'common/Card.qml'
2031--- common/Card.qml 1970-01-01 00:00:00 +0000
2032+++ common/Card.qml 2014-10-08 18:55:11 +0000
2033@@ -0,0 +1,157 @@
2034+/*
2035+ * Copyright (C) 2014
2036+ * Andrew Hayzen <ahayzen@gmail.com>
2037+ *
2038+ * This program is free software; you can redistribute it and/or modify
2039+ * it under the terms of the GNU General Public License as published by
2040+ * the Free Software Foundation; version 3.
2041+ *
2042+ * This program is distributed in the hope that it will be useful,
2043+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2044+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2045+ * GNU General Public License for more details.
2046+ *
2047+ * You should have received a copy of the GNU General Public License
2048+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2049+ */
2050+
2051+import QtQuick 2.3
2052+import Ubuntu.Components 1.1
2053+
2054+
2055+Rectangle {
2056+ id: card
2057+ color: "transparent"
2058+ height: cardColumn.childrenRect.height + 2 * bg.anchors.margins
2059+
2060+ property alias imageSource: image.source
2061+ property alias primaryText: primaryLabel.text
2062+ property alias secondaryText: secondaryLabel.text
2063+
2064+ signal clicked(var mouse)
2065+ signal pressAndHold(var mouse)
2066+
2067+ /* Animations */
2068+ Behavior on height {
2069+ UbuntuNumberAnimation {
2070+
2071+ }
2072+ }
2073+
2074+ Behavior on width {
2075+ UbuntuNumberAnimation {
2076+
2077+ }
2078+ }
2079+
2080+ Behavior on x {
2081+ UbuntuNumberAnimation {
2082+
2083+ }
2084+ }
2085+
2086+ Behavior on y {
2087+ UbuntuNumberAnimation {
2088+
2089+ }
2090+ }
2091+
2092+ /* Background for card */
2093+ Rectangle {
2094+ id: bg
2095+ anchors {
2096+ fill: parent
2097+ margins: units.gu(1)
2098+ }
2099+ color: "#2c2c34"
2100+ }
2101+
2102+ /* Column containing image and labels */
2103+ Column {
2104+ id: cardColumn
2105+ anchors {
2106+ fill: bg
2107+ }
2108+ spacing: units.gu(0.5)
2109+
2110+ Image {
2111+ id: image
2112+ height: parent.width
2113+ width: parent.width
2114+
2115+ onStatusChanged: {
2116+ if (status === Image.Error) {
2117+ source = Qt.resolvedUrl("../images/music-app-cover@30.png")
2118+ }
2119+ }
2120+ }
2121+
2122+ Rectangle {
2123+ color: "transparent"
2124+ height: units.gu(1)
2125+ width: units.gu(1)
2126+ }
2127+
2128+ Label {
2129+ id: primaryLabel
2130+ anchors {
2131+ left: parent.left
2132+ leftMargin: units.gu(1)
2133+ right: parent.right
2134+ rightMargin: units.gu(1)
2135+ }
2136+ color: "#FFF"
2137+ elide: Text.ElideRight
2138+ fontSize: "small"
2139+ opacity: 1.0
2140+ wrapMode: Text.WordWrap
2141+ }
2142+
2143+ Label {
2144+ id: secondaryLabel
2145+ anchors {
2146+ left: parent.left
2147+ leftMargin: units.gu(1)
2148+ right: parent.right
2149+ rightMargin: units.gu(1)
2150+ }
2151+ color: "#FFF"
2152+ elide: Text.ElideRight
2153+ fontSize: "small"
2154+ opacity: 0.4
2155+ wrapMode: Text.WordWrap
2156+ }
2157+
2158+ Rectangle {
2159+ color: "transparent"
2160+ height: units.gu(1.5)
2161+ width: units.gu(1)
2162+ }
2163+ }
2164+
2165+ /* Overlay for when card is pressed */
2166+ Rectangle {
2167+ id: overlay
2168+ anchors {
2169+ fill: bg
2170+ }
2171+ color: "#000"
2172+ opacity: 0
2173+
2174+ Behavior on opacity {
2175+ UbuntuNumberAnimation {
2176+
2177+ }
2178+ }
2179+ }
2180+
2181+ /* Capture mouse events */
2182+ MouseArea {
2183+ anchors {
2184+ fill: parent
2185+ }
2186+ onClicked: card.clicked(mouse)
2187+ onPressAndHold: card.pressAndHold(mouse)
2188+ onPressedChanged: overlay.opacity = pressed ? 0.3 : 0
2189+ }
2190+}
2191
2192=== added file 'common/CardView.qml'
2193--- common/CardView.qml 1970-01-01 00:00:00 +0000
2194+++ common/CardView.qml 2014-10-08 18:55:11 +0000
2195@@ -0,0 +1,41 @@
2196+/*
2197+ * Copyright (C) 2014
2198+ * Andrew Hayzen <ahayzen@gmail.com>
2199+ *
2200+ * This program is free software; you can redistribute it and/or modify
2201+ * it under the terms of the GNU General Public License as published by
2202+ * the Free Software Foundation; version 3.
2203+ *
2204+ * This program is distributed in the hope that it will be useful,
2205+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2206+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2207+ * GNU General Public License for more details.
2208+ *
2209+ * You should have received a copy of the GNU General Public License
2210+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2211+ */
2212+
2213+import QtQuick 2.3
2214+import Ubuntu.Components 1.1
2215+
2216+
2217+Flickable {
2218+ anchors {
2219+ fill: parent
2220+ margins: units.gu(1)
2221+ }
2222+
2223+ // dont use flow.contentHeight as it is inaccurate due to height of labels
2224+ // changing as they load
2225+ contentHeight: flow.childrenRect.height
2226+ contentWidth: width
2227+
2228+ property alias delegate: flow.delegate
2229+ property alias model: flow.model
2230+
2231+ ColumnFlow {
2232+ id: flow
2233+ columns: parseInt(width / units.gu(15))
2234+ width: parent.width
2235+ }
2236+}
2237
2238=== added file 'common/ColumnFlow.qml'
2239--- common/ColumnFlow.qml 1970-01-01 00:00:00 +0000
2240+++ common/ColumnFlow.qml 2014-10-08 18:55:11 +0000
2241@@ -0,0 +1,159 @@
2242+/*
2243+ * Copyright (C) 2014
2244+ * Andrew Hayzen <ahayzen@gmail.com>
2245+ * Michael Spencer <sonrisesoftware@gmail.com>
2246+ *
2247+ * This program is free software; you can redistribute it and/or modify
2248+ * it under the terms of the GNU General Public License as published by
2249+ * the Free Software Foundation; version 3.
2250+ *
2251+ * This program is distributed in the hope that it will be useful,
2252+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2253+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2254+ * GNU General Public License for more details.
2255+ *
2256+ * You should have received a copy of the GNU General Public License
2257+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2258+ *
2259+ * Upstream location:
2260+ * https://github.com/iBeliever/ubuntu-ui-extras/blob/master/ColumnFlow.qml
2261+ */
2262+
2263+import QtQuick 2.3
2264+
2265+
2266+Item {
2267+ id: columnFlow
2268+ property int columns: 1
2269+ property bool repeaterCompleted: false
2270+ property alias model: repeater.model
2271+ property alias delegate: repeater.delegate
2272+ property int contentHeight: 0
2273+
2274+ onColumnsChanged: reEvalColumns()
2275+ onModelChanged: reEvalColumns()
2276+ onWidthChanged: updateWidths()
2277+
2278+ function updateWidths() {
2279+ if (repeaterCompleted) {
2280+ var count = 0
2281+
2282+ //add the first <column> elements
2283+ for (var i = 0; count < columns && i < columnFlow.children.length; i++) {
2284+ //print(i, count)
2285+ if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0)
2286+ //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start
2287+ continue
2288+
2289+ columnFlow.children[i].width = width / columns
2290+
2291+ count++
2292+ }
2293+ }
2294+ }
2295+
2296+ function reEvalColumns() {
2297+ if (columnFlow.repeaterCompleted === false)
2298+ return
2299+
2300+ if (columns === 0) {
2301+ contentHeight = 0
2302+ return
2303+ }
2304+
2305+ var i, j
2306+ var columnHeights = new Array(columns);
2307+ var lastItem = new Array(columns)
2308+ var lastI = -1
2309+ var count = 0
2310+
2311+ //add the first <column> elements
2312+ for (i = 0; count < columns && i < columnFlow.children.length; i++) {
2313+ // CUSTOM - ignore if has just been removed
2314+ if (i === repeater.removeHintIndex && columnFlow.children[i] === repeater.removeHintItem) {
2315+ continue
2316+ }
2317+
2318+ if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0)
2319+ //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start
2320+ continue
2321+
2322+ lastItem[count] = i
2323+
2324+ columnHeights[count] = columnFlow.children[i].height
2325+ columnFlow.children[i].anchors.top = columnFlow.top
2326+ columnFlow.children[i].anchors.left = (lastI === -1 ? columnFlow.left : columnFlow.children[lastI].right)
2327+ columnFlow.children[i].anchors.right = undefined
2328+ columnFlow.children[i].width = columnFlow.width / columns
2329+
2330+ lastI = i
2331+ count++
2332+ }
2333+
2334+ //add the other elements
2335+ for (i = i; i < columnFlow.children.length; i++) {
2336+ var highestHeight = Number.MAX_VALUE
2337+ var newColumn = 0
2338+
2339+ // CUSTOM - ignore if has just been removed
2340+ if (i === repeater.removeHintIndex && columnFlow.children[i] === repeater.removeHintItem) {
2341+ continue
2342+ }
2343+
2344+ if (!columnFlow.children[i] || String(columnFlow.children[i]).indexOf("QQuickRepeater") == 0)
2345+ //|| !columnFlow.children[i].visible) // CUSTOM - view is invisible at start
2346+ continue
2347+
2348+ // find the shortest column
2349+ for (j = 0; j < columns; j++) {
2350+ if (columnHeights[j] !== null && columnHeights[j] < highestHeight) {
2351+ newColumn = j
2352+ highestHeight = columnHeights[j]
2353+ }
2354+ }
2355+
2356+ // add the element to the shortest column
2357+ columnFlow.children[i].anchors.top = columnFlow.children[lastItem[newColumn]].bottom
2358+ columnFlow.children[i].anchors.left = columnFlow.children[lastItem[newColumn]].left
2359+ columnFlow.children[i].anchors.right = columnFlow.children[lastItem[newColumn]].right
2360+
2361+ lastItem[newColumn] = i
2362+ columnHeights[newColumn] += columnFlow.children[i].height
2363+ }
2364+
2365+ var cHeight = 0
2366+
2367+ for (i = 0; i < columnHeights.length; i++) {
2368+ if (columnHeights[i])
2369+ cHeight = Math.max(cHeight, columnHeights[i])
2370+ }
2371+
2372+ contentHeight = cHeight
2373+ updateWidths()
2374+ }
2375+
2376+ Repeater {
2377+ id: repeater
2378+ model: columnFlow.model
2379+ Component.onCompleted: {
2380+ columnFlow.repeaterCompleted = true
2381+ columnFlow.reEvalColumns()
2382+ }
2383+
2384+ // Provide a hint of the removed item
2385+ property int removeHintIndex: -1 // CUSTOM
2386+ property var removeHintItem // CUSTOM
2387+
2388+ onItemAdded: columnFlow.reEvalColumns() // CUSTOM - ms2 models are live
2389+ onItemRemoved: {
2390+ removeHintIndex = index
2391+ removeHintItem = item
2392+
2393+ columnFlow.reEvalColumns() // CUSTOM - ms2 models are live
2394+
2395+ // Set back to null to allow freeing of memory
2396+ removeHintIndex = -1
2397+ removeHintItem = undefined
2398+ }
2399+ }
2400+}
2401
2402=== modified file 'common/MusicPage.qml'
2403--- common/MusicPage.qml 2014-08-20 17:35:52 +0000
2404+++ common/MusicPage.qml 2014-10-08 18:55:11 +0000
2405@@ -23,6 +23,10 @@
2406 // generic page for music, could be useful for bottomedge implementation
2407 Page {
2408 id: thisPage
2409+ anchors {
2410+ bottomMargin: musicToolbar.visible ? musicToolbar.currentHeight : 0
2411+ fill: parent
2412+ }
2413
2414 onVisibleChanged: {
2415 if (visible) {
2416
2417=== modified file 'common/MusicRow.qml'
2418--- common/MusicRow.qml 2014-09-20 10:50:45 +0000
2419+++ common/MusicRow.qml 2014-10-08 18:55:11 +0000
2420@@ -24,12 +24,13 @@
2421 Row {
2422 anchors {
2423 left: parent.left
2424- leftMargin: units.gu(1)
2425+ leftMargin: units.gu(2)
2426 right: parent.right
2427- rightMargin: units.gu(1)
2428+ rightMargin: units.gu(2)
2429 }
2430
2431 property alias covers: coverRow.covers
2432+ property bool showCovers: true
2433 property alias pressed: coverRow.pressed
2434 property alias column: columnComponent.sourceComponent
2435
2436@@ -37,6 +38,7 @@
2437
2438 CoverRow {
2439 id: coverRow
2440+ visible: showCovers
2441 anchors {
2442 top: parent.top
2443 topMargin: units.gu(1)
2444@@ -50,9 +52,10 @@
2445 id: columnComponent
2446 anchors {
2447 top: parent.top
2448- topMargin: units.gu(2)
2449+ topMargin: units.gu(1)
2450 }
2451- width: parent.width - coverRow.width - parent.spacing
2452+ width: showCovers ? parent.width - coverRow.width - parent.spacing
2453+ : parent.width - parent.spacing
2454
2455 onSourceComponentChanged: {
2456 for (var i=0; i < item.children.length; i++) {
2457
2458=== modified file 'common/SongsPage.qml'
2459--- common/SongsPage.qml 2014-09-20 15:41:33 +0000
2460+++ common/SongsPage.qml 2014-10-08 18:55:11 +0000
2461@@ -29,7 +29,6 @@
2462
2463 MusicPage {
2464 id: songStackPage
2465- anchors.bottomMargin: units.gu(.5)
2466 objectName: "songsPage"
2467 visible: false
2468
2469@@ -52,7 +51,6 @@
2470 ListView {
2471 id: albumtrackslist
2472 anchors {
2473- bottomMargin: wideAspect ? musicToolbar.fullHeight : musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
2474 fill: parent
2475 }
2476 delegate: albumTracksDelegate
2477@@ -61,19 +59,49 @@
2478 width: parent.width
2479 header: ListItem.Standard {
2480 id: albumInfo
2481- height: units.gu(22)
2482-
2483- CoverRow {
2484+ height: albumArtist.visible ? units.gu(33) : units.gu(30)
2485+
2486+ BlurredBackground {
2487+ id: blurredBackground
2488+ height: parent.height
2489+ art: albumImage.source
2490+ }
2491+
2492+ Image {
2493 id: albumImage
2494 anchors {
2495 top: parent.top
2496 left: parent.left
2497- margins: units.gu(1)
2498- }
2499- count: songStackPage.covers.length
2500- size: units.gu(20)
2501- covers: songStackPage.covers
2502- spacing: units.gu(2)
2503+ topMargin: units.gu(3)
2504+ bottomMargin: units.gu(2)
2505+ leftMargin: units.gu(2)
2506+ rightMargin: units.gu(2)
2507+ }
2508+ width: units.gu(18)
2509+ height: width
2510+ smooth: true
2511+ source: covers.length > 0
2512+ ? (covers[0].art !== undefined
2513+ ? covers[0].art
2514+ : decodeURIComponent("image://albumart/artist=" + covers[0].author + "&album=" + covers[0].album))
2515+ : Qt.resolvedUrl("../images/music-app-cover@30.png")
2516+ }
2517+
2518+ Label {
2519+ id: albumLabel
2520+ wrapMode: Text.NoWrap
2521+ maximumLineCount: 1
2522+ fontSize: "x-large"
2523+ color: styleMusic.common.music
2524+ anchors {
2525+ top: albumImage.bottom
2526+ topMargin: units.gu(1)
2527+ left: albumImage.left
2528+ right: parent.right
2529+ rightMargin: units.gu(2)
2530+ }
2531+ elide: Text.ElideRight
2532+ text: line2
2533 }
2534
2535 Label {
2536@@ -83,77 +111,115 @@
2537 maximumLineCount: 1
2538 fontSize: "small"
2539 color: styleMusic.common.subtitle
2540- anchors.left: albumImage.right
2541- anchors.leftMargin: units.gu(1)
2542- anchors.top: parent.top
2543- anchors.topMargin: units.gu(1.5)
2544- anchors.right: parent.right
2545- anchors.rightMargin: units.gu(1.5)
2546+ visible: text !== i18n.tr("Playlist") &&
2547+ text !== i18n.tr("Genre")
2548+ anchors {
2549+ top: albumLabel.bottom
2550+ topMargin: units.gu(0.75)
2551+ left: albumImage.left
2552+ right: parent.right
2553+ rightMargin: units.gu(2)
2554+ }
2555 elide: Text.ElideRight
2556 text: line1
2557 }
2558- Label {
2559- id: albumLabel
2560- wrapMode: Text.NoWrap
2561- maximumLineCount: 2
2562- fontSize: "medium"
2563- color: styleMusic.common.music
2564- anchors.left: albumImage.right
2565- anchors.leftMargin: units.gu(1)
2566- anchors.top: albumArtist.bottom
2567- anchors.topMargin: units.gu(0.8)
2568- anchors.right: parent.right
2569- anchors.rightMargin: units.gu(1.5)
2570- elide: Text.ElideRight
2571- text: line2
2572- }
2573+
2574 Label {
2575 id: albumYear
2576 wrapMode: Text.NoWrap
2577 maximumLineCount: 1
2578- fontSize: "x-small"
2579+ fontSize: "small"
2580 color: styleMusic.common.subtitle
2581- anchors.left: albumImage.right
2582- anchors.leftMargin: units.gu(1)
2583- anchors.top: albumLabel.bottom
2584- anchors.topMargin: units.gu(2)
2585- anchors.right: parent.right
2586- anchors.rightMargin: units.gu(1.5)
2587+ anchors {
2588+ top: albumArtist.visible ? albumArtist.bottom
2589+ : albumLabel.bottom
2590+ topMargin: units.gu(1)
2591+ left: albumImage.left
2592+ right: parent.right
2593+ rightMargin: units.gu(2)
2594+ }
2595 elide: Text.ElideRight
2596 text: isAlbum && line1 !== i18n.tr("Genre") ? year + " | " + i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
2597 : i18n.tr("%1 song", "%1 songs", albumtrackslist.count).arg(albumtrackslist.count)
2598
2599 }
2600
2601+ // Shuffle
2602+ Button {
2603+ id: shuffleRow
2604+ anchors {
2605+ bottom: queueAllRow.top
2606+ bottomMargin: units.gu(2)
2607+ left: albumImage.right
2608+ leftMargin: units.gu(2)
2609+ }
2610+ strokeColor: UbuntuColors.green
2611+ height: units.gu(4)
2612+ width: units.gu(15)
2613+ Text {
2614+ anchors {
2615+ centerIn: parent
2616+ }
2617+ color: "white"
2618+ text: i18n.tr("Shuffle")
2619+ }
2620+ MouseArea {
2621+ anchors.fill: parent
2622+ onClicked: {
2623+ shuffleModel(albumtrackslist.model) // play track
2624+
2625+ if (isAlbum && songStackPage.line1 !== i18n.tr("Genre")) {
2626+ Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
2627+ mainView.hasRecent = true
2628+ recentModel.filterRecent()
2629+ } else if (songStackPage.line1 === i18n.tr("Playlist")) {
2630+ Library.addRecent(songStackPage.line2, "Playlist", songStackPage.covers[0], songStackPage.line2, "playlist")
2631+ mainView.hasRecent = true
2632+ recentModel.filterRecent()
2633+ }
2634+ }
2635+ }
2636+ }
2637+
2638+ // Queue
2639+ Button {
2640+ id: queueAllRow
2641+ anchors {
2642+ bottom: playRow.top
2643+ bottomMargin: units.gu(2)
2644+ left: albumImage.right
2645+ leftMargin: units.gu(2)
2646+ }
2647+ strokeColor: UbuntuColors.green
2648+ height: units.gu(4)
2649+ width: units.gu(15)
2650+ Text {
2651+ anchors {
2652+ centerIn: parent
2653+ }
2654+ color: "white"
2655+ text: i18n.tr("Queue all")
2656+ }
2657+ MouseArea {
2658+ anchors.fill: parent
2659+ onClicked: {
2660+ addQueueFromModel(albumtrackslist.model)
2661+ }
2662+ }
2663+ }
2664+
2665 // Play
2666- Rectangle {
2667+ Button {
2668 id: playRow
2669- anchors.top: albumYear.bottom
2670- anchors.topMargin: units.gu(1)
2671- anchors.left: albumImage.right
2672- anchors.leftMargin: units.gu(1)
2673- color: "transparent"
2674+ anchors {
2675+ bottom: albumImage.bottom
2676+ left: albumImage.right
2677+ leftMargin: units.gu(2)
2678+ }
2679+ color: UbuntuColors.green
2680 height: units.gu(4)
2681 width: units.gu(15)
2682- Icon {
2683- id: playTrack
2684- objectName: "songspage-playtrack"
2685- anchors.verticalCenter: parent.verticalCenter
2686- name: "media-playback-start"
2687- height: styleMusic.common.expandedItem
2688- width: styleMusic.common.expandedItem
2689- }
2690- Label {
2691- anchors.left: playTrack.right
2692- anchors.leftMargin: units.gu(0.5)
2693- anchors.verticalCenter: parent.verticalCenter
2694- fontSize: "small"
2695- color: styleMusic.common.subtitle
2696- width: parent.width - playTrack.width - units.gu(1)
2697- text: i18n.tr("Play all")
2698- wrapMode: Text.WordWrap
2699- maximumLineCount: 3
2700- }
2701+ text: i18n.tr("Play all")
2702 MouseArea {
2703 anchors.fill: parent
2704 onClicked: {
2705@@ -171,43 +237,6 @@
2706 }
2707 }
2708 }
2709-
2710- // Queue
2711- Rectangle {
2712- id: queueAllRow
2713- anchors.top: playRow.bottom
2714- anchors.topMargin: units.gu(1)
2715- anchors.left: albumImage.right
2716- anchors.leftMargin: units.gu(1)
2717- color: "transparent"
2718- height: units.gu(4)
2719- width: units.gu(15)
2720- Icon {
2721- id: queueAll
2722- objectName: "songspage-queue-all"
2723- anchors.verticalCenter: parent.verticalCenter
2724- name: "add"
2725- height: styleMusic.common.expandedItem
2726- width: styleMusic.common.expandedItem
2727- }
2728- Label {
2729- anchors.left: queueAll.right
2730- anchors.leftMargin: units.gu(0.5)
2731- anchors.verticalCenter: parent.verticalCenter
2732- fontSize: "small"
2733- color: styleMusic.common.subtitle
2734- width: parent.width - queueAll.width - units.gu(1)
2735- text: i18n.tr("Add to queue")
2736- wrapMode: Text.WordWrap
2737- maximumLineCount: 3
2738- }
2739- MouseArea {
2740- anchors.fill: parent
2741- onClicked: {
2742- addQueueFromModel(albumtrackslist.model)
2743- }
2744- }
2745- }
2746 }
2747
2748 Component {
2749@@ -219,7 +248,8 @@
2750 objectName: "songsPageListItem" + index
2751 iconFrame: false
2752 progression: false
2753- height: styleMusic.common.itemHeight
2754+ showDivider: false
2755+ height: units.gu(6)
2756
2757 leftSideAction: songStackPage.line1 === i18n.tr("Playlist")
2758 ? playlistRemoveAction.item : null
2759@@ -272,30 +302,23 @@
2760
2761 MusicRow {
2762 id: musicRow
2763- covers: model.art !== undefined ? [{art: model.art}] : [{author: model.author, album: model.album}]
2764+ covers: []
2765+ showCovers: false
2766 column: Column {
2767- spacing: units.gu(1)
2768+ Label {
2769+ id: trackTitle
2770+ color: styleMusic.common.music
2771+ fontSize: "small"
2772+ objectName: "songspage-tracktitle"
2773+ text: model.title
2774+ }
2775+
2776 Label {
2777 id: trackArtist
2778 color: styleMusic.common.subtitle
2779 fontSize: "x-small"
2780 text: model.author
2781 }
2782-
2783- Label {
2784- id: trackTitle
2785- color: styleMusic.common.subtitle
2786- fontSize: "medium"
2787- objectName: "songspage-tracktitle"
2788- text: model.title
2789- }
2790-
2791- Label {
2792- id: trackAlbum
2793- color: styleMusic.common.subtitle
2794- fontSize: "xx-small"
2795- text: model.album
2796- }
2797 }
2798 }
2799
2800
2801=== modified file 'music-app.qml'
2802--- music-app.qml 2014-09-23 15:59:28 +0000
2803+++ music-app.qml 2014-10-08 18:55:11 +0000
2804@@ -40,18 +40,13 @@
2805 id: mainView
2806 useDeprecatedToolbar: false
2807
2808- // Use toolbar color for header
2809- headerColor: styleMusic.toolbar.fullBackgroundColor
2810- backgroundColor: styleMusic.toolbar.fullBackgroundColor
2811+ backgroundColor: "#1e1e23"
2812+ headerColor: "#1e1e23"
2813
2814 // Global keyboard shortcuts
2815 focus: true
2816 Keys.onPressed: {
2817- if (event.key === Qt.Key_Alt) {
2818- // On alt key press show toolbar and start autohide timer
2819- musicToolbar.showToolbar();
2820- }
2821- else if(event.key === Qt.Key_Escape) {
2822+ if(event.key === Qt.Key_Escape) {
2823 musicToolbar.goBack(); // Esc Go back
2824 }
2825 else if(event.modifiers === Qt.AltModifier) {
2826@@ -96,11 +91,9 @@
2827 case Qt.Key_J: // Ctrl+J Jump to playing song
2828 nowPlaying.visible = true;
2829 nowPlaying.positionAt(player.currentIndex);
2830- musicToolbar.showToolbar();
2831 break;
2832 case Qt.Key_N: // Ctrl+N Show now playing
2833 nowPlaying.visible = true;
2834- musicToolbar.showToolbar();
2835 break;
2836 case Qt.Key_P: // Ctrl+P Toggle playing state
2837 player.toggle();
2838@@ -577,12 +570,6 @@
2839 if (args.values.url) {
2840 uriHandler.process(args.values.url, true);
2841 }
2842-
2843- // Show toolbar and start timer if there is music
2844- if (!emptyPage.noMusic) {
2845- musicToolbar.showToolbar();
2846- musicToolbar.startAutohideTimer();
2847- }
2848 }
2849
2850 // VARIABLES
2851@@ -594,11 +581,10 @@
2852 property string lastfmpassword
2853 property string timestamp // used to scrobble
2854 property var chosenElement: null
2855- property bool toolbarShown: musicToolbar.shown
2856+ property bool toolbarShown: musicToolbar.visible
2857 property bool selectedAlbum: false
2858
2859 signal listItemSwiping(int i)
2860- signal onToolbarShownChanged(bool shown, var currentPage, var currentTab)
2861
2862 property bool wideAspect: width >= units.gu(70) && loadedUI
2863 property bool loadedUI: false // property to detect if the UI has finished
2864@@ -680,8 +666,6 @@
2865 // Show the Now Playing page and make sure the track is visible
2866 tabs.pushNowPlaying();
2867 nowPlaying.ensureVisibleIndex = index;
2868-
2869- musicToolbar.showToolbar();
2870 }
2871 else {
2872 player.source = file;
2873@@ -699,8 +683,6 @@
2874 // Show the Now Playing page and make sure the track is visible
2875 tabs.pushNowPlaying();
2876 nowPlaying.ensureVisibleIndex = index;
2877-
2878- musicToolbar.showToolbar();
2879 }
2880
2881 function playRandomSong(shuffle)
2882@@ -716,6 +698,17 @@
2883 trackClicked(allSongsModel, index, true)
2884 }
2885
2886+ function shuffleModel(model)
2887+ {
2888+ var now = new Date();
2889+ var seed = now.getSeconds();
2890+ var index = Math.floor(model.count * Math.random(seed));
2891+
2892+ player.shuffle = true;
2893+
2894+ trackClicked(model, index, true)
2895+ }
2896+
2897 // Load mediascanner store
2898 MediaStore {
2899 id: musicStore
2900@@ -867,10 +860,6 @@
2901 id: searchSheet
2902 }
2903
2904- // Blurred background
2905- BlurredBackground {
2906- }
2907-
2908 // Popover for tracks, queue and add to playlist, for example
2909 Component {
2910 id: trackPopoverComponent
2911@@ -973,6 +962,7 @@
2912
2913 MusicToolbar {
2914 id: musicToolbar
2915+ visible: nowPlaying.isListView || !nowPlaying.visible
2916 objectName: "musicToolbarObject"
2917 z: 200 // put on top of everything else
2918 }
2919@@ -983,7 +973,6 @@
2920 Tabs {
2921 id: tabs
2922 anchors {
2923- bottomMargin: wideAspect ? musicToolbar.fullHeight : undefined
2924 fill: parent
2925 }
2926
2927
2928=== modified file 'po/com.ubuntu.music.pot'
2929--- po/com.ubuntu.music.pot 2014-09-23 12:44:36 +0000
2930+++ po/com.ubuntu.music.pot 2014-10-08 18:55:11 +0000
2931@@ -8,7 +8,7 @@
2932 msgstr ""
2933 "Project-Id-Version: music-app\n"
2934 "Report-Msgid-Bugs-To: \n"
2935-"POT-Creation-Date: 2014-09-23 13:43+0100\n"
2936+"POT-Creation-Date: 2014-10-02 20:40-0500\n"
2937 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
2938 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2939 "Language-Team: LANGUAGE <LL@li.org>\n"
2940@@ -76,7 +76,7 @@
2941
2942 #: ../MusicArtists.qml:113 ../MusicPlaylists.qml:180 ../MusicStart.qml:371
2943 #: ../MusicaddtoPlaylist.qml:106 ../common/AlbumsPage.qml:331
2944-#: ../common/SongsPage.qml:123 ../common/SongsPage.qml:124
2945+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:139
2946 #, qt-format
2947 msgid "%1 song"
2948 msgid_plural "%1 songs"
2949@@ -114,31 +114,32 @@
2950 msgid "Change"
2951 msgstr ""
2952
2953-#: ../MusicPlaylists.qml:96 ../music-app.qml:956
2954+#: ../MusicPlaylists.qml:96 ../music-app.qml:962
2955 msgid "Playlist already exists"
2956 msgstr ""
2957
2958-#: ../MusicPlaylists.qml:100 ../music-app.qml:961
2959+#: ../MusicPlaylists.qml:100 ../music-app.qml:967
2960 msgid "Please type in a name."
2961 msgstr ""
2962
2963-#: ../MusicPlaylists.qml:105 ../music-app.qml:493 ../music-app.qml:967
2964+#: ../MusicPlaylists.qml:105 ../music-app.qml:492 ../music-app.qml:973
2965 msgid "Cancel"
2966 msgstr ""
2967
2968 #: ../MusicPlaylists.qml:159 ../MusicPlaylists.qml:163 ../MusicStart.qml:118
2969-#: ../MusicStart.qml:200 ../common/SongsPage.qml:166
2970-#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:226
2971-#: ../common/SongsPage.qml:244
2972+#: ../MusicStart.qml:200 ../common/SongsPage.qml:114
2973+#: ../common/SongsPage.qml:171 ../common/SongsPage.qml:228
2974+#: ../common/SongsPage.qml:250 ../common/SongsPage.qml:252
2975+#: ../common/SongsPage.qml:270
2976 msgid "Playlist"
2977 msgstr ""
2978
2979-#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:519
2980-#: ../music-app.qml:93 ../music-app.qml:141 ../music-app.qml:147
2981+#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:522
2982+#: ../music-app.qml:92 ../music-app.qml:140 ../music-app.qml:146
2983 msgid "Search"
2984 msgstr ""
2985
2986-#: ../MusicSettings.qml:30 ../music-app.qml:191
2987+#: ../MusicSettings.qml:30 ../music-app.qml:190
2988 msgid "Settings"
2989 msgstr ""
2990
2991@@ -224,7 +225,7 @@
2992 msgid "Clean everything!"
2993 msgstr ""
2994
2995-#: ../MusicStart.qml:35 ../music-app.qml:589 ../music-app.qml:1150
2996+#: ../MusicStart.qml:35 ../music-app.qml:588 ../music-app.qml:1156
2997 #: com.ubuntu.music_music.desktop.in.in.h:1
2998 msgid "Music"
2999 msgstr ""
3000@@ -241,13 +242,14 @@
3001 msgid "Genres"
3002 msgstr ""
3003
3004-#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:123
3005-#: ../common/SongsPage.qml:162 ../common/SongsPage.qml:240
3006+#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:115
3007+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:167
3008+#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:266
3009 msgid "Genre"
3010 msgstr ""
3011
3012-#: ../MusicToolbar.qml:760
3013-msgid "Tap play to shuffle music"
3014+#: ../MusicToolbar.qml:767
3015+msgid "Tap to shuffle music"
3016 msgstr ""
3017
3018 #: ../MusicTracks.qml:35
3019@@ -259,16 +261,16 @@
3020 msgstr ""
3021
3022 #: ../common/AlbumsPage.qml:167 ../common/AlbumsPage.qml:360
3023-#: ../common/SongsPage.qml:153
3024+#: ../common/SongsPage.qml:218
3025 msgid "Play all"
3026 msgstr ""
3027
3028 #: ../common/AlbumsPage.qml:211 ../common/AlbumsPage.qml:400
3029-#: ../common/SongsPage.qml:200 ../music-app.qml:888
3030+#: ../music-app.qml:894
3031 msgid "Add to queue"
3032 msgstr ""
3033
3034-#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:902
3035+#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:908
3036 msgid "Add to playlist"
3037 msgstr ""
3038
3039@@ -294,6 +296,14 @@
3040 msgid "Loading..."
3041 msgstr ""
3042
3043+#: ../common/SongsPage.qml:160
3044+msgid "Shuffle"
3045+msgstr ""
3046+
3047+#: ../common/SongsPage.qml:197
3048+msgid "Queue all"
3049+msgstr ""
3050+
3051 #: ../common/SwipeDelete.qml:52 ../common/SwipeDelete.qml:88
3052 msgid "Clear"
3053 msgstr ""
3054@@ -306,127 +316,127 @@
3055 msgid "Unknown Artist"
3056 msgstr ""
3057
3058-#: ../music-app.qml:142
3059+#: ../music-app.qml:141
3060 msgid "Search Track"
3061 msgstr ""
3062
3063+#: ../music-app.qml:153
3064+msgid "Next"
3065+msgstr ""
3066+
3067 #: ../music-app.qml:154
3068-msgid "Next"
3069-msgstr ""
3070-
3071-#: ../music-app.qml:155
3072 msgid "Next Track"
3073 msgstr ""
3074
3075-#: ../music-app.qml:161
3076+#: ../music-app.qml:160
3077 msgid "Pause"
3078 msgstr ""
3079
3080-#: ../music-app.qml:161
3081+#: ../music-app.qml:160
3082 msgid "Play"
3083 msgstr ""
3084
3085-#: ../music-app.qml:163
3086+#: ../music-app.qml:162
3087 msgid "Pause Playback"
3088 msgstr ""
3089
3090-#: ../music-app.qml:163
3091+#: ../music-app.qml:162
3092 msgid "Continue or start playback"
3093 msgstr ""
3094
3095+#: ../music-app.qml:167
3096+msgid "Back"
3097+msgstr ""
3098+
3099 #: ../music-app.qml:168
3100-msgid "Back"
3101-msgstr ""
3102-
3103-#: ../music-app.qml:169
3104 msgid "Go back to last page"
3105 msgstr ""
3106
3107+#: ../music-app.qml:176
3108+msgid "Previous"
3109+msgstr ""
3110+
3111 #: ../music-app.qml:177
3112-msgid "Previous"
3113-msgstr ""
3114-
3115-#: ../music-app.qml:178
3116 msgid "Previous Track"
3117 msgstr ""
3118
3119+#: ../music-app.qml:182
3120+msgid "Stop"
3121+msgstr ""
3122+
3123 #: ../music-app.qml:183
3124-msgid "Stop"
3125-msgstr ""
3126-
3127-#: ../music-app.qml:184
3128 msgid "Stop Playback"
3129 msgstr ""
3130
3131-#: ../music-app.qml:192
3132+#: ../music-app.qml:191
3133 msgid "Music Settings"
3134 msgstr ""
3135
3136 #. TRANSLATORS: This string represents that the target destination filepath does not start with ~/Music/Imported/
3137-#: ../music-app.qml:338
3138+#: ../music-app.qml:337
3139 msgid "Filepath must start with"
3140 msgstr ""
3141
3142 #. TRANSLATORS: This string represents that a blank filepath destination has been used
3143-#: ../music-app.qml:364
3144+#: ../music-app.qml:363
3145 msgid "Filepath must be a file"
3146 msgstr ""
3147
3148 #. TRANSLATORS: This string represents that there was failure moving the file to the target destination
3149-#: ../music-app.qml:370
3150+#: ../music-app.qml:369
3151 msgid "Failed to move file"
3152 msgstr ""
3153
3154-#: ../music-app.qml:447
3155+#: ../music-app.qml:446
3156 msgid "Waiting for file(s)..."
3157 msgstr ""
3158
3159-#: ../music-app.qml:466
3160+#: ../music-app.qml:465
3161 msgid "OK"
3162 msgstr ""
3163
3164-#: ../music-app.qml:479
3165+#: ../music-app.qml:478
3166 msgid "Imported file not found"
3167 msgstr ""
3168
3169-#: ../music-app.qml:483
3170+#: ../music-app.qml:482
3171 msgid "Wait"
3172 msgstr ""
3173
3174 #. TRANSLATORS: this refers to a number of songs greater than one. The actual number will be prepended to the string automatically (plural forms are not yet fully supported in usermetrics, the library that displays that string)
3175+#: ../music-app.qml:503
3176+msgid "songs played today"
3177+msgstr ""
3178+
3179 #: ../music-app.qml:504
3180-msgid "songs played today"
3181-msgstr ""
3182-
3183-#: ../music-app.qml:505
3184 msgid "No songs played today"
3185 msgstr ""
3186
3187-#: ../music-app.qml:613
3188+#: ../music-app.qml:612
3189 msgid "Debug: "
3190 msgstr ""
3191
3192-#: ../music-app.qml:925
3193+#: ../music-app.qml:931
3194 msgid "New Playlist"
3195 msgstr ""
3196
3197-#: ../music-app.qml:926
3198+#: ../music-app.qml:932
3199 msgid "Name your playlist."
3200 msgstr ""
3201
3202-#: ../music-app.qml:930
3203+#: ../music-app.qml:936
3204 msgid "Name"
3205 msgstr ""
3206
3207-#: ../music-app.qml:940
3208+#: ../music-app.qml:946
3209 msgid "Create"
3210 msgstr ""
3211
3212-#: ../music-app.qml:1176
3213+#: ../music-app.qml:1182
3214 msgid "No music found"
3215 msgstr ""
3216
3217-#: ../music-app.qml:1183
3218+#: ../music-app.qml:1189
3219 msgid "Please import music"
3220 msgstr ""
3221
3222
3223=== modified file 'po/pt_BR.po'
3224--- po/pt_BR.po 2014-10-01 06:25:24 +0000
3225+++ po/pt_BR.po 2014-10-08 18:55:11 +0000
3226@@ -1,441 +1,459 @@
3227 # Brazilian Portuguese translation for music-app
3228-# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
3229+# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
3230 # This file is distributed under the same license as the music-app package.
3231-# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
3232+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
3233 #
3234 msgid ""
3235 msgstr ""
3236 "Project-Id-Version: music-app\n"
3237 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
3238+<<<<<<< TREE
3239 "POT-Creation-Date: 2014-09-23 13:43+0100\n"
3240 "PO-Revision-Date: 2014-09-30 17:34+0000\n"
3241 "Last-Translator: Rafael Neri <Unknown>\n"
3242+=======
3243+"POT-Creation-Date: 2014-10-02 20:40-0500\n"
3244+"PO-Revision-Date: 2014-09-30 18:07+0000\n"
3245+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
3246+>>>>>>> MERGE-SOURCE
3247 "Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
3248 "MIME-Version: 1.0\n"
3249 "Content-Type: text/plain; charset=UTF-8\n"
3250 "Content-Transfer-Encoding: 8bit\n"
3251 "Plural-Forms: nplurals=2; plural=n > 1;\n"
3252+<<<<<<< TREE
3253 "X-Launchpad-Export-Date: 2014-10-01 06:25+0000\n"
3254+=======
3255+"X-Launchpad-Export-Date: 2014-10-05 07:28+0000\n"
3256+>>>>>>> MERGE-SOURCE
3257 "X-Generator: Launchpad (build 17196)\n"
3258
3259 #: ../LoginLastFM.qml:48 ../MusicSettings.qml:145 ../MusicSettings.qml:153
3260 msgid "Last.fm"
3261-msgstr "Last.fm"
3262+msgstr ""
3263
3264 #: ../LoginLastFM.qml:54
3265 msgid "Login to be able to scrobble."
3266-msgstr "Faça login para habilitar o scrobble."
3267+msgstr ""
3268
3269 #: ../LoginLastFM.qml:62
3270 msgid "Username"
3271-msgstr "Usuário"
3272+msgstr ""
3273
3274 #: ../LoginLastFM.qml:72
3275 msgid "Password"
3276-msgstr "Senha"
3277+msgstr ""
3278
3279 #: ../LoginLastFM.qml:94
3280 msgid "Login"
3281-msgstr "Login"
3282+msgstr ""
3283
3284 #: ../LoginLastFM.qml:101
3285 msgid "Trying to login..."
3286-msgstr "Tentando entrar..."
3287+msgstr ""
3288
3289 #: ../LoginLastFM.qml:115
3290 msgid "Login Successful"
3291-msgstr "Login realizado com sucesso"
3292+msgstr ""
3293
3294 #: ../LoginLastFM.qml:121
3295 msgid "Login Failed"
3296-msgstr "Falha no login"
3297+msgstr ""
3298
3299 #: ../LoginLastFM.qml:127
3300 msgid "You forgot to set your username and/or password"
3301-msgstr "Você esqueceu de definir seu usuário e/ou senha"
3302+msgstr ""
3303
3304 #: ../MusicAlbums.qml:35 ../MusicStart.qml:392
3305 msgid "Albums"
3306-msgstr "Álbuns"
3307+msgstr ""
3308
3309 #: ../MusicAlbums.qml:152 ../MusicStart.qml:200 ../MusicStart.qml:454
3310 #: ../common/AlbumsPage.qml:264
3311 msgid "Album"
3312-msgstr "Álbum"
3313+msgstr ""
3314
3315 #: ../MusicArtists.qml:37
3316 msgid "Artists"
3317-msgstr "Artistas"
3318+msgstr ""
3319
3320 #: ../MusicArtists.qml:107 ../common/AlbumsPage.qml:112
3321 #, qt-format
3322 msgid "%1 album"
3323 msgid_plural "%1 albums"
3324-msgstr[0] "%1 álbum"
3325-msgstr[1] "%1 álbuns"
3326+msgstr[0] ""
3327+msgstr[1] ""
3328
3329 #: ../MusicArtists.qml:113 ../MusicPlaylists.qml:180 ../MusicStart.qml:371
3330 #: ../MusicaddtoPlaylist.qml:106 ../common/AlbumsPage.qml:331
3331-#: ../common/SongsPage.qml:123 ../common/SongsPage.qml:124
3332+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:139
3333 #, qt-format
3334 msgid "%1 song"
3335 msgid_plural "%1 songs"
3336-msgstr[0] "%1 música"
3337-msgstr[1] "%1 músicas"
3338+msgstr[0] ""
3339+msgstr[1] ""
3340
3341 #: ../MusicArtists.qml:123
3342 msgid "Artist"
3343-msgstr "Artista"
3344+msgstr ""
3345
3346 #: ../MusicNowPlaying.qml:33
3347 msgid "Now Playing"
3348-msgstr "Reproduzindo agora"
3349+msgstr ""
3350
3351 #. TRANSLATORS: this is the name of the playlists page shown in the tab header.
3352 #. Remember to keep the translation short to fit the screen width
3353 #: ../MusicPlaylists.qml:38
3354 msgid "Playlists"
3355-msgstr "Listas de reprodução"
3356+msgstr ""
3357
3358 #: ../MusicPlaylists.qml:48 ../MusicaddtoPlaylist.qml:48
3359 msgid "New playlist"
3360-msgstr "Nova lista de reprodução"
3361+msgstr ""
3362
3363 #. TRANSLATORS: this is a title of a dialog with a prompt to rename a playlist
3364 #: ../MusicPlaylists.qml:64
3365 msgid "Change name"
3366-msgstr "Alterar nome"
3367+msgstr ""
3368
3369 #: ../MusicPlaylists.qml:65
3370 msgid "Enter the new name of the playlist."
3371-msgstr "Inserir o novo nome da lista de reprodução."
3372+msgstr ""
3373
3374 #: ../MusicPlaylists.qml:78
3375 msgid "Change"
3376-msgstr "Alterar"
3377+msgstr ""
3378
3379-#: ../MusicPlaylists.qml:96 ../music-app.qml:956
3380+#: ../MusicPlaylists.qml:96 ../music-app.qml:962
3381 msgid "Playlist already exists"
3382-msgstr "Lista de reprodução já existe"
3383+msgstr ""
3384
3385-#: ../MusicPlaylists.qml:100 ../music-app.qml:961
3386+#: ../MusicPlaylists.qml:100 ../music-app.qml:967
3387 msgid "Please type in a name."
3388-msgstr "Por favor, informe um nome."
3389+msgstr ""
3390
3391-#: ../MusicPlaylists.qml:105 ../music-app.qml:493 ../music-app.qml:967
3392+#: ../MusicPlaylists.qml:105 ../music-app.qml:492 ../music-app.qml:973
3393 msgid "Cancel"
3394-msgstr "Cancelar"
3395+msgstr ""
3396
3397 #: ../MusicPlaylists.qml:159 ../MusicPlaylists.qml:163 ../MusicStart.qml:118
3398-#: ../MusicStart.qml:200 ../common/SongsPage.qml:166
3399-#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:226
3400-#: ../common/SongsPage.qml:244
3401+#: ../MusicStart.qml:200 ../common/SongsPage.qml:114
3402+#: ../common/SongsPage.qml:171 ../common/SongsPage.qml:228
3403+#: ../common/SongsPage.qml:250 ../common/SongsPage.qml:252
3404+#: ../common/SongsPage.qml:270
3405 msgid "Playlist"
3406-msgstr "Lista de reprodução"
3407+msgstr ""
3408
3409-#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:519
3410-#: ../music-app.qml:93 ../music-app.qml:141 ../music-app.qml:147
3411+#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:522
3412+#: ../music-app.qml:92 ../music-app.qml:140 ../music-app.qml:146
3413 msgid "Search"
3414-msgstr "Pesquisar"
3415+msgstr ""
3416
3417-#: ../MusicSettings.qml:30 ../music-app.qml:191
3418+#: ../MusicSettings.qml:30 ../music-app.qml:190
3419 msgid "Settings"
3420-msgstr "Configurações"
3421+msgstr ""
3422
3423 #: ../MusicSettings.qml:81
3424 msgid "Equaliser"
3425-msgstr "Equalizador"
3426+msgstr ""
3427
3428 #: ../MusicSettings.qml:82
3429 msgid "Default"
3430-msgstr "Padrão"
3431+msgstr ""
3432
3433 #: ../MusicSettings.qml:83
3434 msgid "Acoustic"
3435-msgstr "Acústico"
3436+msgstr ""
3437
3438 #: ../MusicSettings.qml:84
3439 msgid "Classical"
3440-msgstr "Clássica"
3441+msgstr ""
3442
3443 #: ../MusicSettings.qml:85
3444 msgid "Electronic"
3445-msgstr "Eletrônica"
3446+msgstr ""
3447
3448 #: ../MusicSettings.qml:86
3449 msgid "Flat"
3450-msgstr "Flat"
3451+msgstr ""
3452
3453 #: ../MusicSettings.qml:87
3454 msgid "Hip Hop"
3455-msgstr "Hip Hop"
3456+msgstr ""
3457
3458 #: ../MusicSettings.qml:88
3459 msgid "Jazz"
3460-msgstr "Jazz"
3461+msgstr ""
3462
3463 #: ../MusicSettings.qml:89
3464 msgid "Metal"
3465-msgstr "Metal"
3466+msgstr ""
3467
3468 #: ../MusicSettings.qml:90
3469 msgid "Pop"
3470-msgstr "Pop"
3471+msgstr ""
3472
3473 #: ../MusicSettings.qml:91
3474 msgid "Rock"
3475-msgstr "Rock"
3476+msgstr ""
3477
3478 #: ../MusicSettings.qml:92
3479 msgid "Custom"
3480-msgstr "Personalizado"
3481+msgstr ""
3482
3483 #: ../MusicSettings.qml:112
3484 msgid ""
3485 "Snap to current song \n"
3486 "when opening toolbar"
3487 msgstr ""
3488-"Ajustar a música atual \n"
3489-"quando abrir a barra de ferramentas"
3490
3491 #: ../MusicSettings.qml:132
3492 msgid "Accounts"
3493-msgstr "Contas"
3494+msgstr ""
3495
3496 #: ../MusicSettings.qml:146
3497 msgid "Login to scrobble and import playlists"
3498-msgstr "Fazer login no scrobble e importar as listas de reprodução"
3499+msgstr ""
3500
3501 #: ../MusicSettings.qml:169
3502 msgid "Music Streaming"
3503-msgstr "Streaming de música"
3504+msgstr ""
3505
3506 #: ../MusicSettings.qml:179
3507 msgid "Ubuntu One"
3508-msgstr "Ubuntu One"
3509+msgstr ""
3510
3511 #: ../MusicSettings.qml:180
3512 msgid "Sign in to stream your cloud music"
3513-msgstr "Fazer login para transmitir suas músicas armazenadas em nuvem"
3514+msgstr ""
3515
3516 #: ../MusicSettings.qml:196
3517 msgid "Stream only on Wi-Fi"
3518-msgstr "Transmitir apenas através de Wi-Fi"
3519+msgstr ""
3520
3521 #: ../MusicSettings.qml:230
3522 msgid "Clean everything!"
3523-msgstr "Limpar tudo!"
3524+msgstr ""
3525
3526-#: ../MusicStart.qml:35 ../music-app.qml:589 ../music-app.qml:1150
3527+#: ../MusicStart.qml:35 ../music-app.qml:588 ../music-app.qml:1156
3528 #: com.ubuntu.music_music.desktop.in.in.h:1
3529 msgid "Music"
3530-msgstr "Música"
3531+msgstr ""
3532
3533 #: ../MusicStart.qml:75
3534 msgid "Recent"
3535-msgstr "Recente"
3536+msgstr ""
3537
3538 #: ../MusicStart.qml:103
3539 msgid "Clear History"
3540-msgstr "Limpar histórico"
3541+msgstr ""
3542
3543 #: ../MusicStart.qml:227
3544 msgid "Genres"
3545-msgstr "Gêneros"
3546+msgstr ""
3547
3548-#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:123
3549-#: ../common/SongsPage.qml:162 ../common/SongsPage.qml:240
3550+#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:115
3551+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:167
3552+#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:266
3553 msgid "Genre"
3554-msgstr "Gênero"
3555+msgstr ""
3556
3557-#: ../MusicToolbar.qml:760
3558-msgid "Tap play to shuffle music"
3559-msgstr "Toque em reproduzir para embaralhar músicas"
3560+#: ../MusicToolbar.qml:767
3561+msgid "Tap to shuffle music"
3562+msgstr ""
3563
3564 #: ../MusicTracks.qml:35
3565 msgid "Songs"
3566-msgstr "Músicas"
3567+msgstr ""
3568
3569 #: ../MusicaddtoPlaylist.qml:41
3570 msgid "Select playlist"
3571-msgstr "Selecione uma lista de reprodução"
3572+msgstr ""
3573
3574 #: ../common/AlbumsPage.qml:167 ../common/AlbumsPage.qml:360
3575-#: ../common/SongsPage.qml:153
3576+#: ../common/SongsPage.qml:218
3577 msgid "Play all"
3578-msgstr "Tocar tudo"
3579+msgstr ""
3580
3581 #: ../common/AlbumsPage.qml:211 ../common/AlbumsPage.qml:400
3582-#: ../common/SongsPage.qml:200 ../music-app.qml:888
3583+#: ../music-app.qml:894
3584 msgid "Add to queue"
3585-msgstr "Adicionar à fila"
3586+msgstr ""
3587
3588-#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:902
3589+#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:908
3590 msgid "Add to playlist"
3591-msgstr "Adicionar à lista de reprodução"
3592+msgstr ""
3593
3594 #: ../common/ListItemActions/AddToQueue.qml:25
3595 msgid "Add to Queue"
3596-msgstr "Adicionar à fila de reprodução"
3597+msgstr ""
3598
3599 #. TRANSLATORS: this refers to deleting a playlist
3600 #: ../common/ListItemActions/DeletePlaylist.qml:26
3601 msgid "Delete"
3602-msgstr "Apagar"
3603+msgstr ""
3604
3605 #. TRANSLATORS: this refers to editing a playlist
3606 #: ../common/ListItemActions/EditPlaylist.qml:26
3607 msgid "Edit"
3608-msgstr "Editar"
3609+msgstr ""
3610
3611 #: ../common/ListItemActions/Remove.qml:27
3612 msgid "Remove"
3613-msgstr "Remover"
3614+msgstr ""
3615
3616 #: ../common/LoadingSpinnerComponent.qml:47
3617 msgid "Loading..."
3618-msgstr "Carregando..."
3619+msgstr ""
3620+
3621+#: ../common/SongsPage.qml:160
3622+msgid "Shuffle"
3623+msgstr ""
3624+
3625+#: ../common/SongsPage.qml:197
3626+msgid "Queue all"
3627+msgstr ""
3628
3629 #: ../common/SwipeDelete.qml:52 ../common/SwipeDelete.qml:88
3630 msgid "Clear"
3631-msgstr "Limpar"
3632+msgstr ""
3633
3634 #: ../meta-database.js:90 ../meta-database.js:92
3635 msgid "Unknown Album"
3636-msgstr "Álbum desconhecido"
3637+msgstr ""
3638
3639 #: ../meta-database.js:91
3640 msgid "Unknown Artist"
3641-msgstr "Artista desconhecido"
3642+msgstr ""
3643
3644-#: ../music-app.qml:142
3645+#: ../music-app.qml:141
3646 msgid "Search Track"
3647-msgstr "Pesquisar faixa"
3648+msgstr ""
3649+
3650+#: ../music-app.qml:153
3651+msgid "Next"
3652+msgstr ""
3653
3654 #: ../music-app.qml:154
3655-msgid "Next"
3656-msgstr "Próximo"
3657-
3658-#: ../music-app.qml:155
3659 msgid "Next Track"
3660-msgstr "Próxima faixa"
3661+msgstr ""
3662
3663-#: ../music-app.qml:161
3664+#: ../music-app.qml:160
3665 msgid "Pause"
3666-msgstr "Pausar"
3667+msgstr ""
3668
3669-#: ../music-app.qml:161
3670+#: ../music-app.qml:160
3671 msgid "Play"
3672-msgstr "Tocar"
3673+msgstr ""
3674
3675-#: ../music-app.qml:163
3676+#: ../music-app.qml:162
3677 msgid "Pause Playback"
3678-msgstr "Pausar Reprodução"
3679+msgstr ""
3680
3681-#: ../music-app.qml:163
3682+#: ../music-app.qml:162
3683 msgid "Continue or start playback"
3684-msgstr "Continuar ou iniciar reprodução"
3685+msgstr ""
3686+
3687+#: ../music-app.qml:167
3688+msgid "Back"
3689+msgstr ""
3690
3691 #: ../music-app.qml:168
3692-msgid "Back"
3693-msgstr "Voltar"
3694-
3695-#: ../music-app.qml:169
3696 msgid "Go back to last page"
3697-msgstr "Voltar para a última página"
3698+msgstr ""
3699+
3700+#: ../music-app.qml:176
3701+msgid "Previous"
3702+msgstr ""
3703
3704 #: ../music-app.qml:177
3705-msgid "Previous"
3706-msgstr "Anterior"
3707-
3708-#: ../music-app.qml:178
3709 msgid "Previous Track"
3710-msgstr "Faixa anterior"
3711+msgstr ""
3712+
3713+#: ../music-app.qml:182
3714+msgid "Stop"
3715+msgstr ""
3716
3717 #: ../music-app.qml:183
3718-msgid "Stop"
3719-msgstr "Parar"
3720-
3721-#: ../music-app.qml:184
3722 msgid "Stop Playback"
3723-msgstr "Parar reprodução"
3724+msgstr ""
3725
3726-#: ../music-app.qml:192
3727+#: ../music-app.qml:191
3728 msgid "Music Settings"
3729-msgstr "Configurações de Música"
3730+msgstr ""
3731
3732 #. TRANSLATORS: This string represents that the target destination filepath does not start with ~/Music/Imported/
3733-#: ../music-app.qml:338
3734+#: ../music-app.qml:337
3735 msgid "Filepath must start with"
3736 msgstr "O caminho do arquivo deve começar com"
3737
3738 #. TRANSLATORS: This string represents that a blank filepath destination has been used
3739-#: ../music-app.qml:364
3740+#: ../music-app.qml:363
3741 msgid "Filepath must be a file"
3742-msgstr "O caminho deve ser de um arquivo"
3743+msgstr ""
3744
3745 #. TRANSLATORS: This string represents that there was failure moving the file to the target destination
3746-#: ../music-app.qml:370
3747+#: ../music-app.qml:369
3748 msgid "Failed to move file"
3749-msgstr "Falhou ao mover arquivo"
3750+msgstr ""
3751
3752-#: ../music-app.qml:447
3753+#: ../music-app.qml:446
3754 msgid "Waiting for file(s)..."
3755 msgstr "Aguardando pelo(s) arquivo(s)"
3756
3757-#: ../music-app.qml:466
3758+#: ../music-app.qml:465
3759 msgid "OK"
3760-msgstr "OK"
3761+msgstr ""
3762
3763-#: ../music-app.qml:479
3764+#: ../music-app.qml:478
3765 msgid "Imported file not found"
3766-msgstr "O arquivo importado não foi encontrado"
3767+msgstr ""
3768
3769-#: ../music-app.qml:483
3770+#: ../music-app.qml:482
3771 msgid "Wait"
3772-msgstr "Aguardando"
3773+msgstr ""
3774
3775 #. TRANSLATORS: this refers to a number of songs greater than one. The actual number will be prepended to the string automatically (plural forms are not yet fully supported in usermetrics, the library that displays that string)
3776+#: ../music-app.qml:503
3777+msgid "songs played today"
3778+msgstr ""
3779+
3780 #: ../music-app.qml:504
3781-msgid "songs played today"
3782-msgstr "músicas tocadas hoje"
3783-
3784-#: ../music-app.qml:505
3785 msgid "No songs played today"
3786-msgstr "Nenhuma música tocada hoje"
3787+msgstr ""
3788
3789-#: ../music-app.qml:613
3790+#: ../music-app.qml:612
3791 msgid "Debug: "
3792-msgstr "Debug: "
3793+msgstr ""
3794
3795-#: ../music-app.qml:925
3796+#: ../music-app.qml:931
3797 msgid "New Playlist"
3798-msgstr "Nova lista de reprodução"
3799+msgstr ""
3800
3801-#: ../music-app.qml:926
3802+#: ../music-app.qml:932
3803 msgid "Name your playlist."
3804-msgstr "Nomear sua lista de reprodução."
3805+msgstr ""
3806
3807-#: ../music-app.qml:930
3808+#: ../music-app.qml:936
3809 msgid "Name"
3810-msgstr "Nome"
3811+msgstr ""
3812
3813-#: ../music-app.qml:940
3814+#: ../music-app.qml:946
3815 msgid "Create"
3816-msgstr "Criar"
3817+msgstr ""
3818
3819-#: ../music-app.qml:1176
3820+#: ../music-app.qml:1182
3821 msgid "No music found"
3822-msgstr "Nenhuma música encontrada"
3823+msgstr ""
3824
3825-#: ../music-app.qml:1183
3826+#: ../music-app.qml:1189
3827 msgid "Please import music"
3828-msgstr "Por favor, importar músicas"
3829+msgstr ""
3830
3831 #: com.ubuntu.music_music.desktop.in.in.h:2
3832 msgid "A music application for Ubuntu"
3833-msgstr "Aplicativo de musica para o Ubuntu"
3834+msgstr ""
3835
3836 #: com.ubuntu.music_music.desktop.in.in.h:3
3837 msgid "music;songs;play;tracks;player;tunes;"
3838-msgstr "música;músicas;tocar;faixas;player;tons;"
3839+msgstr ""
3840
3841=== modified file 'tests/autopilot/music_app/__init__.py'
3842--- tests/autopilot/music_app/__init__.py 2014-09-25 17:58:55 +0000
3843+++ tests/autopilot/music_app/__init__.py 2014-10-08 18:55:11 +0000
3844@@ -21,11 +21,22 @@
3845 return func_wrapper
3846
3847
3848-def ensure_toolbar_visible(func):
3849- """Wrapper which ensures the toolbar is shown before clicking"""
3850- def func_wrapper(self, *args, **kwargs):
3851- if not self.opened:
3852- self.show()
3853+def ensure_now_playing_full(func):
3854+ """Wrapper which ensures the now playing is full before clicking"""
3855+ def func_wrapper(self, *args, **kwargs):
3856+ if self.isListView:
3857+ self.click_toggle_view()
3858+
3859+ return func(self, *args, **kwargs)
3860+
3861+ return func_wrapper
3862+
3863+
3864+def ensure_now_playing_list(func):
3865+ """Wrapper which ensures the now playing is list before clicking"""
3866+ def func_wrapper(self, *args, **kwargs):
3867+ if not self.isListView:
3868+ self.click_toggle_view()
3869
3870 return func(self, *args, **kwargs)
3871
3872@@ -221,96 +232,54 @@
3873 def __init__(self, *args):
3874 super(MusicPage, self).__init__(*args)
3875
3876- def get_count(self):
3877- return self.select_single("QQuickListView",
3878- objectName="nowPlayingQueueList").count
3879-
3880- def get_track(self, i):
3881- return (self.wait_select_single(ListItemWithActions,
3882- objectName="nowPlayingListItem" + str(i)))
3883-
3884-
3885-class AlbumsPage(MusicPage):
3886- """ Autopilot helper for the albums page """
3887- def __init__(self, *args):
3888- super(MusicPage, self).__init__(*args)
3889-
3890- self.visible.wait_for(True)
3891-
3892- @click_object
3893- def click_artist(self, i):
3894- return self.wait_select_single("Standard",
3895- objectName="albumsArtistListItem"
3896- + str(i))
3897-
3898- def get_artist(self):
3899- return self.wait_select_single("Label", objectName="artistLabel").text
3900-
3901-
3902-class SongsPage(MusicPage):
3903- """ Autopilot helper for the songs page """
3904- def __init__(self, *args):
3905- super(MusicPage, self).__init__(*args)
3906-
3907- self.visible.wait_for(True)
3908-
3909- @click_object
3910- def click_track(self, i):
3911- return self.get_track(i)
3912-
3913- def get_header_artist_label(self):
3914- return self.wait_select_single("Label",
3915- objectName="songsPageHeaderAlbumArtist")
3916-
3917- def get_track(self, i):
3918- return (self.wait_select_single(ListItemWithActions,
3919- objectName="songsPageListItem" + str(i)))
3920-
3921-
3922-class MusicToolbar(UbuntuUIToolkitCustomProxyObjectBase):
3923- """Autopilot helper for the toolbar
3924-
3925- expanded - refers to things when the toolbar is in its smaller state
3926- full - refers to things when the toolbar is in its larger state
3927- """
3928- def __init__(self, *args):
3929- super(MusicToolbar, self).__init__(*args)
3930-
3931 root = self.get_root_instance()
3932 self.player = root.select_single(Player, objectName="player")
3933
3934- @ensure_toolbar_visible
3935+ @ensure_now_playing_full
3936 @click_object
3937 def click_forward_button(self):
3938 return self.wait_select_single("*", objectName="forwardShape")
3939
3940- @ensure_toolbar_visible
3941+ @ensure_now_playing_full
3942 @click_object
3943 def click_play_button(self):
3944- if self.currentMode == "full":
3945- return self.wait_select_single("*", objectName="playShape")
3946- else:
3947- return self.wait_select_single("*", objectName="smallPlayShape")
3948+ return self.wait_select_single("*", objectName="playShape")
3949
3950- @ensure_toolbar_visible
3951+ @ensure_now_playing_full
3952 @click_object
3953 def click_previous_button(self):
3954 return self.wait_select_single("*", objectName="previousShape")
3955
3956- @ensure_toolbar_visible
3957+ @ensure_now_playing_full
3958 @click_object
3959 def click_repeat_button(self):
3960 return self.wait_select_single("*", objectName="repeatShape")
3961
3962- @ensure_toolbar_visible
3963+ @ensure_now_playing_full
3964 @click_object
3965 def click_shuffle_button(self):
3966 return self.wait_select_single("*", objectName="shuffleShape")
3967
3968- @ensure_toolbar_visible
3969+ def click_toggle_view(self):
3970+ self.main_view.get_header().click_action_button("toggleView")
3971+
3972+ def get_count(self):
3973+ return self.select_single("QQuickListView",
3974+ objectName="nowPlayingQueueList").count
3975+
3976+ def go_back(self):
3977+ """Use custom back button to go back"""
3978+ self.main_view.get_header().click_custom_back_button()
3979+
3980+ @ensure_now_playing_list
3981+ def get_track(self, i):
3982+ return (self.wait_select_single(ListItemWithActions,
3983+ objectName="nowPlayingListItem" + str(i)))
3984+
3985+ @ensure_now_playing_full
3986 def seek_to(self, percentage):
3987 progress_bar = self.wait_select_single(
3988- "*", objectName="progressBarShape")
3989+ "*", objectName="progressSliderShape")
3990
3991 x1, y1, width, height = progress_bar.globalRect
3992 y1 += height // 2
3993@@ -319,28 +288,77 @@
3994
3995 self.pointing_device.drag(x1, y1, x2, y1)
3996
3997- @ensure_toolbar_visible
3998 def set_repeat(self, state):
3999 if self.player.repeat != state:
4000 self.click_repeat_button()
4001
4002 self.player.repeat.wait_for(state)
4003
4004- @ensure_toolbar_visible
4005 def set_shuffle(self, state):
4006 if self.player.shuffle != state:
4007 self.click_shuffle_button()
4008
4009 self.player.shuffle.wait_for(state)
4010
4011- def show(self):
4012- self.pointing_device.move_to_object(self)
4013-
4014- x1, y1 = self.pointing_device.position()
4015-
4016- y1 -= (self.height / 2) + 1 # get position at top of toolbar
4017-
4018- self.pointing_device.drag(x1, y1, x1, y1 - self.fullHeight)
4019+
4020+class AlbumsPage(MusicPage):
4021+ """ Autopilot helper for the albums page """
4022+ def __init__(self, *args):
4023+ super(MusicPage, self).__init__(*args)
4024+
4025+ self.visible.wait_for(True)
4026+
4027+ @click_object
4028+ def click_artist(self, i):
4029+ return self.wait_select_single("Standard",
4030+ objectName="albumsArtistListItem"
4031+ + str(i))
4032+
4033+ def get_artist(self):
4034+ return self.wait_select_single("Label", objectName="artistLabel").text
4035+
4036+
4037+class SongsPage(MusicPage):
4038+ """ Autopilot helper for the songs page """
4039+ def __init__(self, *args):
4040+ super(MusicPage, self).__init__(*args)
4041+
4042+ self.visible.wait_for(True)
4043+
4044+ @click_object
4045+ def click_track(self, i):
4046+ return self.get_track(i)
4047+
4048+ def get_header_artist_label(self):
4049+ return self.wait_select_single("Label",
4050+ objectName="songsPageHeaderAlbumArtist")
4051+
4052+ def get_track(self, i):
4053+ return (self.wait_select_single(ListItemWithActions,
4054+ objectName="songsPageListItem" + str(i)))
4055+
4056+
4057+class MusicToolbar(UbuntuUIToolkitCustomProxyObjectBase):
4058+ """Autopilot helper for the toolbar"""
4059+ def __init__(self, *args):
4060+ super(MusicToolbar, self).__init__(*args)
4061+
4062+ @click_object
4063+ def click_play_button(self):
4064+ return self.wait_select_single("*", objectName="playShape")
4065+
4066+ @click_object
4067+ def click_jump_to_now_playing(self):
4068+ return self.wait_select_single("*", objectName="jumpNowPlaying")
4069+
4070+ def switch_to_now_playing(self):
4071+ self.click_jump_to_now_playing()
4072+
4073+ root = self.get_root_instance()
4074+ now_playing_page = root.wait_select_single(MusicNowPlaying,
4075+ objectName="nowPlayingPage")
4076+
4077+ now_playing_page.visible.wait_for(True)
4078
4079
4080 class ListItemWithActions(UbuntuUIToolkitCustomProxyObjectBase):
4081
4082=== modified file 'tests/autopilot/music_app/tests/test_music.py'
4083--- tests/autopilot/music_app/tests/test_music.py 2014-09-23 20:45:41 +0000
4084+++ tests/autopilot/music_app/tests/test_music.py 2014-10-08 18:55:11 +0000
4085@@ -91,6 +91,11 @@
4086 Eventually(NotEquals(end_tracks_count)))
4087 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4088
4089+ toolbar.switch_to_now_playing() # Switch to the now playing page
4090+
4091+ # Re get now playing page as it has changed
4092+ now_playing_page = self.app.get_now_playing_page()
4093+
4094 # verify song's metadata matches the item added to the Now Playing view
4095 current_track = now_playing_page.get_track(self.player.currentIndex)
4096
4097@@ -99,14 +104,14 @@
4098 self.assertThat(current_track.get_label_text("titleLabel"),
4099 Equals(self.tracks[0]["title"]))
4100
4101- # click on close button to close the page
4102- self.app.main_view.go_back()
4103+ # click on close button to close the page and now playing page
4104+ now_playing_page.go_back()
4105
4106- # click the play button to start playing
4107+ # click the play button (toolbar) to start playing
4108 toolbar.click_play_button()
4109 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4110
4111- # click the play button to stop playing
4112+ # click the play button (toolbar) to stop playing
4113 toolbar.click_play_button()
4114 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4115
4116@@ -115,15 +120,15 @@
4117
4118 self.app.populate_queue() # populate queue
4119
4120- toolbar = self.app.get_toolbar()
4121+ now_playing_page = self.app.get_now_playing_page()
4122
4123 # check that the player is playing and then select pause
4124 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4125- toolbar.click_play_button()
4126+ now_playing_page.click_play_button()
4127
4128 # check that the player is paused and then select play
4129 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4130- toolbar.click_play_button()
4131+ now_playing_page.click_play_button()
4132
4133 # check that the player is playing
4134 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4135@@ -133,7 +138,7 @@
4136
4137 self.app.populate_queue() # populate queue
4138
4139- toolbar = self.app.get_toolbar()
4140+ now_playing_page = self.app.get_now_playing_page()
4141
4142 # save original song data for later
4143 org_title = self.player.currentMetaTitle
4144@@ -144,17 +149,17 @@
4145 logger.debug("Original Song %s, %s" % (org_title, org_artist))
4146
4147 # select pause and check the player has stopped
4148- toolbar.click_play_button()
4149+ now_playing_page.click_play_button()
4150 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4151
4152- toolbar.set_shuffle(False) # ensure shuffe is off
4153+ now_playing_page.set_shuffle(False) # ensure shuffe is off
4154
4155 # goal is to go back and forth and ensure 2 different songs
4156- toolbar.click_forward_button()
4157+ now_playing_page.click_forward_button()
4158 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4159
4160 # select pause and check the player has stopped
4161- toolbar.click_play_button()
4162+ now_playing_page.click_play_button()
4163 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4164
4165 # ensure different song
4166@@ -166,14 +171,14 @@
4167 logger.debug("Next Song %s, %s" % (self.player.currentMetaTitle,
4168 self.player.currentMetaArtist))
4169
4170- toolbar.seek_to(0) # seek to 0 (start)
4171+ now_playing_page.seek_to(0) # seek to 0 (start)
4172
4173 # select previous and ensure the track is playing
4174- toolbar.click_previous_button()
4175+ now_playing_page.click_previous_button()
4176 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4177
4178 # select pause and check the player has stopped
4179- toolbar.click_play_button()
4180+ now_playing_page.click_play_button()
4181 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4182
4183 # ensure we're back to original song
4184@@ -207,13 +212,13 @@
4185 self.assertThat(self.player.source.endswith("mp3"),
4186 Equals(True))
4187
4188- # Start playing the track
4189+ # Start playing the track (click from toolbar)
4190 toolbar.click_play_button()
4191
4192 # Check that the track is playing
4193 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4194
4195- # Stop playing the track
4196+ # Stop playing the track (click from toolbar)
4197 toolbar.click_play_button()
4198
4199 # Check current meta data is correct
4200@@ -229,15 +234,15 @@
4201
4202 # at this point the track is playing and shuffle is enabled
4203
4204- toolbar = self.app.get_toolbar()
4205+ now_playing_page = self.app.get_now_playing_page()
4206
4207 # pause the track if it is playing
4208 if self.player.isPlaying:
4209- toolbar.click_play_button()
4210+ now_playing_page.click_play_button()
4211
4212 self.player.isPlaying.wait_for(False)
4213
4214- toolbar.set_shuffle(True) # enable shuffle
4215+ now_playing_page.set_shuffle(True) # enable shuffle
4216
4217 # save original song metadata
4218 org_title = self.player.currentMetaTitle
4219@@ -256,11 +261,11 @@
4220 self.assertThat(count, LessThan(100))
4221
4222 # select next track
4223- toolbar.click_forward_button()
4224+ now_playing_page.click_forward_button()
4225
4226 # pause the track if it is playing
4227 if self.player.isPlaying:
4228- toolbar.click_play_button()
4229+ now_playing_page.click_play_button()
4230
4231 # check it is paused
4232 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4233@@ -270,11 +275,11 @@
4234
4235 # select previous track while will break if this previous track
4236 # is different and therefore a shuffle has occurred
4237- toolbar.click_previous_button()
4238+ now_playing_page.click_previous_button()
4239
4240 # pause the track if it is playing
4241 if self.player.isPlaying:
4242- toolbar.click_play_button()
4243+ now_playing_page.click_play_button()
4244
4245 # check it is paused
4246 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4247@@ -314,6 +319,7 @@
4248 """tests navigating to the Albums tab and adding a song to queue"""
4249
4250 now_playing_page = self.app.get_now_playing_page()
4251+ toolbar = self.app.get_toolbar()
4252
4253 # get number of tracks in queue before queuing a track
4254 initial_tracks_count = now_playing_page.get_count()
4255@@ -341,6 +347,11 @@
4256 # Assert that the song added to the list is not playing
4257 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4258
4259+ toolbar.switch_to_now_playing() # Switch to the now playing page
4260+
4261+ # Re get now playing page as it has changed
4262+ now_playing_page = self.app.get_now_playing_page()
4263+
4264 # verify song's metadata matches the item added to the Now Playing view
4265 current_track = now_playing_page.get_track(self.player.currentIndex)
4266
4267@@ -349,8 +360,8 @@
4268 self.assertThat(current_track.get_label_text("titleLabel"),
4269 Equals(tracks[0]["title"]))
4270
4271- # click on close button to close songs page
4272- self.app.main_view.go_back()
4273+ # click on close button to close nowplaying and songs page
4274+ now_playing_page.go_back()
4275
4276 # check that the albums page is now visible
4277 self.assertThat(albums_page.visible, Eventually(Equals(True)))
4278@@ -391,6 +402,7 @@
4279 to the queue via the expandable list view item. """
4280
4281 now_playing_page = self.app.get_now_playing_page()
4282+ toolbar = self.app.get_toolbar()
4283
4284 # get number of tracks in queue before queuing a track
4285 initial_tracks_count = now_playing_page.get_count()
4286@@ -413,6 +425,11 @@
4287 Eventually(NotEquals(now_playing_page.get_count())))
4288 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4289
4290+ toolbar.switch_to_now_playing() # Switch to the now playing page
4291+
4292+ # Re get now playing page as it has changed
4293+ now_playing_page = self.app.get_now_playing_page()
4294+
4295 # verify song's metadata matches the item added to the Now Playing view
4296 current_track = now_playing_page.get_track(self.player.currentIndex)
4297
4298@@ -552,14 +569,13 @@
4299 self.app.populate_queue() # populate queue
4300
4301 now_playing_page = self.app.get_now_playing_page()
4302- toolbar = self.app.get_toolbar()
4303
4304- toolbar.set_shuffle(False)
4305- toolbar.set_repeat(False)
4306+ now_playing_page.set_shuffle(False)
4307+ now_playing_page.set_repeat(False)
4308
4309 # Skip through all songs in queue, stopping on last one.
4310 for count in range(0, now_playing_page.get_count() - 1):
4311- toolbar.click_forward_button()
4312+ now_playing_page.click_forward_button()
4313
4314 # When the last song ends, playback should stop
4315 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4316@@ -570,14 +586,13 @@
4317 self.app.populate_queue() # populate queue
4318
4319 now_playing_page = self.app.get_now_playing_page()
4320- toolbar = self.app.get_toolbar()
4321
4322- toolbar.set_shuffle(False)
4323- toolbar.set_repeat(True)
4324+ now_playing_page.set_shuffle(False)
4325+ now_playing_page.set_repeat(True)
4326
4327 # Skip through all songs in queue, stopping on last one.
4328 for count in range(0, now_playing_page.get_count() - 1):
4329- toolbar.click_forward_button()
4330+ now_playing_page.click_forward_button()
4331
4332 # Make sure we loop back to first song after last song ends
4333 self.assertThat(self.player.currentMetaTitle,
4334@@ -590,14 +605,13 @@
4335 self.app.populate_queue() # populate queue
4336
4337 now_playing_page = self.app.get_now_playing_page()
4338- toolbar = self.app.get_toolbar()
4339
4340- toolbar.set_shuffle(False)
4341- toolbar.set_repeat(True)
4342+ now_playing_page.set_shuffle(False)
4343+ now_playing_page.set_repeat(True)
4344
4345 # Skip through all songs in queue, INCLUDING last one.
4346 for count in range(0, now_playing_page.get_count() - 1):
4347- toolbar.click_forward_button()
4348+ now_playing_page.click_forward_button()
4349
4350 # Make sure we loop back to first song after last song ends
4351 self.assertThat(self.player.currentMetaTitle,
4352@@ -609,19 +623,19 @@
4353
4354 self.app.populate_queue() # populate queue
4355
4356- toolbar = self.app.get_toolbar()
4357+ now_playing_page = self.app.get_now_playing_page()
4358
4359- toolbar.set_shuffle(False)
4360- toolbar.set_repeat(True)
4361+ now_playing_page.set_shuffle(False)
4362+ now_playing_page.set_repeat(True)
4363
4364 initial_song = self.player.currentMetaTitle
4365- toolbar.click_previous_button()
4366+ now_playing_page.click_previous_button()
4367
4368 # If we're far enough into a song, pressing prev just takes us to the
4369 # beginning of that track. In that case, hit prev again to actually
4370 # skip over the track.
4371 if self.player.currentMetaTitle == initial_song:
4372- toolbar.click_previous_button()
4373+ now_playing_page.click_previous_button()
4374
4375 self.assertThat(self.player.currentMetaTitle,
4376 Eventually(Equals(self.tracks[-1]["title"])))
4377@@ -632,17 +646,17 @@
4378
4379 self.app.populate_queue() # populate queue
4380
4381- toolbar = self.app.get_toolbar()
4382+ now_playing_page = self.app.get_now_playing_page()
4383
4384 self.player.isPlaying.wait_for(True) # ensure the track is playing
4385 self.player.position.wait_for(GreaterThan(5000)) # wait until > 5s
4386
4387- toolbar.click_play_button() # pause the track
4388+ now_playing_page.click_play_button() # pause the track
4389 self.player.isPlaying.wait_for(False) # ensure the track has paused
4390
4391 source = self.player.source # store current source
4392
4393- toolbar.click_previous_button() # click previous
4394+ now_playing_page.click_previous_button() # click previous
4395
4396 self.player.position.wait_for(LessThan(5000)) # wait until < 5s
4397

Subscribers

People subscribed via source and target branches

to status/vote changes: