Merge lp:~vthompson/music-app/remix-do-not-translate-splash-color into lp:music-app/trusty

Proposed by Victor Thompson
Status: Superseded
Proposed branch: lp:~vthompson/music-app/remix-do-not-translate-splash-color
Merge into: lp:music-app/trusty
Diff against target: 4399 lines (+1473/-1624) (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 (+20/-29)
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-translate-splash-color
Reviewer Review Type Date Requested Status
David Planella Pending
Music App Developers Pending
Review via email: mp+237771@code.launchpad.net

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

Commit message

Fix Ubuntu-Splash-Color to not get pulled into translations

Description of the change

Commit #650 [1] added a splash screen upon startup with a manually set color. This worked, however, when the pot file is generated the hex color string is being added to the list of translatable strings. This needs to be fixed, as translations should not control the color code.

I'm not updating the POT file here, as that is being done in another MP that is updating the strings. This MP [2] is what surfaced the issue.

[1] http://bazaar.launchpad.net/~music-app-dev/music-app/remix/revision/650
[2] https://code.launchpad.net/~vthompson/music-app/remix-queue-list

To post a comment you must log in.

Unmerged revisions

657. By Victor Thompson

Fix Ubuntu-Splash-Color to not get pulled into translations

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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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 12:26:51 +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@@ -699,8 +683,6 @@
2868 // Show the Now Playing page and make sure the track is visible
2869 tabs.pushNowPlaying();
2870 nowPlaying.ensureVisibleIndex = index;
2871-
2872- musicToolbar.showToolbar();
2873 }
2874
2875 function playRandomSong(shuffle)
2876@@ -716,6 +698,17 @@
2877 trackClicked(allSongsModel, index, true)
2878 }
2879
2880+ function shuffleModel(model)
2881+ {
2882+ var now = new Date();
2883+ var seed = now.getSeconds();
2884+ var index = Math.floor(model.count * Math.random(seed));
2885+
2886+ player.shuffle = true;
2887+
2888+ trackClicked(model, index, true)
2889+ }
2890+
2891 // Load mediascanner store
2892 MediaStore {
2893 id: musicStore
2894@@ -867,10 +860,6 @@
2895 id: searchSheet
2896 }
2897
2898- // Blurred background
2899- BlurredBackground {
2900- }
2901-
2902 // Popover for tracks, queue and add to playlist, for example
2903 Component {
2904 id: trackPopoverComponent
2905@@ -973,6 +962,7 @@
2906
2907 MusicToolbar {
2908 id: musicToolbar
2909+ visible: nowPlaying.isListView || !nowPlaying.visible
2910 objectName: "musicToolbarObject"
2911 z: 200 // put on top of everything else
2912 }
2913@@ -983,7 +973,6 @@
2914 Tabs {
2915 id: tabs
2916 anchors {
2917- bottomMargin: wideAspect ? musicToolbar.fullHeight : undefined
2918 fill: parent
2919 }
2920
2921@@ -1110,6 +1099,8 @@
2922 if (mainPageStack.currentPage !== nowPlaying) {
2923 mainPageStack.push(nowPlaying);
2924 }
2925+
2926+ nowPlaying.isListView = false; // ensure full view
2927 }
2928
2929 Component.onCompleted: musicToolbar.currentTab = selectedTab
2930
2931=== modified file 'po/com.ubuntu.music.pot'
2932--- po/com.ubuntu.music.pot 2014-09-23 12:44:36 +0000
2933+++ po/com.ubuntu.music.pot 2014-10-09 12:26:51 +0000
2934@@ -8,7 +8,7 @@
2935 msgstr ""
2936 "Project-Id-Version: music-app\n"
2937 "Report-Msgid-Bugs-To: \n"
2938-"POT-Creation-Date: 2014-09-23 13:43+0100\n"
2939+"POT-Creation-Date: 2014-10-02 20:40-0500\n"
2940 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
2941 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
2942 "Language-Team: LANGUAGE <LL@li.org>\n"
2943@@ -76,7 +76,7 @@
2944
2945 #: ../MusicArtists.qml:113 ../MusicPlaylists.qml:180 ../MusicStart.qml:371
2946 #: ../MusicaddtoPlaylist.qml:106 ../common/AlbumsPage.qml:331
2947-#: ../common/SongsPage.qml:123 ../common/SongsPage.qml:124
2948+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:139
2949 #, qt-format
2950 msgid "%1 song"
2951 msgid_plural "%1 songs"
2952@@ -114,31 +114,32 @@
2953 msgid "Change"
2954 msgstr ""
2955
2956-#: ../MusicPlaylists.qml:96 ../music-app.qml:956
2957+#: ../MusicPlaylists.qml:96 ../music-app.qml:962
2958 msgid "Playlist already exists"
2959 msgstr ""
2960
2961-#: ../MusicPlaylists.qml:100 ../music-app.qml:961
2962+#: ../MusicPlaylists.qml:100 ../music-app.qml:967
2963 msgid "Please type in a name."
2964 msgstr ""
2965
2966-#: ../MusicPlaylists.qml:105 ../music-app.qml:493 ../music-app.qml:967
2967+#: ../MusicPlaylists.qml:105 ../music-app.qml:492 ../music-app.qml:973
2968 msgid "Cancel"
2969 msgstr ""
2970
2971 #: ../MusicPlaylists.qml:159 ../MusicPlaylists.qml:163 ../MusicStart.qml:118
2972-#: ../MusicStart.qml:200 ../common/SongsPage.qml:166
2973-#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:226
2974-#: ../common/SongsPage.qml:244
2975+#: ../MusicStart.qml:200 ../common/SongsPage.qml:114
2976+#: ../common/SongsPage.qml:171 ../common/SongsPage.qml:228
2977+#: ../common/SongsPage.qml:250 ../common/SongsPage.qml:252
2978+#: ../common/SongsPage.qml:270
2979 msgid "Playlist"
2980 msgstr ""
2981
2982-#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:519
2983-#: ../music-app.qml:93 ../music-app.qml:141 ../music-app.qml:147
2984+#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:522
2985+#: ../music-app.qml:92 ../music-app.qml:140 ../music-app.qml:146
2986 msgid "Search"
2987 msgstr ""
2988
2989-#: ../MusicSettings.qml:30 ../music-app.qml:191
2990+#: ../MusicSettings.qml:30 ../music-app.qml:190
2991 msgid "Settings"
2992 msgstr ""
2993
2994@@ -224,7 +225,7 @@
2995 msgid "Clean everything!"
2996 msgstr ""
2997
2998-#: ../MusicStart.qml:35 ../music-app.qml:589 ../music-app.qml:1150
2999+#: ../MusicStart.qml:35 ../music-app.qml:588 ../music-app.qml:1156
3000 #: com.ubuntu.music_music.desktop.in.in.h:1
3001 msgid "Music"
3002 msgstr ""
3003@@ -241,13 +242,14 @@
3004 msgid "Genres"
3005 msgstr ""
3006
3007-#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:123
3008-#: ../common/SongsPage.qml:162 ../common/SongsPage.qml:240
3009+#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:115
3010+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:167
3011+#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:266
3012 msgid "Genre"
3013 msgstr ""
3014
3015-#: ../MusicToolbar.qml:760
3016-msgid "Tap play to shuffle music"
3017+#: ../MusicToolbar.qml:767
3018+msgid "Tap to shuffle music"
3019 msgstr ""
3020
3021 #: ../MusicTracks.qml:35
3022@@ -259,16 +261,16 @@
3023 msgstr ""
3024
3025 #: ../common/AlbumsPage.qml:167 ../common/AlbumsPage.qml:360
3026-#: ../common/SongsPage.qml:153
3027+#: ../common/SongsPage.qml:218
3028 msgid "Play all"
3029 msgstr ""
3030
3031 #: ../common/AlbumsPage.qml:211 ../common/AlbumsPage.qml:400
3032-#: ../common/SongsPage.qml:200 ../music-app.qml:888
3033+#: ../music-app.qml:894
3034 msgid "Add to queue"
3035 msgstr ""
3036
3037-#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:902
3038+#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:908
3039 msgid "Add to playlist"
3040 msgstr ""
3041
3042@@ -294,6 +296,14 @@
3043 msgid "Loading..."
3044 msgstr ""
3045
3046+#: ../common/SongsPage.qml:160
3047+msgid "Shuffle"
3048+msgstr ""
3049+
3050+#: ../common/SongsPage.qml:197
3051+msgid "Queue all"
3052+msgstr ""
3053+
3054 #: ../common/SwipeDelete.qml:52 ../common/SwipeDelete.qml:88
3055 msgid "Clear"
3056 msgstr ""
3057@@ -306,127 +316,127 @@
3058 msgid "Unknown Artist"
3059 msgstr ""
3060
3061-#: ../music-app.qml:142
3062+#: ../music-app.qml:141
3063 msgid "Search Track"
3064 msgstr ""
3065
3066+#: ../music-app.qml:153
3067+msgid "Next"
3068+msgstr ""
3069+
3070 #: ../music-app.qml:154
3071-msgid "Next"
3072-msgstr ""
3073-
3074-#: ../music-app.qml:155
3075 msgid "Next Track"
3076 msgstr ""
3077
3078-#: ../music-app.qml:161
3079+#: ../music-app.qml:160
3080 msgid "Pause"
3081 msgstr ""
3082
3083-#: ../music-app.qml:161
3084+#: ../music-app.qml:160
3085 msgid "Play"
3086 msgstr ""
3087
3088-#: ../music-app.qml:163
3089+#: ../music-app.qml:162
3090 msgid "Pause Playback"
3091 msgstr ""
3092
3093-#: ../music-app.qml:163
3094+#: ../music-app.qml:162
3095 msgid "Continue or start playback"
3096 msgstr ""
3097
3098+#: ../music-app.qml:167
3099+msgid "Back"
3100+msgstr ""
3101+
3102 #: ../music-app.qml:168
3103-msgid "Back"
3104-msgstr ""
3105-
3106-#: ../music-app.qml:169
3107 msgid "Go back to last page"
3108 msgstr ""
3109
3110+#: ../music-app.qml:176
3111+msgid "Previous"
3112+msgstr ""
3113+
3114 #: ../music-app.qml:177
3115-msgid "Previous"
3116-msgstr ""
3117-
3118-#: ../music-app.qml:178
3119 msgid "Previous Track"
3120 msgstr ""
3121
3122+#: ../music-app.qml:182
3123+msgid "Stop"
3124+msgstr ""
3125+
3126 #: ../music-app.qml:183
3127-msgid "Stop"
3128-msgstr ""
3129-
3130-#: ../music-app.qml:184
3131 msgid "Stop Playback"
3132 msgstr ""
3133
3134-#: ../music-app.qml:192
3135+#: ../music-app.qml:191
3136 msgid "Music Settings"
3137 msgstr ""
3138
3139 #. TRANSLATORS: This string represents that the target destination filepath does not start with ~/Music/Imported/
3140-#: ../music-app.qml:338
3141+#: ../music-app.qml:337
3142 msgid "Filepath must start with"
3143 msgstr ""
3144
3145 #. TRANSLATORS: This string represents that a blank filepath destination has been used
3146-#: ../music-app.qml:364
3147+#: ../music-app.qml:363
3148 msgid "Filepath must be a file"
3149 msgstr ""
3150
3151 #. TRANSLATORS: This string represents that there was failure moving the file to the target destination
3152-#: ../music-app.qml:370
3153+#: ../music-app.qml:369
3154 msgid "Failed to move file"
3155 msgstr ""
3156
3157-#: ../music-app.qml:447
3158+#: ../music-app.qml:446
3159 msgid "Waiting for file(s)..."
3160 msgstr ""
3161
3162-#: ../music-app.qml:466
3163+#: ../music-app.qml:465
3164 msgid "OK"
3165 msgstr ""
3166
3167-#: ../music-app.qml:479
3168+#: ../music-app.qml:478
3169 msgid "Imported file not found"
3170 msgstr ""
3171
3172-#: ../music-app.qml:483
3173+#: ../music-app.qml:482
3174 msgid "Wait"
3175 msgstr ""
3176
3177 #. 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)
3178+#: ../music-app.qml:503
3179+msgid "songs played today"
3180+msgstr ""
3181+
3182 #: ../music-app.qml:504
3183-msgid "songs played today"
3184-msgstr ""
3185-
3186-#: ../music-app.qml:505
3187 msgid "No songs played today"
3188 msgstr ""
3189
3190-#: ../music-app.qml:613
3191+#: ../music-app.qml:612
3192 msgid "Debug: "
3193 msgstr ""
3194
3195-#: ../music-app.qml:925
3196+#: ../music-app.qml:931
3197 msgid "New Playlist"
3198 msgstr ""
3199
3200-#: ../music-app.qml:926
3201+#: ../music-app.qml:932
3202 msgid "Name your playlist."
3203 msgstr ""
3204
3205-#: ../music-app.qml:930
3206+#: ../music-app.qml:936
3207 msgid "Name"
3208 msgstr ""
3209
3210-#: ../music-app.qml:940
3211+#: ../music-app.qml:946
3212 msgid "Create"
3213 msgstr ""
3214
3215-#: ../music-app.qml:1176
3216+#: ../music-app.qml:1182
3217 msgid "No music found"
3218 msgstr ""
3219
3220-#: ../music-app.qml:1183
3221+#: ../music-app.qml:1189
3222 msgid "Please import music"
3223 msgstr ""
3224
3225
3226=== modified file 'po/pt_BR.po'
3227--- po/pt_BR.po 2014-10-01 06:25:24 +0000
3228+++ po/pt_BR.po 2014-10-09 12:26:51 +0000
3229@@ -1,441 +1,459 @@
3230 # Brazilian Portuguese translation for music-app
3231-# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
3232+# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
3233 # This file is distributed under the same license as the music-app package.
3234-# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
3235+# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
3236 #
3237 msgid ""
3238 msgstr ""
3239 "Project-Id-Version: music-app\n"
3240 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
3241+<<<<<<< TREE
3242 "POT-Creation-Date: 2014-09-23 13:43+0100\n"
3243 "PO-Revision-Date: 2014-09-30 17:34+0000\n"
3244 "Last-Translator: Rafael Neri <Unknown>\n"
3245+=======
3246+"POT-Creation-Date: 2014-10-02 20:40-0500\n"
3247+"PO-Revision-Date: 2014-09-30 18:07+0000\n"
3248+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
3249+>>>>>>> MERGE-SOURCE
3250 "Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
3251 "MIME-Version: 1.0\n"
3252 "Content-Type: text/plain; charset=UTF-8\n"
3253 "Content-Transfer-Encoding: 8bit\n"
3254 "Plural-Forms: nplurals=2; plural=n > 1;\n"
3255+<<<<<<< TREE
3256 "X-Launchpad-Export-Date: 2014-10-01 06:25+0000\n"
3257+=======
3258+"X-Launchpad-Export-Date: 2014-10-05 07:28+0000\n"
3259+>>>>>>> MERGE-SOURCE
3260 "X-Generator: Launchpad (build 17196)\n"
3261
3262 #: ../LoginLastFM.qml:48 ../MusicSettings.qml:145 ../MusicSettings.qml:153
3263 msgid "Last.fm"
3264-msgstr "Last.fm"
3265+msgstr ""
3266
3267 #: ../LoginLastFM.qml:54
3268 msgid "Login to be able to scrobble."
3269-msgstr "Faça login para habilitar o scrobble."
3270+msgstr ""
3271
3272 #: ../LoginLastFM.qml:62
3273 msgid "Username"
3274-msgstr "Usuário"
3275+msgstr ""
3276
3277 #: ../LoginLastFM.qml:72
3278 msgid "Password"
3279-msgstr "Senha"
3280+msgstr ""
3281
3282 #: ../LoginLastFM.qml:94
3283 msgid "Login"
3284-msgstr "Login"
3285+msgstr ""
3286
3287 #: ../LoginLastFM.qml:101
3288 msgid "Trying to login..."
3289-msgstr "Tentando entrar..."
3290+msgstr ""
3291
3292 #: ../LoginLastFM.qml:115
3293 msgid "Login Successful"
3294-msgstr "Login realizado com sucesso"
3295+msgstr ""
3296
3297 #: ../LoginLastFM.qml:121
3298 msgid "Login Failed"
3299-msgstr "Falha no login"
3300+msgstr ""
3301
3302 #: ../LoginLastFM.qml:127
3303 msgid "You forgot to set your username and/or password"
3304-msgstr "Você esqueceu de definir seu usuário e/ou senha"
3305+msgstr ""
3306
3307 #: ../MusicAlbums.qml:35 ../MusicStart.qml:392
3308 msgid "Albums"
3309-msgstr "Álbuns"
3310+msgstr ""
3311
3312 #: ../MusicAlbums.qml:152 ../MusicStart.qml:200 ../MusicStart.qml:454
3313 #: ../common/AlbumsPage.qml:264
3314 msgid "Album"
3315-msgstr "Álbum"
3316+msgstr ""
3317
3318 #: ../MusicArtists.qml:37
3319 msgid "Artists"
3320-msgstr "Artistas"
3321+msgstr ""
3322
3323 #: ../MusicArtists.qml:107 ../common/AlbumsPage.qml:112
3324 #, qt-format
3325 msgid "%1 album"
3326 msgid_plural "%1 albums"
3327-msgstr[0] "%1 álbum"
3328-msgstr[1] "%1 álbuns"
3329+msgstr[0] ""
3330+msgstr[1] ""
3331
3332 #: ../MusicArtists.qml:113 ../MusicPlaylists.qml:180 ../MusicStart.qml:371
3333 #: ../MusicaddtoPlaylist.qml:106 ../common/AlbumsPage.qml:331
3334-#: ../common/SongsPage.qml:123 ../common/SongsPage.qml:124
3335+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:139
3336 #, qt-format
3337 msgid "%1 song"
3338 msgid_plural "%1 songs"
3339-msgstr[0] "%1 música"
3340-msgstr[1] "%1 músicas"
3341+msgstr[0] ""
3342+msgstr[1] ""
3343
3344 #: ../MusicArtists.qml:123
3345 msgid "Artist"
3346-msgstr "Artista"
3347+msgstr ""
3348
3349 #: ../MusicNowPlaying.qml:33
3350 msgid "Now Playing"
3351-msgstr "Reproduzindo agora"
3352+msgstr ""
3353
3354 #. TRANSLATORS: this is the name of the playlists page shown in the tab header.
3355 #. Remember to keep the translation short to fit the screen width
3356 #: ../MusicPlaylists.qml:38
3357 msgid "Playlists"
3358-msgstr "Listas de reprodução"
3359+msgstr ""
3360
3361 #: ../MusicPlaylists.qml:48 ../MusicaddtoPlaylist.qml:48
3362 msgid "New playlist"
3363-msgstr "Nova lista de reprodução"
3364+msgstr ""
3365
3366 #. TRANSLATORS: this is a title of a dialog with a prompt to rename a playlist
3367 #: ../MusicPlaylists.qml:64
3368 msgid "Change name"
3369-msgstr "Alterar nome"
3370+msgstr ""
3371
3372 #: ../MusicPlaylists.qml:65
3373 msgid "Enter the new name of the playlist."
3374-msgstr "Inserir o novo nome da lista de reprodução."
3375+msgstr ""
3376
3377 #: ../MusicPlaylists.qml:78
3378 msgid "Change"
3379-msgstr "Alterar"
3380+msgstr ""
3381
3382-#: ../MusicPlaylists.qml:96 ../music-app.qml:956
3383+#: ../MusicPlaylists.qml:96 ../music-app.qml:962
3384 msgid "Playlist already exists"
3385-msgstr "Lista de reprodução já existe"
3386+msgstr ""
3387
3388-#: ../MusicPlaylists.qml:100 ../music-app.qml:961
3389+#: ../MusicPlaylists.qml:100 ../music-app.qml:967
3390 msgid "Please type in a name."
3391-msgstr "Por favor, informe um nome."
3392+msgstr ""
3393
3394-#: ../MusicPlaylists.qml:105 ../music-app.qml:493 ../music-app.qml:967
3395+#: ../MusicPlaylists.qml:105 ../music-app.qml:492 ../music-app.qml:973
3396 msgid "Cancel"
3397-msgstr "Cancelar"
3398+msgstr ""
3399
3400 #: ../MusicPlaylists.qml:159 ../MusicPlaylists.qml:163 ../MusicStart.qml:118
3401-#: ../MusicStart.qml:200 ../common/SongsPage.qml:166
3402-#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:226
3403-#: ../common/SongsPage.qml:244
3404+#: ../MusicStart.qml:200 ../common/SongsPage.qml:114
3405+#: ../common/SongsPage.qml:171 ../common/SongsPage.qml:228
3406+#: ../common/SongsPage.qml:250 ../common/SongsPage.qml:252
3407+#: ../common/SongsPage.qml:270
3408 msgid "Playlist"
3409-msgstr "Lista de reprodução"
3410+msgstr ""
3411
3412-#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:519
3413-#: ../music-app.qml:93 ../music-app.qml:141 ../music-app.qml:147
3414+#: ../MusicSearch.qml:44 ../MusicSearch.qml:75 ../MusicToolbar.qml:522
3415+#: ../music-app.qml:92 ../music-app.qml:140 ../music-app.qml:146
3416 msgid "Search"
3417-msgstr "Pesquisar"
3418+msgstr ""
3419
3420-#: ../MusicSettings.qml:30 ../music-app.qml:191
3421+#: ../MusicSettings.qml:30 ../music-app.qml:190
3422 msgid "Settings"
3423-msgstr "Configurações"
3424+msgstr ""
3425
3426 #: ../MusicSettings.qml:81
3427 msgid "Equaliser"
3428-msgstr "Equalizador"
3429+msgstr ""
3430
3431 #: ../MusicSettings.qml:82
3432 msgid "Default"
3433-msgstr "Padrão"
3434+msgstr ""
3435
3436 #: ../MusicSettings.qml:83
3437 msgid "Acoustic"
3438-msgstr "Acústico"
3439+msgstr ""
3440
3441 #: ../MusicSettings.qml:84
3442 msgid "Classical"
3443-msgstr "Clássica"
3444+msgstr ""
3445
3446 #: ../MusicSettings.qml:85
3447 msgid "Electronic"
3448-msgstr "Eletrônica"
3449+msgstr ""
3450
3451 #: ../MusicSettings.qml:86
3452 msgid "Flat"
3453-msgstr "Flat"
3454+msgstr ""
3455
3456 #: ../MusicSettings.qml:87
3457 msgid "Hip Hop"
3458-msgstr "Hip Hop"
3459+msgstr ""
3460
3461 #: ../MusicSettings.qml:88
3462 msgid "Jazz"
3463-msgstr "Jazz"
3464+msgstr ""
3465
3466 #: ../MusicSettings.qml:89
3467 msgid "Metal"
3468-msgstr "Metal"
3469+msgstr ""
3470
3471 #: ../MusicSettings.qml:90
3472 msgid "Pop"
3473-msgstr "Pop"
3474+msgstr ""
3475
3476 #: ../MusicSettings.qml:91
3477 msgid "Rock"
3478-msgstr "Rock"
3479+msgstr ""
3480
3481 #: ../MusicSettings.qml:92
3482 msgid "Custom"
3483-msgstr "Personalizado"
3484+msgstr ""
3485
3486 #: ../MusicSettings.qml:112
3487 msgid ""
3488 "Snap to current song \n"
3489 "when opening toolbar"
3490 msgstr ""
3491-"Ajustar a música atual \n"
3492-"quando abrir a barra de ferramentas"
3493
3494 #: ../MusicSettings.qml:132
3495 msgid "Accounts"
3496-msgstr "Contas"
3497+msgstr ""
3498
3499 #: ../MusicSettings.qml:146
3500 msgid "Login to scrobble and import playlists"
3501-msgstr "Fazer login no scrobble e importar as listas de reprodução"
3502+msgstr ""
3503
3504 #: ../MusicSettings.qml:169
3505 msgid "Music Streaming"
3506-msgstr "Streaming de música"
3507+msgstr ""
3508
3509 #: ../MusicSettings.qml:179
3510 msgid "Ubuntu One"
3511-msgstr "Ubuntu One"
3512+msgstr ""
3513
3514 #: ../MusicSettings.qml:180
3515 msgid "Sign in to stream your cloud music"
3516-msgstr "Fazer login para transmitir suas músicas armazenadas em nuvem"
3517+msgstr ""
3518
3519 #: ../MusicSettings.qml:196
3520 msgid "Stream only on Wi-Fi"
3521-msgstr "Transmitir apenas através de Wi-Fi"
3522+msgstr ""
3523
3524 #: ../MusicSettings.qml:230
3525 msgid "Clean everything!"
3526-msgstr "Limpar tudo!"
3527+msgstr ""
3528
3529-#: ../MusicStart.qml:35 ../music-app.qml:589 ../music-app.qml:1150
3530+#: ../MusicStart.qml:35 ../music-app.qml:588 ../music-app.qml:1156
3531 #: com.ubuntu.music_music.desktop.in.in.h:1
3532 msgid "Music"
3533-msgstr "Música"
3534+msgstr ""
3535
3536 #: ../MusicStart.qml:75
3537 msgid "Recent"
3538-msgstr "Recente"
3539+msgstr ""
3540
3541 #: ../MusicStart.qml:103
3542 msgid "Clear History"
3543-msgstr "Limpar histórico"
3544+msgstr ""
3545
3546 #: ../MusicStart.qml:227
3547 msgid "Genres"
3548-msgstr "Gêneros"
3549+msgstr ""
3550
3551-#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:123
3552-#: ../common/SongsPage.qml:162 ../common/SongsPage.qml:240
3553+#: ../MusicStart.qml:316 ../MusicStart.qml:318 ../common/SongsPage.qml:115
3554+#: ../common/SongsPage.qml:138 ../common/SongsPage.qml:167
3555+#: ../common/SongsPage.qml:224 ../common/SongsPage.qml:266
3556 msgid "Genre"
3557-msgstr "Gênero"
3558+msgstr ""
3559
3560-#: ../MusicToolbar.qml:760
3561-msgid "Tap play to shuffle music"
3562-msgstr "Toque em reproduzir para embaralhar músicas"
3563+#: ../MusicToolbar.qml:767
3564+msgid "Tap to shuffle music"
3565+msgstr ""
3566
3567 #: ../MusicTracks.qml:35
3568 msgid "Songs"
3569-msgstr "Músicas"
3570+msgstr ""
3571
3572 #: ../MusicaddtoPlaylist.qml:41
3573 msgid "Select playlist"
3574-msgstr "Selecione uma lista de reprodução"
3575+msgstr ""
3576
3577 #: ../common/AlbumsPage.qml:167 ../common/AlbumsPage.qml:360
3578-#: ../common/SongsPage.qml:153
3579+#: ../common/SongsPage.qml:218
3580 msgid "Play all"
3581-msgstr "Tocar tudo"
3582+msgstr ""
3583
3584 #: ../common/AlbumsPage.qml:211 ../common/AlbumsPage.qml:400
3585-#: ../common/SongsPage.qml:200 ../music-app.qml:888
3586+#: ../music-app.qml:894
3587 msgid "Add to queue"
3588-msgstr "Adicionar à fila"
3589+msgstr ""
3590
3591-#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:902
3592+#: ../common/ListItemActions/AddToPlaylist.qml:25 ../music-app.qml:908
3593 msgid "Add to playlist"
3594-msgstr "Adicionar à lista de reprodução"
3595+msgstr ""
3596
3597 #: ../common/ListItemActions/AddToQueue.qml:25
3598 msgid "Add to Queue"
3599-msgstr "Adicionar à fila de reprodução"
3600+msgstr ""
3601
3602 #. TRANSLATORS: this refers to deleting a playlist
3603 #: ../common/ListItemActions/DeletePlaylist.qml:26
3604 msgid "Delete"
3605-msgstr "Apagar"
3606+msgstr ""
3607
3608 #. TRANSLATORS: this refers to editing a playlist
3609 #: ../common/ListItemActions/EditPlaylist.qml:26
3610 msgid "Edit"
3611-msgstr "Editar"
3612+msgstr ""
3613
3614 #: ../common/ListItemActions/Remove.qml:27
3615 msgid "Remove"
3616-msgstr "Remover"
3617+msgstr ""
3618
3619 #: ../common/LoadingSpinnerComponent.qml:47
3620 msgid "Loading..."
3621-msgstr "Carregando..."
3622+msgstr ""
3623+
3624+#: ../common/SongsPage.qml:160
3625+msgid "Shuffle"
3626+msgstr ""
3627+
3628+#: ../common/SongsPage.qml:197
3629+msgid "Queue all"
3630+msgstr ""
3631
3632 #: ../common/SwipeDelete.qml:52 ../common/SwipeDelete.qml:88
3633 msgid "Clear"
3634-msgstr "Limpar"
3635+msgstr ""
3636
3637 #: ../meta-database.js:90 ../meta-database.js:92
3638 msgid "Unknown Album"
3639-msgstr "Álbum desconhecido"
3640+msgstr ""
3641
3642 #: ../meta-database.js:91
3643 msgid "Unknown Artist"
3644-msgstr "Artista desconhecido"
3645+msgstr ""
3646
3647-#: ../music-app.qml:142
3648+#: ../music-app.qml:141
3649 msgid "Search Track"
3650-msgstr "Pesquisar faixa"
3651+msgstr ""
3652+
3653+#: ../music-app.qml:153
3654+msgid "Next"
3655+msgstr ""
3656
3657 #: ../music-app.qml:154
3658-msgid "Next"
3659-msgstr "Próximo"
3660-
3661-#: ../music-app.qml:155
3662 msgid "Next Track"
3663-msgstr "Próxima faixa"
3664+msgstr ""
3665
3666-#: ../music-app.qml:161
3667+#: ../music-app.qml:160
3668 msgid "Pause"
3669-msgstr "Pausar"
3670+msgstr ""
3671
3672-#: ../music-app.qml:161
3673+#: ../music-app.qml:160
3674 msgid "Play"
3675-msgstr "Tocar"
3676+msgstr ""
3677
3678-#: ../music-app.qml:163
3679+#: ../music-app.qml:162
3680 msgid "Pause Playback"
3681-msgstr "Pausar Reprodução"
3682+msgstr ""
3683
3684-#: ../music-app.qml:163
3685+#: ../music-app.qml:162
3686 msgid "Continue or start playback"
3687-msgstr "Continuar ou iniciar reprodução"
3688+msgstr ""
3689+
3690+#: ../music-app.qml:167
3691+msgid "Back"
3692+msgstr ""
3693
3694 #: ../music-app.qml:168
3695-msgid "Back"
3696-msgstr "Voltar"
3697-
3698-#: ../music-app.qml:169
3699 msgid "Go back to last page"
3700-msgstr "Voltar para a última página"
3701+msgstr ""
3702+
3703+#: ../music-app.qml:176
3704+msgid "Previous"
3705+msgstr ""
3706
3707 #: ../music-app.qml:177
3708-msgid "Previous"
3709-msgstr "Anterior"
3710-
3711-#: ../music-app.qml:178
3712 msgid "Previous Track"
3713-msgstr "Faixa anterior"
3714+msgstr ""
3715+
3716+#: ../music-app.qml:182
3717+msgid "Stop"
3718+msgstr ""
3719
3720 #: ../music-app.qml:183
3721-msgid "Stop"
3722-msgstr "Parar"
3723-
3724-#: ../music-app.qml:184
3725 msgid "Stop Playback"
3726-msgstr "Parar reprodução"
3727+msgstr ""
3728
3729-#: ../music-app.qml:192
3730+#: ../music-app.qml:191
3731 msgid "Music Settings"
3732-msgstr "Configurações de Música"
3733+msgstr ""
3734
3735 #. TRANSLATORS: This string represents that the target destination filepath does not start with ~/Music/Imported/
3736-#: ../music-app.qml:338
3737+#: ../music-app.qml:337
3738 msgid "Filepath must start with"
3739 msgstr "O caminho do arquivo deve começar com"
3740
3741 #. TRANSLATORS: This string represents that a blank filepath destination has been used
3742-#: ../music-app.qml:364
3743+#: ../music-app.qml:363
3744 msgid "Filepath must be a file"
3745-msgstr "O caminho deve ser de um arquivo"
3746+msgstr ""
3747
3748 #. TRANSLATORS: This string represents that there was failure moving the file to the target destination
3749-#: ../music-app.qml:370
3750+#: ../music-app.qml:369
3751 msgid "Failed to move file"
3752-msgstr "Falhou ao mover arquivo"
3753+msgstr ""
3754
3755-#: ../music-app.qml:447
3756+#: ../music-app.qml:446
3757 msgid "Waiting for file(s)..."
3758 msgstr "Aguardando pelo(s) arquivo(s)"
3759
3760-#: ../music-app.qml:466
3761+#: ../music-app.qml:465
3762 msgid "OK"
3763-msgstr "OK"
3764+msgstr ""
3765
3766-#: ../music-app.qml:479
3767+#: ../music-app.qml:478
3768 msgid "Imported file not found"
3769-msgstr "O arquivo importado não foi encontrado"
3770+msgstr ""
3771
3772-#: ../music-app.qml:483
3773+#: ../music-app.qml:482
3774 msgid "Wait"
3775-msgstr "Aguardando"
3776+msgstr ""
3777
3778 #. 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)
3779+#: ../music-app.qml:503
3780+msgid "songs played today"
3781+msgstr ""
3782+
3783 #: ../music-app.qml:504
3784-msgid "songs played today"
3785-msgstr "músicas tocadas hoje"
3786-
3787-#: ../music-app.qml:505
3788 msgid "No songs played today"
3789-msgstr "Nenhuma música tocada hoje"
3790+msgstr ""
3791
3792-#: ../music-app.qml:613
3793+#: ../music-app.qml:612
3794 msgid "Debug: "
3795-msgstr "Debug: "
3796+msgstr ""
3797
3798-#: ../music-app.qml:925
3799+#: ../music-app.qml:931
3800 msgid "New Playlist"
3801-msgstr "Nova lista de reprodução"
3802+msgstr ""
3803
3804-#: ../music-app.qml:926
3805+#: ../music-app.qml:932
3806 msgid "Name your playlist."
3807-msgstr "Nomear sua lista de reprodução."
3808+msgstr ""
3809
3810-#: ../music-app.qml:930
3811+#: ../music-app.qml:936
3812 msgid "Name"
3813-msgstr "Nome"
3814+msgstr ""
3815
3816-#: ../music-app.qml:940
3817+#: ../music-app.qml:946
3818 msgid "Create"
3819-msgstr "Criar"
3820+msgstr ""
3821
3822-#: ../music-app.qml:1176
3823+#: ../music-app.qml:1182
3824 msgid "No music found"
3825-msgstr "Nenhuma música encontrada"
3826+msgstr ""
3827
3828-#: ../music-app.qml:1183
3829+#: ../music-app.qml:1189
3830 msgid "Please import music"
3831-msgstr "Por favor, importar músicas"
3832+msgstr ""
3833
3834 #: com.ubuntu.music_music.desktop.in.in.h:2
3835 msgid "A music application for Ubuntu"
3836-msgstr "Aplicativo de musica para o Ubuntu"
3837+msgstr ""
3838
3839 #: com.ubuntu.music_music.desktop.in.in.h:3
3840 msgid "music;songs;play;tracks;player;tunes;"
3841-msgstr "música;músicas;tocar;faixas;player;tons;"
3842+msgstr ""
3843
3844=== modified file 'tests/autopilot/music_app/__init__.py'
3845--- tests/autopilot/music_app/__init__.py 2014-09-25 17:58:55 +0000
3846+++ tests/autopilot/music_app/__init__.py 2014-10-09 12:26:51 +0000
3847@@ -21,11 +21,22 @@
3848 return func_wrapper
3849
3850
3851-def ensure_toolbar_visible(func):
3852- """Wrapper which ensures the toolbar is shown before clicking"""
3853- def func_wrapper(self, *args, **kwargs):
3854- if not self.opened:
3855- self.show()
3856+def ensure_now_playing_full(func):
3857+ """Wrapper which ensures the now playing is full before clicking"""
3858+ def func_wrapper(self, *args, **kwargs):
3859+ if self.isListView:
3860+ self.click_toggle_view()
3861+
3862+ return func(self, *args, **kwargs)
3863+
3864+ return func_wrapper
3865+
3866+
3867+def ensure_now_playing_list(func):
3868+ """Wrapper which ensures the now playing is list before clicking"""
3869+ def func_wrapper(self, *args, **kwargs):
3870+ if not self.isListView:
3871+ self.click_toggle_view()
3872
3873 return func(self, *args, **kwargs)
3874
3875@@ -221,96 +232,54 @@
3876 def __init__(self, *args):
3877 super(MusicPage, self).__init__(*args)
3878
3879- def get_count(self):
3880- return self.select_single("QQuickListView",
3881- objectName="nowPlayingQueueList").count
3882-
3883- def get_track(self, i):
3884- return (self.wait_select_single(ListItemWithActions,
3885- objectName="nowPlayingListItem" + str(i)))
3886-
3887-
3888-class AlbumsPage(MusicPage):
3889- """ Autopilot helper for the albums page """
3890- def __init__(self, *args):
3891- super(MusicPage, self).__init__(*args)
3892-
3893- self.visible.wait_for(True)
3894-
3895- @click_object
3896- def click_artist(self, i):
3897- return self.wait_select_single("Standard",
3898- objectName="albumsArtistListItem"
3899- + str(i))
3900-
3901- def get_artist(self):
3902- return self.wait_select_single("Label", objectName="artistLabel").text
3903-
3904-
3905-class SongsPage(MusicPage):
3906- """ Autopilot helper for the songs page """
3907- def __init__(self, *args):
3908- super(MusicPage, self).__init__(*args)
3909-
3910- self.visible.wait_for(True)
3911-
3912- @click_object
3913- def click_track(self, i):
3914- return self.get_track(i)
3915-
3916- def get_header_artist_label(self):
3917- return self.wait_select_single("Label",
3918- objectName="songsPageHeaderAlbumArtist")
3919-
3920- def get_track(self, i):
3921- return (self.wait_select_single(ListItemWithActions,
3922- objectName="songsPageListItem" + str(i)))
3923-
3924-
3925-class MusicToolbar(UbuntuUIToolkitCustomProxyObjectBase):
3926- """Autopilot helper for the toolbar
3927-
3928- expanded - refers to things when the toolbar is in its smaller state
3929- full - refers to things when the toolbar is in its larger state
3930- """
3931- def __init__(self, *args):
3932- super(MusicToolbar, self).__init__(*args)
3933-
3934 root = self.get_root_instance()
3935 self.player = root.select_single(Player, objectName="player")
3936
3937- @ensure_toolbar_visible
3938+ @ensure_now_playing_full
3939 @click_object
3940 def click_forward_button(self):
3941 return self.wait_select_single("*", objectName="forwardShape")
3942
3943- @ensure_toolbar_visible
3944+ @ensure_now_playing_full
3945 @click_object
3946 def click_play_button(self):
3947- if self.currentMode == "full":
3948- return self.wait_select_single("*", objectName="playShape")
3949- else:
3950- return self.wait_select_single("*", objectName="smallPlayShape")
3951+ return self.wait_select_single("*", objectName="playShape")
3952
3953- @ensure_toolbar_visible
3954+ @ensure_now_playing_full
3955 @click_object
3956 def click_previous_button(self):
3957 return self.wait_select_single("*", objectName="previousShape")
3958
3959- @ensure_toolbar_visible
3960+ @ensure_now_playing_full
3961 @click_object
3962 def click_repeat_button(self):
3963 return self.wait_select_single("*", objectName="repeatShape")
3964
3965- @ensure_toolbar_visible
3966+ @ensure_now_playing_full
3967 @click_object
3968 def click_shuffle_button(self):
3969 return self.wait_select_single("*", objectName="shuffleShape")
3970
3971- @ensure_toolbar_visible
3972+ def click_toggle_view(self):
3973+ self.main_view.get_header().click_action_button("toggleView")
3974+
3975+ def get_count(self):
3976+ return self.select_single("QQuickListView",
3977+ objectName="nowPlayingQueueList").count
3978+
3979+ def go_back(self):
3980+ """Use custom back button to go back"""
3981+ self.main_view.get_header().click_custom_back_button()
3982+
3983+ @ensure_now_playing_list
3984+ def get_track(self, i):
3985+ return (self.wait_select_single(ListItemWithActions,
3986+ objectName="nowPlayingListItem" + str(i)))
3987+
3988+ @ensure_now_playing_full
3989 def seek_to(self, percentage):
3990 progress_bar = self.wait_select_single(
3991- "*", objectName="progressBarShape")
3992+ "*", objectName="progressSliderShape")
3993
3994 x1, y1, width, height = progress_bar.globalRect
3995 y1 += height // 2
3996@@ -319,28 +288,77 @@
3997
3998 self.pointing_device.drag(x1, y1, x2, y1)
3999
4000- @ensure_toolbar_visible
4001 def set_repeat(self, state):
4002 if self.player.repeat != state:
4003 self.click_repeat_button()
4004
4005 self.player.repeat.wait_for(state)
4006
4007- @ensure_toolbar_visible
4008 def set_shuffle(self, state):
4009 if self.player.shuffle != state:
4010 self.click_shuffle_button()
4011
4012 self.player.shuffle.wait_for(state)
4013
4014- def show(self):
4015- self.pointing_device.move_to_object(self)
4016-
4017- x1, y1 = self.pointing_device.position()
4018-
4019- y1 -= (self.height / 2) + 1 # get position at top of toolbar
4020-
4021- self.pointing_device.drag(x1, y1, x1, y1 - self.fullHeight)
4022+
4023+class AlbumsPage(MusicPage):
4024+ """ Autopilot helper for the albums page """
4025+ def __init__(self, *args):
4026+ super(MusicPage, self).__init__(*args)
4027+
4028+ self.visible.wait_for(True)
4029+
4030+ @click_object
4031+ def click_artist(self, i):
4032+ return self.wait_select_single("Standard",
4033+ objectName="albumsArtistListItem"
4034+ + str(i))
4035+
4036+ def get_artist(self):
4037+ return self.wait_select_single("Label", objectName="artistLabel").text
4038+
4039+
4040+class SongsPage(MusicPage):
4041+ """ Autopilot helper for the songs page """
4042+ def __init__(self, *args):
4043+ super(MusicPage, self).__init__(*args)
4044+
4045+ self.visible.wait_for(True)
4046+
4047+ @click_object
4048+ def click_track(self, i):
4049+ return self.get_track(i)
4050+
4051+ def get_header_artist_label(self):
4052+ return self.wait_select_single("Label",
4053+ objectName="songsPageHeaderAlbumArtist")
4054+
4055+ def get_track(self, i):
4056+ return (self.wait_select_single(ListItemWithActions,
4057+ objectName="songsPageListItem" + str(i)))
4058+
4059+
4060+class MusicToolbar(UbuntuUIToolkitCustomProxyObjectBase):
4061+ """Autopilot helper for the toolbar"""
4062+ def __init__(self, *args):
4063+ super(MusicToolbar, self).__init__(*args)
4064+
4065+ @click_object
4066+ def click_play_button(self):
4067+ return self.wait_select_single("*", objectName="playShape")
4068+
4069+ @click_object
4070+ def click_jump_to_now_playing(self):
4071+ return self.wait_select_single("*", objectName="jumpNowPlaying")
4072+
4073+ def switch_to_now_playing(self):
4074+ self.click_jump_to_now_playing()
4075+
4076+ root = self.get_root_instance()
4077+ now_playing_page = root.wait_select_single(MusicNowPlaying,
4078+ objectName="nowPlayingPage")
4079+
4080+ now_playing_page.visible.wait_for(True)
4081
4082
4083 class ListItemWithActions(UbuntuUIToolkitCustomProxyObjectBase):
4084
4085=== modified file 'tests/autopilot/music_app/tests/test_music.py'
4086--- tests/autopilot/music_app/tests/test_music.py 2014-09-23 20:45:41 +0000
4087+++ tests/autopilot/music_app/tests/test_music.py 2014-10-09 12:26:51 +0000
4088@@ -91,6 +91,11 @@
4089 Eventually(NotEquals(end_tracks_count)))
4090 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4091
4092+ toolbar.switch_to_now_playing() # Switch to the now playing page
4093+
4094+ # Re get now playing page as it has changed
4095+ now_playing_page = self.app.get_now_playing_page()
4096+
4097 # verify song's metadata matches the item added to the Now Playing view
4098 current_track = now_playing_page.get_track(self.player.currentIndex)
4099
4100@@ -99,14 +104,14 @@
4101 self.assertThat(current_track.get_label_text("titleLabel"),
4102 Equals(self.tracks[0]["title"]))
4103
4104- # click on close button to close the page
4105- self.app.main_view.go_back()
4106+ # click on close button to close the page and now playing page
4107+ now_playing_page.go_back()
4108
4109- # click the play button to start playing
4110+ # click the play button (toolbar) to start playing
4111 toolbar.click_play_button()
4112 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4113
4114- # click the play button to stop playing
4115+ # click the play button (toolbar) to stop playing
4116 toolbar.click_play_button()
4117 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4118
4119@@ -115,15 +120,15 @@
4120
4121 self.app.populate_queue() # populate queue
4122
4123- toolbar = self.app.get_toolbar()
4124+ now_playing_page = self.app.get_now_playing_page()
4125
4126 # check that the player is playing and then select pause
4127 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4128- toolbar.click_play_button()
4129+ now_playing_page.click_play_button()
4130
4131 # check that the player is paused and then select play
4132 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4133- toolbar.click_play_button()
4134+ now_playing_page.click_play_button()
4135
4136 # check that the player is playing
4137 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4138@@ -133,7 +138,7 @@
4139
4140 self.app.populate_queue() # populate queue
4141
4142- toolbar = self.app.get_toolbar()
4143+ now_playing_page = self.app.get_now_playing_page()
4144
4145 # save original song data for later
4146 org_title = self.player.currentMetaTitle
4147@@ -144,17 +149,17 @@
4148 logger.debug("Original Song %s, %s" % (org_title, org_artist))
4149
4150 # select pause and check the player has stopped
4151- toolbar.click_play_button()
4152+ now_playing_page.click_play_button()
4153 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4154
4155- toolbar.set_shuffle(False) # ensure shuffe is off
4156+ now_playing_page.set_shuffle(False) # ensure shuffe is off
4157
4158 # goal is to go back and forth and ensure 2 different songs
4159- toolbar.click_forward_button()
4160+ now_playing_page.click_forward_button()
4161 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4162
4163 # select pause and check the player has stopped
4164- toolbar.click_play_button()
4165+ now_playing_page.click_play_button()
4166 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4167
4168 # ensure different song
4169@@ -166,14 +171,14 @@
4170 logger.debug("Next Song %s, %s" % (self.player.currentMetaTitle,
4171 self.player.currentMetaArtist))
4172
4173- toolbar.seek_to(0) # seek to 0 (start)
4174+ now_playing_page.seek_to(0) # seek to 0 (start)
4175
4176 # select previous and ensure the track is playing
4177- toolbar.click_previous_button()
4178+ now_playing_page.click_previous_button()
4179 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4180
4181 # select pause and check the player has stopped
4182- toolbar.click_play_button()
4183+ now_playing_page.click_play_button()
4184 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4185
4186 # ensure we're back to original song
4187@@ -207,13 +212,13 @@
4188 self.assertThat(self.player.source.endswith("mp3"),
4189 Equals(True))
4190
4191- # Start playing the track
4192+ # Start playing the track (click from toolbar)
4193 toolbar.click_play_button()
4194
4195 # Check that the track is playing
4196 self.assertThat(self.player.isPlaying, Eventually(Equals(True)))
4197
4198- # Stop playing the track
4199+ # Stop playing the track (click from toolbar)
4200 toolbar.click_play_button()
4201
4202 # Check current meta data is correct
4203@@ -229,15 +234,15 @@
4204
4205 # at this point the track is playing and shuffle is enabled
4206
4207- toolbar = self.app.get_toolbar()
4208+ now_playing_page = self.app.get_now_playing_page()
4209
4210 # pause the track if it is playing
4211 if self.player.isPlaying:
4212- toolbar.click_play_button()
4213+ now_playing_page.click_play_button()
4214
4215 self.player.isPlaying.wait_for(False)
4216
4217- toolbar.set_shuffle(True) # enable shuffle
4218+ now_playing_page.set_shuffle(True) # enable shuffle
4219
4220 # save original song metadata
4221 org_title = self.player.currentMetaTitle
4222@@ -256,11 +261,11 @@
4223 self.assertThat(count, LessThan(100))
4224
4225 # select next track
4226- toolbar.click_forward_button()
4227+ now_playing_page.click_forward_button()
4228
4229 # pause the track if it is playing
4230 if self.player.isPlaying:
4231- toolbar.click_play_button()
4232+ now_playing_page.click_play_button()
4233
4234 # check it is paused
4235 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4236@@ -270,11 +275,11 @@
4237
4238 # select previous track while will break if this previous track
4239 # is different and therefore a shuffle has occurred
4240- toolbar.click_previous_button()
4241+ now_playing_page.click_previous_button()
4242
4243 # pause the track if it is playing
4244 if self.player.isPlaying:
4245- toolbar.click_play_button()
4246+ now_playing_page.click_play_button()
4247
4248 # check it is paused
4249 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4250@@ -314,6 +319,7 @@
4251 """tests navigating to the Albums tab and adding a song to queue"""
4252
4253 now_playing_page = self.app.get_now_playing_page()
4254+ toolbar = self.app.get_toolbar()
4255
4256 # get number of tracks in queue before queuing a track
4257 initial_tracks_count = now_playing_page.get_count()
4258@@ -341,6 +347,11 @@
4259 # Assert that the song added to the list is not playing
4260 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4261
4262+ toolbar.switch_to_now_playing() # Switch to the now playing page
4263+
4264+ # Re get now playing page as it has changed
4265+ now_playing_page = self.app.get_now_playing_page()
4266+
4267 # verify song's metadata matches the item added to the Now Playing view
4268 current_track = now_playing_page.get_track(self.player.currentIndex)
4269
4270@@ -349,8 +360,8 @@
4271 self.assertThat(current_track.get_label_text("titleLabel"),
4272 Equals(tracks[0]["title"]))
4273
4274- # click on close button to close songs page
4275- self.app.main_view.go_back()
4276+ # click on close button to close nowplaying and songs page
4277+ now_playing_page.go_back()
4278
4279 # check that the albums page is now visible
4280 self.assertThat(albums_page.visible, Eventually(Equals(True)))
4281@@ -391,6 +402,7 @@
4282 to the queue via the expandable list view item. """
4283
4284 now_playing_page = self.app.get_now_playing_page()
4285+ toolbar = self.app.get_toolbar()
4286
4287 # get number of tracks in queue before queuing a track
4288 initial_tracks_count = now_playing_page.get_count()
4289@@ -413,6 +425,11 @@
4290 Eventually(NotEquals(now_playing_page.get_count())))
4291 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4292
4293+ toolbar.switch_to_now_playing() # Switch to the now playing page
4294+
4295+ # Re get now playing page as it has changed
4296+ now_playing_page = self.app.get_now_playing_page()
4297+
4298 # verify song's metadata matches the item added to the Now Playing view
4299 current_track = now_playing_page.get_track(self.player.currentIndex)
4300
4301@@ -552,14 +569,13 @@
4302 self.app.populate_queue() # populate queue
4303
4304 now_playing_page = self.app.get_now_playing_page()
4305- toolbar = self.app.get_toolbar()
4306
4307- toolbar.set_shuffle(False)
4308- toolbar.set_repeat(False)
4309+ now_playing_page.set_shuffle(False)
4310+ now_playing_page.set_repeat(False)
4311
4312 # Skip through all songs in queue, stopping on last one.
4313 for count in range(0, now_playing_page.get_count() - 1):
4314- toolbar.click_forward_button()
4315+ now_playing_page.click_forward_button()
4316
4317 # When the last song ends, playback should stop
4318 self.assertThat(self.player.isPlaying, Eventually(Equals(False)))
4319@@ -570,14 +586,13 @@
4320 self.app.populate_queue() # populate queue
4321
4322 now_playing_page = self.app.get_now_playing_page()
4323- toolbar = self.app.get_toolbar()
4324
4325- toolbar.set_shuffle(False)
4326- toolbar.set_repeat(True)
4327+ now_playing_page.set_shuffle(False)
4328+ now_playing_page.set_repeat(True)
4329
4330 # Skip through all songs in queue, stopping on last one.
4331 for count in range(0, now_playing_page.get_count() - 1):
4332- toolbar.click_forward_button()
4333+ now_playing_page.click_forward_button()
4334
4335 # Make sure we loop back to first song after last song ends
4336 self.assertThat(self.player.currentMetaTitle,
4337@@ -590,14 +605,13 @@
4338 self.app.populate_queue() # populate queue
4339
4340 now_playing_page = self.app.get_now_playing_page()
4341- toolbar = self.app.get_toolbar()
4342
4343- toolbar.set_shuffle(False)
4344- toolbar.set_repeat(True)
4345+ now_playing_page.set_shuffle(False)
4346+ now_playing_page.set_repeat(True)
4347
4348 # Skip through all songs in queue, INCLUDING last one.
4349 for count in range(0, now_playing_page.get_count() - 1):
4350- toolbar.click_forward_button()
4351+ now_playing_page.click_forward_button()
4352
4353 # Make sure we loop back to first song after last song ends
4354 self.assertThat(self.player.currentMetaTitle,
4355@@ -609,19 +623,19 @@
4356
4357 self.app.populate_queue() # populate queue
4358
4359- toolbar = self.app.get_toolbar()
4360+ now_playing_page = self.app.get_now_playing_page()
4361
4362- toolbar.set_shuffle(False)
4363- toolbar.set_repeat(True)
4364+ now_playing_page.set_shuffle(False)
4365+ now_playing_page.set_repeat(True)
4366
4367 initial_song = self.player.currentMetaTitle
4368- toolbar.click_previous_button()
4369+ now_playing_page.click_previous_button()
4370
4371 # If we're far enough into a song, pressing prev just takes us to the
4372 # beginning of that track. In that case, hit prev again to actually
4373 # skip over the track.
4374 if self.player.currentMetaTitle == initial_song:
4375- toolbar.click_previous_button()
4376+ now_playing_page.click_previous_button()
4377
4378 self.assertThat(self.player.currentMetaTitle,
4379 Eventually(Equals(self.tracks[-1]["title"])))
4380@@ -632,17 +646,17 @@
4381
4382 self.app.populate_queue() # populate queue
4383
4384- toolbar = self.app.get_toolbar()
4385+ now_playing_page = self.app.get_now_playing_page()
4386
4387 self.player.isPlaying.wait_for(True) # ensure the track is playing
4388 self.player.position.wait_for(GreaterThan(5000)) # wait until > 5s
4389
4390- toolbar.click_play_button() # pause the track
4391+ now_playing_page.click_play_button() # pause the track
4392 self.player.isPlaying.wait_for(False) # ensure the track has paused
4393
4394 source = self.player.source # store current source
4395
4396- toolbar.click_previous_button() # click previous
4397+ now_playing_page.click_previous_button() # click previous
4398
4399 self.player.position.wait_for(LessThan(5000)) # wait until < 5s
4400

Subscribers

People subscribed via source and target branches

to status/vote changes: