Merge lp:~vthompson/music-app/remix-do-not-switch-to-full-view into lp:music-app/trusty

Proposed by Victor Thompson
Status: Superseded
Proposed branch: lp:~vthompson/music-app/remix-do-not-switch-to-full-view
Merge into: lp:music-app/trusty
Diff against target: 4405 lines (+1477/-1625) (has conflicts)
24 files modified
MusicAlbums.qml (+21/-123)
MusicArtists.qml (+3/-2)
MusicNowPlaying.qml (+323/-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 (+24/-30)
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:~vthompson/music-app/remix-do-not-switch-to-full-view
Reviewer Review Type Date Requested Status
Music App Developers Pending
Review via email: mp+237712@code.launchpad.net

This proposal has been superseded by a proposal from 2014-10-09.

Commit message

Do not switch to full view if clicking a song in the queue.

Description of the change

Commit #656 had a regression in that when an item in the queue is clicked, the view now switches to the Now Playing full view. This is incorrect, it should stay at the current view.

To post a comment you must log in.

Unmerged revisions

657. By Victor Thompson

Do not switch to full view if clicking a song in the queue.

656. By Andrew Hayzen

* From the toolbar always jump to full view (eg if toolbar is selected in queue view jump to full).

Approved by Ubuntu Phone Apps Jenkins Bot, Victor Thompson.

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

Subscribers

People subscribed via source and target branches

to status/vote changes: