Merge lp:~vthompson/music-app/remix-genres-tab-001 into lp:music-app/remix

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 683
Merged at revision: 684
Proposed branch: lp:~vthompson/music-app/remix-genres-tab-001
Merge into: lp:music-app/remix
Diff against target: 144 lines (+117/-1)
3 files modified
MusicGenres.qml (+99/-0)
common/CoverGrid.qml (+1/-1)
music-app.qml (+17/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/remix-genres-tab-001
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+239075@code.launchpad.net

Commit message

Add an initial Genres tab

Description of the change

Add an initial Genres tab and CoverGrid for each genre.

To post a comment you must log in.
683. By Victor Thompson

Add MusicGenre component.

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

Awesome :) we should investigate using the filter.pattern: /\S+/ for the Albums and Artists models

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'MusicGenres.qml'
--- MusicGenres.qml 1970-01-01 00:00:00 +0000
+++ MusicGenres.qml 2014-10-21 15:09:22 +0000
@@ -0,0 +1,99 @@
1/*
2 * Copyright (C) 2013, 2014
3 * Andrew Hayzen <ahayzen@gmail.com>
4 * Daniel Holm <d.holmen@gmail.com>
5 * Victor Thompson <victor.thompson@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20import QtQuick 2.3
21import Ubuntu.Components 1.1
22import Ubuntu.MediaScanner 0.1
23import "common"
24
25
26MusicPage {
27 id: mainpage
28 objectName: "genresPage"
29 title: i18n.tr("Genres")
30
31 CardView {
32 id: genreCardView
33 itemWidth: units.gu(12)
34 model: SortFilterModel {
35 id: genresModelFilter
36 model: GenresModel {
37 id: genresModel
38 store: musicStore
39 }
40 filter.property: "genre"
41 filter.pattern: /\S+/
42 }
43
44 delegate: Card {
45 id: genreCard
46 coverSources: []
47 objectName: "genresPageGridItem" + index
48 primaryText: model.genre
49 secondaryTextVisible: false
50
51 property string album: ""
52
53 AlbumsModel {
54 id: albumGenreModel
55 genre: model.genre
56 store: musicStore
57 }
58
59 Repeater {
60 id: albumGenreModelRepeater
61 model: AlbumsModel {
62 genre: model.genre
63 store: musicStore
64 }
65
66 delegate: Item {
67 property string art: model.art
68 }
69 property var covers: []
70 signal finished()
71
72 onFinished: {
73 genreCard.coverSources = covers
74 }
75 onItemAdded: {
76 covers.push({art: item.art});
77
78 if (index === count - 1) {
79 finished();
80 }
81 }
82 }
83
84 onClicked: {
85 songsPage.covers = genreCard.coverSources
86 songsPage.album = undefined
87 songsPage.isAlbum = true
88 songsPage.genre = model.genre;
89 songsPage.title = i18n.tr("Genre")
90 songsPage.line2 = model.genre
91 songsPage.line1 = i18n.tr("Genre")
92
93
94 mainPageStack.push(songsPage)
95 }
96 }
97 }
98}
99
0100
=== modified file 'common/CoverGrid.qml'
--- common/CoverGrid.qml 2014-10-20 15:56:44 +0000
+++ common/CoverGrid.qml 2014-10-21 15:09:22 +0000
@@ -60,7 +60,7 @@
60 ? (coverGrid.covers[index].art !== undefined60 ? (coverGrid.covers[index].art !== undefined
61 ? coverGrid.covers[index].art61 ? coverGrid.covers[index].art
62 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)62 : "image://albumart/artist=" + coverGrid.covers[index].author + "&album=" + coverGrid.covers[index].album)
63 : undefined63 : ""
64 sourceSize.height: height64 sourceSize.height: height
65 sourceSize.width: width65 sourceSize.width: width
6666
6767
=== modified file 'music-app.qml'
--- music-app.qml 2014-10-20 14:09:45 +0000
+++ music-app.qml 2014-10-21 15:09:22 +0000
@@ -1041,6 +1041,23 @@
1041 }1041 }
1042 }1042 }
10431043
1044 // forth tab is genres
1045 Tab {
1046 property bool populated: true
1047 property var loader: []
1048 property bool loading: false
1049 property var model: []
1050 id: genresTab
1051 objectName: "genresTab"
1052 anchors.fill: parent
1053 title: page.title
1054
1055 // Tab content begins here
1056 page: MusicGenres {
1057 id: musicGenresPage
1058 }
1059 }
1060
1044 // fourth tab is all songs1061 // fourth tab is all songs
1045 Tab {1062 Tab {
1046 property bool populated: true1063 property bool populated: true

Subscribers

People subscribed via source and target branches