Merge lp:~ahayzen/music-app/add-sdk-search-support into lp:music-app/trusty

Proposed by Andrew Hayzen
Status: Rejected
Rejected by: Victor Thompson
Proposed branch: lp:~ahayzen/music-app/add-sdk-search-support
Merge into: lp:music-app/trusty
Diff against target: 1070 lines (+207/-347)
25 files modified
LoginLastFM.qml (+1/-1)
MusicAlbums.qml (+4/-5)
MusicArtists.qml (+9/-6)
MusicNowPlaying.qml (+2/-1)
MusicPlaylists.qml (+19/-14)
MusicSearch.qml (+0/-218)
MusicSettings.qml (+1/-1)
MusicStart.qml (+17/-9)
MusicToolbar.qml (+1/-39)
MusicTracks.qml (+11/-9)
MusicaddtoPlaylist.qml (+18/-17)
Style.qml (+1/-1)
common/AlbumsPage.qml (+13/-7)
common/BlurredBackground.qml (+1/-1)
common/CoverRow.qml (+1/-1)
common/Expander.qml (+1/-1)
common/ExpanderItems/AddToPlaylist.qml (+1/-1)
common/ExpanderItems/AddToQueue.qml (+1/-1)
common/ExpanderItems/DeletePlaylist.qml (+1/-1)
common/ExpanderItems/EditPlaylist.qml (+1/-1)
common/LoadingSpinnerComponent.qml (+1/-1)
common/MusicPage.qml (+68/-1)
common/SongsPage.qml (+17/-3)
common/SwipeDelete.qml (+1/-1)
music-app.qml (+16/-6)
To merge this branch: bzr merge lp:~ahayzen/music-app/add-sdk-search-support
Reviewer Review Type Date Requested Status
Victor Thompson Disapprove
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+226045@code.launchpad.net

Commit message

* Implement support for search in header
* Remove old search code
* Migrate to Ubuntu.Components 1.1

Description of the change

* Implement support for search in header
* Remove old search code
* Migrate to Ubuntu.Components 1.1

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
519. By Andrew Hayzen

* Fix for album art not being filtered on AlbumsPage.qml
* Make searches case insensitive
* Fix for typo

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

Issues:

1. I'm experiencing crashing at times when searching within a Playlist (SongsPage). I haven't figured out what the output is yet
2. I see the following in an Album's SongsPage (song title's are corrupt): http://i.imgur.com/CTgRlFP.png
3. Filtering in the SongsPage also changes the number of tracks in an Album, if the page is for an album. That doesn't seem like something that should change.
4. Sometimes the searching stops working. Not sure what the cause is here. Entering a search doesn't filter anything if you play around for awhile.

Overall, I think it's confusing to search within the AlbumsPage and SongsPage. The *only* argument I can think of is searching within a Genre. But the same use case can be accomplished by searching the Songs Tab. I also don't see a reason to filter the MusicStart tab. Maybe we should also add a Genres tab, because that's the only other item I think could use some filtering. It seems inappropriate to do so from the Music tab. Removing the SongsPage, AlbumsPage, Music tab, and anything playlist related would seem to fix the first three issues--maybe the fourth as well.

I'll say, filtering for an Artist or Album is probably the greatest usecases of having a search. It's pretty slick.

review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

Also, I'd like to strongly suggest that we add tests for this going forward. Minimizing the views that have the search capability would help to keep that impact down as well.

520. By Andrew Hayzen

* Add support for cover filtering to SongsPage.qml

521. By Andrew Hayzen

* Only allow searching on Artists/Albums/Tracks tabs
* Revert modifications to cover art as they are not required

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

* Add tracing

523. By Andrew Hayzen

* Merge of trunk

524. By Andrew Hayzen

* Merge of trunk

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

* Merge of trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :
review: Needs Fixing
Revision history for this message
Victor Thompson (vthompson) wrote :

Setting to WIP due to blockage.

Revision history for this message
Victor Thompson (vthompson) wrote :

Search has landed. Rejecting this MP.

review: Disapprove

Unmerged revisions

525. By Andrew Hayzen

* Merge of trunk

524. By Andrew Hayzen

* Merge of trunk

523. By Andrew Hayzen

* Merge of trunk

522. By Andrew Hayzen

* Add tracing

521. By Andrew Hayzen

* Only allow searching on Artists/Albums/Tracks tabs
* Revert modifications to cover art as they are not required

520. By Andrew Hayzen

* Add support for cover filtering to SongsPage.qml

519. By Andrew Hayzen

* Fix for album art not being filtered on AlbumsPage.qml
* Make searches case insensitive
* Fix for typo

518. By Andrew Hayzen

* Remove sort from artists model as it is not needed

517. By Andrew Hayzen

* Implement support for search in header
* Remove old search code
* Migrate to Ubuntu.Components 1.1

516. By Andrew Hayzen

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'LoginLastFM.qml'
--- LoginLastFM.qml 2014-05-04 16:34:49 +0000
+++ LoginLastFM.qml 2014-07-14 18:02:21 +0000
@@ -16,7 +16,7 @@
16 */16 */
1717
18import QtQuick 2.018import QtQuick 2.0
19import Ubuntu.Components 0.119import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 0.120import Ubuntu.Components.ListItems 0.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 0.1 as ListItem
2323
=== modified file 'MusicAlbums.qml'
--- MusicAlbums.qml 2014-07-09 03:16:28 +0000
+++ MusicAlbums.qml 2014-07-14 18:02:21 +0000
@@ -18,8 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components 1.1 as Toolkit
23import Ubuntu.Components.ListItems 0.122import Ubuntu.Components.ListItems 0.1
24import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 0.1
25import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -52,17 +51,17 @@
52 anchors.bottomMargin: units.gu(1)51 anchors.bottomMargin: units.gu(1)
53 cellHeight: height/352 cellHeight: height/3
54 cellWidth: height/353 cellWidth: height/3
55 model: Toolkit.SortFilterModel {54 model: SortFilterModel {
56 id: albumsModelFilter55 id: albumsModelFilter
57 property alias rowCount: albumsModel.rowCount
58 model: AlbumsModel {56 model: AlbumsModel {
59 id: albumsModel57 id: albumsModel
60 store: musicStore58 store: musicStore
61 }59 }
62 sort.property: "title"60 sort.property: "title"
63 sort.order: Qt.AscendingOrder61 sort.order: Qt.AscendingOrder
62 filter.property: "title"
63 filter.pattern: new RegExp(searchValue, "i")
64 }64 }
65
66 delegate: albumDelegate65 delegate: albumDelegate
67 flow: GridView.TopToBottom66 flow: GridView.TopToBottom
6867
6968
=== modified file 'MusicArtists.qml'
--- MusicArtists.qml 2014-07-11 22:29:21 +0000
+++ MusicArtists.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.122import Ubuntu.Components.ListItems 0.1
23import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -40,12 +40,15 @@
40 id: artistlist40 id: artistlist
41 anchors.fill: parent41 anchors.fill: parent
42 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight42 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
43 model: ArtistsModel {43 model: SortFilterModel {
44 id: artistsModel44 model: ArtistsModel {
45 albumArtists: true45 id: artistsModel
46 store: musicStore46 albumArtists: true
47 store: musicStore
48 }
49 filter.property: "artist"
50 filter.pattern: new RegExp(searchValue, "i")
47 }51 }
48
49 delegate: artistDelegate52 delegate: artistDelegate
5053
51 Component {54 Component {
5255
=== modified file 'MusicNowPlaying.qml'
--- MusicNowPlaying.qml 2014-06-24 19:35:57 +0000
+++ MusicNowPlaying.qml 2014-07-14 18:02:21 +0000
@@ -21,7 +21,7 @@
21import QtMultimedia 5.021import QtMultimedia 5.0
22import QtQuick 2.022import QtQuick 2.0
23import QtQuick.LocalStorage 2.023import QtQuick.LocalStorage 2.0
24import Ubuntu.Components 0.124import Ubuntu.Components 1.1
25import Ubuntu.Components.ListItems 0.1 as ListItem25import Ubuntu.Components.ListItems 0.1 as ListItem
26import Ubuntu.Thumbnailer 0.126import Ubuntu.Thumbnailer 0.1
27import "common"27import "common"
@@ -31,6 +31,7 @@
31MusicPage {31MusicPage {
32 id: nowPlaying32 id: nowPlaying
33 objectName: "nowplayingpage"33 objectName: "nowplayingpage"
34 searchablePage: false
34 title: i18n.tr("Now Playing")35 title: i18n.tr("Now Playing")
35 visible: false36 visible: false
3637
3738
=== modified file 'MusicPlaylists.qml'
--- MusicPlaylists.qml 2014-07-11 22:29:21 +0000
+++ MusicPlaylists.qml 2014-07-14 18:02:21 +0000
@@ -19,7 +19,7 @@
19 */19 */
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Components.ListItems 0.123import Ubuntu.Components.ListItems 0.1
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 0.1
25import Ubuntu.Components.ListItems 0.1 as ListItem25import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -36,6 +36,7 @@
36 id: listspage36 id: listspage
37 // TRANSLATORS: this is the name of the playlists page shown in the tab header.37 // TRANSLATORS: this is the name of the playlists page shown in the tab header.
38 // Remember to keep the translation short to fit the screen width38 // Remember to keep the translation short to fit the screen width
39 searchablePage: false
39 title: i18n.tr("Playlists")40 title: i18n.tr("Playlists")
4041
41 property string playlistTracks: ""42 property string playlistTracks: ""
@@ -44,19 +45,17 @@
44 property string oldPlaylistID: ""45 property string oldPlaylistID: ""
45 property string inPlaylist: ""46 property string inPlaylist: ""
4647
47 tools: ToolbarItems {48 head.actions: [
48 ToolbarButton {49 Action {
49 action: Action {50 objectName: "newplaylistButton"
50 objectName: "newplaylistButton"51 text: i18n.tr("New playlist")
51 text: i18n.tr("New playlist")52 iconSource: "images/add.svg"
52 iconSource: "images/add.svg"53 onTriggered: {
53 onTriggered: {54 customdebug("New playlist.")
54 customdebug("New playlist.")55 PopupUtils.open(newPlaylistDialog, mainView)
55 PopupUtils.open(newPlaylistDialog, mainView)
56 }
57 }56 }
58 }57 }
59 }58 ]
6059
61 // Edit name of playlist dialog60 // Edit name of playlist dialog
62 Component {61 Component {
@@ -136,7 +135,13 @@
136 objectName: "playlistslist"135 objectName: "playlistslist"
137 anchors.fill: parent136 anchors.fill: parent
138 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight137 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
139 model: playlistModel.model138 model: SortFilterModel {
139 id: playlistFilterModel
140 property alias rowCount: playlistFilterModel.count
141 model: playlistModel.model
142 filter.property: "name"
143 filter.pattern: new RegExp(searchValue, "i")
144 }
140 delegate: playlistDelegate145 delegate: playlistDelegate
141 onCountChanged: {146 onCountChanged: {
142 customdebug("onCountChanged: " + playlistslist.count)147 customdebug("onCountChanged: " + playlistslist.count)
@@ -193,10 +198,10 @@
193198
194 onClicked: {199 onClicked: {
195 albumTracksModel.filterPlaylistTracks(name)200 albumTracksModel.filterPlaylistTracks(name)
201 songsPage.covers = playlist.covers
196 songsPage.isAlbum = false202 songsPage.isAlbum = false
197 songsPage.line1 = "Playlist"203 songsPage.line1 = "Playlist"
198 songsPage.line2 = model.name204 songsPage.line2 = model.name
199 songsPage.covers = playlist.covers
200 songsPage.title = i18n.tr("Playlist")205 songsPage.title = i18n.tr("Playlist")
201206
202 mainPageStack.push(songsPage)207 mainPageStack.push(songsPage)
203208
=== removed file 'MusicSearch.qml'
--- MusicSearch.qml 2014-07-11 22:29:21 +0000
+++ MusicSearch.qml 1970-01-01 00:00:00 +0000
@@ -1,218 +0,0 @@
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 QtMultimedia 5.0
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem
24import Ubuntu.Components.Popups 0.1
25import Ubuntu.MediaScanner 0.1
26import Ubuntu.Thumbnailer 0.1
27import QtQuick.LocalStorage 2.0
28import "playlists.js" as Playlists
29import "common"
30import "common/ExpanderItems"
31
32Item {
33 id: sheetItem
34
35 property alias sheet: sheetComponent
36 property bool sheetVisible: false
37
38 Component {
39 id: sheetComponent
40
41 // Sheet to search for music tracks
42 DefaultSheet {
43 id: searchTrack
44 title: i18n.tr("Search")
45 contentsHeight: units.gu(80)
46
47 onDoneClicked: PopupUtils.close(searchTrack)
48
49 Component.onCompleted: {
50 searchField.forceActiveFocus()
51 }
52
53 onVisibleChanged: {
54 if (visible) {
55 musicToolbar.setSheet(searchTrack)
56 sheetVisible = true
57 }
58 else {
59 musicToolbar.removeSheet(searchTrack)
60 sheetVisible = false
61 }
62 }
63
64 TextField {
65 id: searchField
66 anchors {
67 left: parent.left;
68 leftMargin: units.gu(2);
69 top: parent.top;
70 right: parent.right;
71 rightMargin: units.gu(2);
72 }
73
74 width: parent.width/1.5
75 placeholderText: "Search"
76 hasClearButton: true
77 highlighted: true
78 focus: true
79 inputMethodHints: Qt.ImhNoPredictiveText
80 //canPaste: true // why work, you do not, hrm?
81
82 // search icon
83 primaryItem: Image {
84 height: parent.height*0.5
85 width: parent.height*0.5
86 anchors.verticalCenter: parent.verticalCenter
87 anchors.verticalCenterOffset: -units.gu(0.2)
88 source: Qt.resolvedUrl("images/search.svg")
89 }
90
91 onTextChanged: {
92 searchTimer.start() // start the countdown, baby!
93 }
94
95 // Provide a small pause before search
96 Timer {
97 id: searchTimer
98 interval: 500
99 repeat: false
100 onTriggered: {
101 songsSearchModel.query = searchField.text;
102 searchActivity.running = true // start the activity indicator
103
104 indicatorTimer.start()
105 }
106 }
107 // and onother one for the indicator
108 Timer {
109 id: indicatorTimer
110 interval: 500
111 repeat: false
112 onTriggered: {
113 searchActivity.running = false
114 }
115 }
116
117 // Indicator to show search activity
118 ActivityIndicator {
119 id: searchActivity
120 anchors {
121 verticalCenter: searchField.verticalCenter;
122 right: searchField.right;
123 rightMargin: units.gu(1)
124 }
125 running: false
126 }
127 }
128
129 Rectangle {
130 width: parent.width
131 height: parent.height
132 color: "transparent"
133 visible: searchField.text
134 clip: true
135 anchors {
136 top: searchField.bottom
137 bottom: parent.bottom
138 left: parent.left
139 right: parent.right
140 }
141
142 // show each playlist and make them chosable
143 ListView {
144 id: searchTrackView
145 objectName: "searchtrackview"
146 width: parent.width
147 height: parent.width
148 model: SongsSearchModel {
149 id: songsSearchModel
150 store: musicStore
151 }
152
153 onMovementStarted: {
154 searchTrackView.forceActiveFocus()
155 }
156
157 delegate: ListItem.Standard {
158 id: search
159 objectName: "playlist"
160 width: parent.width
161 height: styleMusic.common.itemHeight
162
163 onClicked: {
164 console.debug("Debug: "+title+" added to queue")
165 // now play this track, but keep current queue
166 trackQueue.append(model)
167 trackQueueClick(trackQueue.model.count - 1);
168 onDoneClicked: PopupUtils.close(searchTrack)
169 }
170
171 MusicRow {
172 covers: [{author: model.author, album: model.title}]
173 column: Column {
174 spacing: units.gu(1)
175 Label {
176 id: trackArtist
177 color: styleMusic.common.subtitle
178 fontSize: "x-small"
179 text: model.author
180 }
181 Label {
182 id: trackTitle
183 color: styleMusic.common.music
184 fontSize: "small"
185 objectName: "tracktitle"
186 text: model.title
187 }
188 Label {
189 id: trackAlbum
190 color: styleMusic.common.subtitle
191 fontSize: "xx-small"
192 text: model.album
193 }
194 }
195 }
196
197 Expander {
198 id: expandable
199 anchors {
200 fill: parent
201 }
202 listItem: search
203 model: songsSearchModel.get(index, songsSearchModel.RoleModelData)
204 row: Row {
205 AddToPlaylist {
206
207 }
208 AddToQueue {
209
210 }
211 }
212 }
213 }
214 }
215 }
216 }
217 }
218}
2190
=== modified file 'MusicSettings.qml'
--- MusicSettings.qml 2014-05-28 15:07:35 +0000
+++ MusicSettings.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.ListItems 0.1 as ListItem21import Ubuntu.Components.ListItems 0.1 as ListItem
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import QtQuick.LocalStorage 2.023import QtQuick.LocalStorage 2.0
2424
=== modified file 'MusicStart.qml'
--- MusicStart.qml 2014-07-09 03:16:28 +0000
+++ MusicStart.qml 2014-07-14 18:02:21 +0000
@@ -18,8 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components 1.1 as Toolkit
23import Ubuntu.Components.ListItems 0.122import Ubuntu.Components.ListItems 0.1
24import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 0.1
25import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -34,6 +33,7 @@
3433
35MusicPage {34MusicPage {
36 id: mainpage35 id: mainpage
36 searchablePage: false
37 title: i18n.tr("Music")37 title: i18n.tr("Music")
3838
39 /* Dev button for search.39 /* Dev button for search.
@@ -88,7 +88,12 @@
88 spacing: units.gu(1)88 spacing: units.gu(1)
89 height: units.gu(18)89 height: units.gu(18)
90 // TODO: Update when view counts are collected90 // TODO: Update when view counts are collected
91 model: recentModel.model91 model: SortFilterModel {
92 id: recentListFilterModel
93 model: recentModel.model
94 filter.property: "genre"
95 filter.pattern: new RegExp(searchValue, "i")
96 }
92 delegate: recentDelegate97 delegate: recentDelegate
93 header: Item {98 header: Item {
94 id: recentSpacer99 id: recentSpacer
@@ -233,8 +238,12 @@
233 anchors.topMargin: units.gu(1)238 anchors.topMargin: units.gu(1)
234 spacing: units.gu(1)239 spacing: units.gu(1)
235 height: units.gu(18)240 height: units.gu(18)
236 model: GenresModel {241 model: SortFilterModel {
237 store: musicStore242 model: GenresModel {
243 store: musicStore
244 }
245 filter.property: "genre"
246 filter.pattern: new RegExp(searchValue, "i")
238 }247 }
239248
240 delegate: genreDelegate249 delegate: genreDelegate
@@ -388,15 +397,15 @@
388 anchors.topMargin: units.gu(1)397 anchors.topMargin: units.gu(1)
389 spacing: units.gu(1)398 spacing: units.gu(1)
390 height: units.gu(18)399 height: units.gu(18)
391 model: Toolkit.SortFilterModel {400 model: SortFilterModel {
392 id: albumsModelFilter
393 property alias rowCount: albumsModel.rowCount
394 model: AlbumsModel {401 model: AlbumsModel {
395 id: albumsModel402 id: albumsModel
396 store: musicStore403 store: musicStore
397 }404 }
398 sort.property: "title"405 sort.property: "title"
399 sort.order: Qt.AscendingOrder406 sort.order: Qt.AscendingOrder
407 filter.property: "title"
408 filter.pattern: new RegExp(searchValue, "i")
400 }409 }
401 delegate: albumDelegate410 delegate: albumDelegate
402 header: Item {411 header: Item {
@@ -432,7 +441,6 @@
432 anchors.fill: parent441 anchors.fill: parent
433 onClicked: {442 onClicked: {
434 songsPage.album = album443 songsPage.album = album
435 songsPage.covers = covers
436 songsPage.genre = undefined444 songsPage.genre = undefined
437 songsPage.isAlbum = true445 songsPage.isAlbum = true
438 songsPage.line1 = artist446 songsPage.line1 = artist
439447
=== modified file 'MusicToolbar.qml'
--- MusicToolbar.qml 2014-07-02 22:28:59 +0000
+++ MusicToolbar.qml 2014-07-14 18:02:21 +0000
@@ -20,7 +20,7 @@
20import QtQuick 2.020import QtQuick 2.0
21import QtQuick.LocalStorage 2.021import QtQuick.LocalStorage 2.0
22import QtMultimedia 5.022import QtMultimedia 5.0
23import Ubuntu.Components 0.123import Ubuntu.Components 1.1
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 0.1
25import "settings.js" as Settings25import "settings.js" as Settings
2626
@@ -494,44 +494,6 @@
494 opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4494 opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4
495 }495 }
496 }496 }
497
498 /* Search button in wideAspect */
499 Item {
500 id: nowPlayingSearchButton
501 objectName: "searchShape"
502 anchors {
503 right: parent.right
504 rightMargin: units.gu(1)
505 verticalCenter: parent.verticalCenter
506 }
507 height: units.gu(6)
508 opacity: !emptyPage.noMusic ? 1 : .4
509 width: height
510 visible: wideAspect
511
512 function trigger() {
513 if (emptyPage.noMusic) {
514 return;
515 }
516
517 if (!searchSheet.sheetVisible) {
518 PopupUtils.open(searchSheet.sheet,
519 mainView, { title: i18n.tr("Search")} )
520 }
521 }
522
523 Image {
524 id: searchIcon
525 anchors {
526 horizontalCenter: parent.horizontalCenter
527 verticalCenter: parent.verticalCenter
528 }
529 height: units.gu(3)
530 opacity: !emptyPage.noMusic ? 1 : .4
531 source: Qt.resolvedUrl("images/search.svg")
532 width: height
533 }
534 }
535 }497 }
536498
537 /* Progress bar component */499 /* Progress bar component */
538500
=== modified file 'MusicTracks.qml'
--- MusicTracks.qml 2014-07-11 22:29:21 +0000
+++ MusicTracks.qml 2014-07-14 18:02:21 +0000
@@ -18,8 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components 1.1 as Toolkit
23import Ubuntu.Components.ListItems 0.122import Ubuntu.Components.ListItems 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 0.1 as ListItem
25import Ubuntu.MediaScanner 0.124import Ubuntu.MediaScanner 0.1
@@ -41,15 +40,17 @@
41 anchors.fill: parent40 anchors.fill: parent
42 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight41 anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
43 highlightFollowsCurrentItem: false42 highlightFollowsCurrentItem: false
44 model: Toolkit.SortFilterModel {43 model: SortFilterModel {
45 id: songsModelFilter44 id: songsModelFilter
46 property alias rowCount: songsModel.rowCount45 property alias rowCount: songsModelFilter.count
47 model: SongsModel {46 model: SongsModel {
48 id: songsModel47 id: songsModel
49 store: musicStore48 store: musicStore
50 }49 }
51 sort.property: "title"50 sort.property: "title"
52 sort.order: Qt.AscendingOrder51 sort.order: Qt.AscendingOrder
52 filter.property: "title"
53 filter.pattern: new RegExp(searchValue, "i")
53 }54 }
54 delegate: trackDelegate55 delegate: trackDelegate
55 Component {56 Component {
@@ -62,11 +63,12 @@
62 MouseArea {63 MouseArea {
63 anchors.fill: parent64 anchors.fill: parent
64 onClicked: {65 onClicked: {
65 if (focus == false) {66 if (searching) {
66 focus = true67 playSingleTrack(tracklist.model, index)
67 }68 }
6869 else {
69 trackClicked(tracklist.model, index) // play track70 trackClicked(tracklist.model, index) // play track
71 }
70 }72 }
71 }73 }
7274
7375
=== modified file 'MusicaddtoPlaylist.qml'
--- MusicaddtoPlaylist.qml 2014-07-11 22:29:21 +0000
+++ MusicaddtoPlaylist.qml 2014-07-14 18:02:21 +0000
@@ -19,7 +19,7 @@
1919
20import QtMultimedia 5.020import QtMultimedia 5.0
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 1.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 0.1 as ListItem
24import Ubuntu.Components.Popups 0.124import Ubuntu.Components.Popups 0.1
25import QtQuick.LocalStorage 2.025import QtQuick.LocalStorage 2.0
@@ -37,22 +37,21 @@
37// Page that will be used when adding tracks to playlists37// Page that will be used when adding tracks to playlists
38MusicPage {38MusicPage {
39 id: addtoPlaylist39 id: addtoPlaylist
40 searchablePage: false
40 title: i18n.tr("Select playlist")41 title: i18n.tr("Select playlist")
41 visible: false42 visible: false
4243
43 tools: ToolbarItems {44 head.actions: [
44 ToolbarButton {45 Action {
45 action: Action {46 objectName: "newplaylistButton"
46 objectName: "newplaylistButton"47 text: i18n.tr("New playlist")
47 text: i18n.tr("New playlist")48 iconSource: "images/add.svg"
48 iconSource: "images/add.svg"49 onTriggered: {
49 onTriggered: {50 customdebug("New playlist.")
50 customdebug("New playlist.")51 PopupUtils.open(newPlaylistDialog, mainView)
51 PopupUtils.open(newPlaylistDialog, mainView)
52 }
53 }52 }
54 }53 }
55 }54 ]
5655
57 Component.onCompleted: {56 Component.onCompleted: {
58 // check the four latest track in each playlist57 // check the four latest track in each playlist
@@ -65,14 +64,16 @@
65 ListView {64 ListView {
66 id: addtoPlaylistView65 id: addtoPlaylistView
67 anchors {66 anchors {
68 bottom: newPlaylistItem.top67 bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
69 left: parent.left68 fill: parent
70 right: parent.right
71 top: parent.top
72 }69 }
73 clip: true70 clip: true
74 height: parent.width71 height: parent.width
75 model: playlistModel.model72 model: SortFilterModel {
73 model: playlistModel.model
74 filter.property: "name"
75 filter.pattern: new RegExp(searchValue, "i")
76 }
76 objectName: "addtoplaylistview"77 objectName: "addtoplaylistview"
77 width: parent.width78 width: parent.width
78 delegate: ListItem.Standard {79 delegate: ListItem.Standard {
7980
=== modified file 'Style.qml'
--- Style.qml 2014-05-23 15:00:21 +0000
+++ Style.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
2222
2323
24QtObject {24QtObject {
2525
=== modified file 'common/AlbumsPage.qml'
--- common/AlbumsPage.qml 2014-07-09 03:16:28 +0000
+++ common/AlbumsPage.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 0.1 as ListItem
24import Ubuntu.MediaScanner 0.124import Ubuntu.MediaScanner 0.1
@@ -29,6 +29,7 @@
29MusicPage {29MusicPage {
30 id: albumStackPage30 id: albumStackPage
31 anchors.bottomMargin: units.gu(.5)31 anchors.bottomMargin: units.gu(.5)
32 searchablePage: false
32 visible: false33 visible: false
3334
34 property string artist: ""35 property string artist: ""
@@ -42,10 +43,14 @@
42 }43 }
43 delegate: albumTracksDelegate44 delegate: albumTracksDelegate
44 header: artistHeaderDelegate45 header: artistHeaderDelegate
45 model: AlbumsModel {46 model: SortFilterModel {
46 id: artistsModel47 model: AlbumsModel {
47 albumArtist: albumStackPage.artist48 id: artistsModel
48 store: musicStore49 albumArtist: albumStackPage.artist
50 store: musicStore
51 }
52 filter.property: "title"
53 filter.pattern: new RegExp(searchValue, "i")
49 }54 }
50 width: parent.width55 width: parent.width
5156
@@ -63,6 +68,7 @@
63 }68 }
64 height: parent.height - units.gu(2)69 height: parent.height - units.gu(2)
65 width: height70 width: height
71
66 CoverRow {72 CoverRow {
67 id: artistImage73 id: artistImage
68 anchors {74 anchors {
@@ -70,9 +76,9 @@
70 top: parent.top76 top: parent.top
71 }77 }
7278
73 count: albumtrackslist.count79 count: albumStackPage.covers.length
74 size: parent.height80 size: parent.height
75 covers: albumStackPage.covers;81 covers: albumStackPage.covers
76 spacing: units.gu(4)82 spacing: units.gu(4)
77 }83 }
78 Item { // Background so can see text in current state84 Item { // Background so can see text in current state
7985
=== modified file 'common/BlurredBackground.qml'
--- common/BlurredBackground.qml 2014-05-23 15:00:21 +0000
+++ common/BlurredBackground.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import QtGraphicalEffects 1.022import QtGraphicalEffects 1.0
2323
24// Blurred background24// Blurred background
2525
=== modified file 'common/CoverRow.qml'
--- common/CoverRow.qml 2014-05-23 15:00:21 +0000
+++ common/CoverRow.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
2222
23UbuntuShape {23UbuntuShape {
24 id: coverRow24 id: coverRow
2525
=== modified file 'common/Expander.qml'
--- common/Expander.qml 2014-05-23 15:00:21 +0000
+++ common/Expander.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
2323
24Item {24Item {
2525
=== modified file 'common/ExpanderItems/AddToPlaylist.qml'
--- common/ExpanderItems/AddToPlaylist.qml 2014-06-19 21:16:33 +0000
+++ common/ExpanderItems/AddToPlaylist.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
2222
23// add to playlist23// add to playlist
2424
=== modified file 'common/ExpanderItems/AddToQueue.qml'
--- common/ExpanderItems/AddToQueue.qml 2014-05-10 19:11:33 +0000
+++ common/ExpanderItems/AddToQueue.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
2222
23Rectangle {23Rectangle {
2424
=== modified file 'common/ExpanderItems/DeletePlaylist.qml'
--- common/ExpanderItems/DeletePlaylist.qml 2014-04-26 17:13:02 +0000
+++ common/ExpanderItems/DeletePlaylist.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
2222
23Rectangle {23Rectangle {
2424
=== modified file 'common/ExpanderItems/EditPlaylist.qml'
--- common/ExpanderItems/EditPlaylist.qml 2014-04-26 17:13:02 +0000
+++ common/ExpanderItems/EditPlaylist.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
21import Ubuntu.Components.Popups 0.121import Ubuntu.Components.Popups 0.1
2222
23Rectangle {23Rectangle {
2424
=== modified file 'common/LoadingSpinnerComponent.qml'
--- common/LoadingSpinnerComponent.qml 2014-04-13 21:28:28 +0000
+++ common/LoadingSpinnerComponent.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 * Andrew Starr-Bochicchio <a.starr.b@gmail.com>18 * Andrew Starr-Bochicchio <a.starr.b@gmail.com>
19 */19 */
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
2222
23Item {23Item {
24 id: refresh24 id: refresh
2525
=== modified file 'common/MusicPage.qml'
--- common/MusicPage.qml 2014-07-02 12:27:30 +0000
+++ common/MusicPage.qml 2014-07-14 18:02:21 +0000
@@ -17,16 +17,83 @@
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */18 */
1919
20import Ubuntu.Components 0.120import QtQuick 2.0
21import Ubuntu.Components 1.1
2122
2223
23// generic page for music, could be useful for bottomedge implementation24// generic page for music, could be useful for bottomedge implementation
24Page {25Page {
25 id: thisPage26 id: thisPage
2627
28 property string searchValue: thisPage.state === "search" ? searchField.text : ""
29 property bool searching: thisPage.state === "search"
30 property bool searchablePage: true
31
32 onStateChanged: {
33 console.debug("PAGE:", title, "STATE CHANGED:", state)
34 }
35
36 Action {
37 id: searchAction
38 iconName: "search"
39 onTriggered: {
40 console.debug("SEARCHING MODE SELECTED, PAGE: ", thisPage.title)
41 thisPage.state = "search"
42 searchField.focus = true
43 }
44 }
45
46 head.actions: searchablePage ? [ searchAction ] : []
47
48 state: ""
49 states: [
50 State {
51 name: ""
52 PropertyChanges {
53 target: thisPage.head
54 // needed otherwise actions will not be
55 // returned to its original state.
56 actions: searchablePage ? [ searchAction ] : []
57 }
58 },
59 PageHeadState {
60 id: headerState
61 name: "search"
62 head: thisPage.head
63 backAction: Action {
64 id: leaveSearchAction
65 text: "back"
66 iconName: "back"
67 onTriggered: {
68 console.debug("BACK SELECTED WHEN SEARCHING, PAGE: ", thisPage.title)
69 thisPage.state = ""
70 searchField.text = ""
71 }
72 }
73 contents: TextField {
74 id: searchField
75 anchors {
76 right: parent ? parent.right : undefined
77 rightMargin: units.gu(1)
78 }
79 hasClearButton: true
80 inputMethodHints: Qt.ImhNoPredictiveText
81 placeholderText: i18n.tr("Search...")
82 onTextChanged: {
83 console.debug("SEARCH TEXT CHANGED:", text, "PAGE: ", thisPage.title)
84 }
85 }
86 }
87 ]
88
27 onVisibleChanged: {89 onVisibleChanged: {
28 if (visible) {90 if (visible) {
29 musicToolbar.setPage(thisPage);91 musicToolbar.setPage(thisPage);
30 }92 }
93 else {
94 console.debug("PAGE MADE INVISIBLE SEARCH STATE FORCED TO FALSE, PAGE: ", thisPage.title)
95 thisPage.state = ""
96 searchField.text = ""
97 }
31 }98 }
32}99}
33100
=== modified file 'common/SongsPage.qml'
--- common/SongsPage.qml 2014-07-11 22:29:21 +0000
+++ common/SongsPage.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.1 as ListItem22import Ubuntu.Components.ListItems 0.1 as ListItem
23import Ubuntu.MediaScanner 0.123import Ubuntu.MediaScanner 0.1
24import Ubuntu.Thumbnailer 0.124import Ubuntu.Thumbnailer 0.1
@@ -29,6 +29,7 @@
29MusicPage {29MusicPage {
30 id: songStackPage30 id: songStackPage
31 anchors.bottomMargin: units.gu(.5)31 anchors.bottomMargin: units.gu(.5)
32 searchablePage: false
32 visible: false33 visible: false
3334
34 property string line1: ""35 property string line1: ""
@@ -54,7 +55,13 @@
54 fill: parent55 fill: parent
55 }56 }
56 delegate: albumTracksDelegate57 delegate: albumTracksDelegate
57 model: isAlbum ? songsModel : albumTracksModel.model58 model: SortFilterModel {
59 id: albumTrackFilterModel
60 property alias rowCount: albumTrackFilterModel.count
61 model: isAlbum ? songsModel : albumTracksModel.model
62 filter.property: "title"
63 filter.pattern: new RegExp(searchValue, "i")
64 }
58 width: parent.width65 width: parent.width
59 header: ListItem.Standard {66 header: ListItem.Standard {
60 id: albumInfo67 id: albumInfo
@@ -154,6 +161,7 @@
154 MouseArea {161 MouseArea {
155 anchors.fill: parent162 anchors.fill: parent
156 onClicked: {163 onClicked: {
164 // Play all will play all the shown tracks (takes filter into account)
157 trackClicked(albumtrackslist.model, 0) // play track165 trackClicked(albumtrackslist.model, 0) // play track
158166
159 if (isAlbum && songStackPage.line1 !== "Genre") {167 if (isAlbum && songStackPage.line1 !== "Genre") {
@@ -201,6 +209,7 @@
201 MouseArea {209 MouseArea {
202 anchors.fill: parent210 anchors.fill: parent
203 onClicked: {211 onClicked: {
212 // Play all will play all the shown tracks (takes filter into account)
204 addQueueFromModel(albumtrackslist.model)213 addQueueFromModel(albumtrackslist.model)
205 }214 }
206 }215 }
@@ -226,7 +235,12 @@
226 focus = true235 focus = true
227 }236 }
228237
229 trackClicked(albumtrackslist.model, index) // play track238 if (searching) {
239 playSingleTrack(albumtrackslist.model, index)
240 }
241 else {
242 trackClicked(albumtrackslist.model.model, index) // play track
243 }
230244
231 if (isAlbum && songStackPage.line1 !== "Genre") {245 if (isAlbum && songStackPage.line1 !== "Genre") {
232 Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")246 Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album")
233247
=== modified file 'common/SwipeDelete.qml'
--- common/SwipeDelete.qml 2013-11-19 04:57:30 +0000
+++ common/SwipeDelete.qml 2014-07-14 18:02:21 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19import QtQuick 2.019import QtQuick 2.0
20import Ubuntu.Components 0.120import Ubuntu.Components 1.1
2121
22/* SwipeDelete object */22/* SwipeDelete object */
23Rectangle {23Rectangle {
2424
=== modified file 'music-app.qml'
--- music-app.qml 2014-07-13 21:11:11 +0000
+++ music-app.qml 2014-07-14 18:02:21 +0000
@@ -18,7 +18,7 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Ubuntu.Components 0.121import Ubuntu.Components 1.1
22import Ubuntu.Components.ListItems 0.122import Ubuntu.Components.ListItems 0.1
23import Ubuntu.Components.Popups 0.123import Ubuntu.Components.Popups 0.1
24import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -505,6 +505,19 @@
505 trackClicked(allSongsModel, index, true)505 trackClicked(allSongsModel, index, true)
506 }506 }
507507
508 function playSingleTrack(model, index)
509 {
510 // TODO: remove once playlists uses U1DB
511 if (model.hasOwnProperty("linkLibraryListModel")) {
512 model = model.linkLibraryListModel;
513 }
514
515 trackQueue.model.clear()
516 trackQueue.append(makeDict(model.get(index, model.RoleModelData)))
517
518 trackQueueClick(0);
519 }
520
508 // Load mediascanner store521 // Load mediascanner store
509 MediaStore {522 MediaStore {
510 id: musicStore523 id: musicStore
@@ -634,11 +647,6 @@
634 }647 }
635 }648 }
636649
637 // load sheets (after model)
638 MusicSearch {
639 id: searchSheet
640 }
641
642 // Blurred background650 // Blurred background
643 BlurredBackground {651 BlurredBackground {
644 }652 }
@@ -889,6 +897,8 @@
889 Component.onCompleted: musicToolbar.currentTab = selectedTab897 Component.onCompleted: musicToolbar.currentTab = selectedTab
890898
891 onSelectedTabChanged: {899 onSelectedTabChanged: {
900 console.debug("SELECTED TAB CHANGED:", selectedTab.title);
901
892 // pause loading of the models in the old tab902 // pause loading of the models in the old tab
893 if (musicToolbar.currentTab !== selectedTab &&903 if (musicToolbar.currentTab !== selectedTab &&
894 musicToolbar.currentTab !== null)904 musicToolbar.currentTab !== null)

Subscribers

People subscribed via source and target branches

to status/vote changes: