Merge lp:~ahayzen/music-app/add-sdk-search-support into lp:music-app/trusty
- add-sdk-search-support
- Merge into trusty
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 | ||||||||
Related bugs: |
|
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 519. By Andrew Hayzen
-
* Fix for album art not being filtered on AlbumsPage.qml
* Make searches case insensitive
* Fix for typo
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:519
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
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://
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.
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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:521
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 522. By Andrew Hayzen
-
* Add tracing
- 523. By Andrew Hayzen
-
* Merge of trunk
- 524. By Andrew Hayzen
-
* Merge of trunk
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:524
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 525. By Andrew Hayzen
-
* Merge of trunk
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:525
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
#blocked due to https:/
Victor Thompson (vthompson) wrote : | # |
Setting to WIP due to blockage.
Victor Thompson (vthompson) wrote : | # |
Search has landed. Rejecting this MP.
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
1 | === modified file 'LoginLastFM.qml' |
2 | --- LoginLastFM.qml 2014-05-04 16:34:49 +0000 |
3 | +++ LoginLastFM.qml 2014-07-14 18:02:21 +0000 |
4 | @@ -16,7 +16,7 @@ |
5 | */ |
6 | |
7 | import QtQuick 2.0 |
8 | -import Ubuntu.Components 0.1 |
9 | +import Ubuntu.Components 1.1 |
10 | import Ubuntu.Components.ListItems 0.1 |
11 | import Ubuntu.Components.Popups 0.1 |
12 | import Ubuntu.Components.ListItems 0.1 as ListItem |
13 | |
14 | === modified file 'MusicAlbums.qml' |
15 | --- MusicAlbums.qml 2014-07-09 03:16:28 +0000 |
16 | +++ MusicAlbums.qml 2014-07-14 18:02:21 +0000 |
17 | @@ -18,8 +18,7 @@ |
18 | */ |
19 | |
20 | import QtQuick 2.0 |
21 | -import Ubuntu.Components 0.1 |
22 | -import Ubuntu.Components 1.1 as Toolkit |
23 | +import Ubuntu.Components 1.1 |
24 | import Ubuntu.Components.ListItems 0.1 |
25 | import Ubuntu.Components.Popups 0.1 |
26 | import Ubuntu.Components.ListItems 0.1 as ListItem |
27 | @@ -52,17 +51,17 @@ |
28 | anchors.bottomMargin: units.gu(1) |
29 | cellHeight: height/3 |
30 | cellWidth: height/3 |
31 | - model: Toolkit.SortFilterModel { |
32 | + model: SortFilterModel { |
33 | id: albumsModelFilter |
34 | - property alias rowCount: albumsModel.rowCount |
35 | model: AlbumsModel { |
36 | id: albumsModel |
37 | store: musicStore |
38 | } |
39 | sort.property: "title" |
40 | sort.order: Qt.AscendingOrder |
41 | + filter.property: "title" |
42 | + filter.pattern: new RegExp(searchValue, "i") |
43 | } |
44 | - |
45 | delegate: albumDelegate |
46 | flow: GridView.TopToBottom |
47 | |
48 | |
49 | === modified file 'MusicArtists.qml' |
50 | --- MusicArtists.qml 2014-07-11 22:29:21 +0000 |
51 | +++ MusicArtists.qml 2014-07-14 18:02:21 +0000 |
52 | @@ -18,7 +18,7 @@ |
53 | */ |
54 | |
55 | import QtQuick 2.0 |
56 | -import Ubuntu.Components 0.1 |
57 | +import Ubuntu.Components 1.1 |
58 | import Ubuntu.Components.ListItems 0.1 |
59 | import Ubuntu.Components.Popups 0.1 |
60 | import Ubuntu.Components.ListItems 0.1 as ListItem |
61 | @@ -40,12 +40,15 @@ |
62 | id: artistlist |
63 | anchors.fill: parent |
64 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight |
65 | - model: ArtistsModel { |
66 | - id: artistsModel |
67 | - albumArtists: true |
68 | - store: musicStore |
69 | + model: SortFilterModel { |
70 | + model: ArtistsModel { |
71 | + id: artistsModel |
72 | + albumArtists: true |
73 | + store: musicStore |
74 | + } |
75 | + filter.property: "artist" |
76 | + filter.pattern: new RegExp(searchValue, "i") |
77 | } |
78 | - |
79 | delegate: artistDelegate |
80 | |
81 | Component { |
82 | |
83 | === modified file 'MusicNowPlaying.qml' |
84 | --- MusicNowPlaying.qml 2014-06-24 19:35:57 +0000 |
85 | +++ MusicNowPlaying.qml 2014-07-14 18:02:21 +0000 |
86 | @@ -21,7 +21,7 @@ |
87 | import QtMultimedia 5.0 |
88 | import QtQuick 2.0 |
89 | import QtQuick.LocalStorage 2.0 |
90 | -import Ubuntu.Components 0.1 |
91 | +import Ubuntu.Components 1.1 |
92 | import Ubuntu.Components.ListItems 0.1 as ListItem |
93 | import Ubuntu.Thumbnailer 0.1 |
94 | import "common" |
95 | @@ -31,6 +31,7 @@ |
96 | MusicPage { |
97 | id: nowPlaying |
98 | objectName: "nowplayingpage" |
99 | + searchablePage: false |
100 | title: i18n.tr("Now Playing") |
101 | visible: false |
102 | |
103 | |
104 | === modified file 'MusicPlaylists.qml' |
105 | --- MusicPlaylists.qml 2014-07-11 22:29:21 +0000 |
106 | +++ MusicPlaylists.qml 2014-07-14 18:02:21 +0000 |
107 | @@ -19,7 +19,7 @@ |
108 | */ |
109 | |
110 | import QtQuick 2.0 |
111 | -import Ubuntu.Components 0.1 |
112 | +import Ubuntu.Components 1.1 |
113 | import Ubuntu.Components.ListItems 0.1 |
114 | import Ubuntu.Components.Popups 0.1 |
115 | import Ubuntu.Components.ListItems 0.1 as ListItem |
116 | @@ -36,6 +36,7 @@ |
117 | id: listspage |
118 | // TRANSLATORS: this is the name of the playlists page shown in the tab header. |
119 | // Remember to keep the translation short to fit the screen width |
120 | + searchablePage: false |
121 | title: i18n.tr("Playlists") |
122 | |
123 | property string playlistTracks: "" |
124 | @@ -44,19 +45,17 @@ |
125 | property string oldPlaylistID: "" |
126 | property string inPlaylist: "" |
127 | |
128 | - tools: ToolbarItems { |
129 | - ToolbarButton { |
130 | - action: Action { |
131 | - objectName: "newplaylistButton" |
132 | - text: i18n.tr("New playlist") |
133 | - iconSource: "images/add.svg" |
134 | - onTriggered: { |
135 | - customdebug("New playlist.") |
136 | - PopupUtils.open(newPlaylistDialog, mainView) |
137 | - } |
138 | + head.actions: [ |
139 | + Action { |
140 | + objectName: "newplaylistButton" |
141 | + text: i18n.tr("New playlist") |
142 | + iconSource: "images/add.svg" |
143 | + onTriggered: { |
144 | + customdebug("New playlist.") |
145 | + PopupUtils.open(newPlaylistDialog, mainView) |
146 | } |
147 | } |
148 | - } |
149 | + ] |
150 | |
151 | // Edit name of playlist dialog |
152 | Component { |
153 | @@ -136,7 +135,13 @@ |
154 | objectName: "playlistslist" |
155 | anchors.fill: parent |
156 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight |
157 | - model: playlistModel.model |
158 | + model: SortFilterModel { |
159 | + id: playlistFilterModel |
160 | + property alias rowCount: playlistFilterModel.count |
161 | + model: playlistModel.model |
162 | + filter.property: "name" |
163 | + filter.pattern: new RegExp(searchValue, "i") |
164 | + } |
165 | delegate: playlistDelegate |
166 | onCountChanged: { |
167 | customdebug("onCountChanged: " + playlistslist.count) |
168 | @@ -193,10 +198,10 @@ |
169 | |
170 | onClicked: { |
171 | albumTracksModel.filterPlaylistTracks(name) |
172 | + songsPage.covers = playlist.covers |
173 | songsPage.isAlbum = false |
174 | songsPage.line1 = "Playlist" |
175 | songsPage.line2 = model.name |
176 | - songsPage.covers = playlist.covers |
177 | songsPage.title = i18n.tr("Playlist") |
178 | |
179 | mainPageStack.push(songsPage) |
180 | |
181 | === removed file 'MusicSearch.qml' |
182 | --- MusicSearch.qml 2014-07-11 22:29:21 +0000 |
183 | +++ MusicSearch.qml 1970-01-01 00:00:00 +0000 |
184 | @@ -1,218 +0,0 @@ |
185 | -/* |
186 | - * Copyright (C) 2013, 2014 |
187 | - * Andrew Hayzen <ahayzen@gmail.com> |
188 | - * Daniel Holm <d.holmen@gmail.com> |
189 | - * Victor Thompson <victor.thompson@gmail.com> |
190 | - * |
191 | - * This program is free software; you can redistribute it and/or modify |
192 | - * it under the terms of the GNU General Public License as published by |
193 | - * the Free Software Foundation; version 3. |
194 | - * |
195 | - * This program is distributed in the hope that it will be useful, |
196 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
197 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
198 | - * GNU General Public License for more details. |
199 | - * |
200 | - * You should have received a copy of the GNU General Public License |
201 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
202 | - */ |
203 | - |
204 | -import QtMultimedia 5.0 |
205 | -import QtQuick 2.0 |
206 | -import Ubuntu.Components 0.1 |
207 | -import Ubuntu.Components.ListItems 0.1 as ListItem |
208 | -import Ubuntu.Components.Popups 0.1 |
209 | -import Ubuntu.MediaScanner 0.1 |
210 | -import Ubuntu.Thumbnailer 0.1 |
211 | -import QtQuick.LocalStorage 2.0 |
212 | -import "playlists.js" as Playlists |
213 | -import "common" |
214 | -import "common/ExpanderItems" |
215 | - |
216 | -Item { |
217 | - id: sheetItem |
218 | - |
219 | - property alias sheet: sheetComponent |
220 | - property bool sheetVisible: false |
221 | - |
222 | - Component { |
223 | - id: sheetComponent |
224 | - |
225 | - // Sheet to search for music tracks |
226 | - DefaultSheet { |
227 | - id: searchTrack |
228 | - title: i18n.tr("Search") |
229 | - contentsHeight: units.gu(80) |
230 | - |
231 | - onDoneClicked: PopupUtils.close(searchTrack) |
232 | - |
233 | - Component.onCompleted: { |
234 | - searchField.forceActiveFocus() |
235 | - } |
236 | - |
237 | - onVisibleChanged: { |
238 | - if (visible) { |
239 | - musicToolbar.setSheet(searchTrack) |
240 | - sheetVisible = true |
241 | - } |
242 | - else { |
243 | - musicToolbar.removeSheet(searchTrack) |
244 | - sheetVisible = false |
245 | - } |
246 | - } |
247 | - |
248 | - TextField { |
249 | - id: searchField |
250 | - anchors { |
251 | - left: parent.left; |
252 | - leftMargin: units.gu(2); |
253 | - top: parent.top; |
254 | - right: parent.right; |
255 | - rightMargin: units.gu(2); |
256 | - } |
257 | - |
258 | - width: parent.width/1.5 |
259 | - placeholderText: "Search" |
260 | - hasClearButton: true |
261 | - highlighted: true |
262 | - focus: true |
263 | - inputMethodHints: Qt.ImhNoPredictiveText |
264 | - //canPaste: true // why work, you do not, hrm? |
265 | - |
266 | - // search icon |
267 | - primaryItem: Image { |
268 | - height: parent.height*0.5 |
269 | - width: parent.height*0.5 |
270 | - anchors.verticalCenter: parent.verticalCenter |
271 | - anchors.verticalCenterOffset: -units.gu(0.2) |
272 | - source: Qt.resolvedUrl("images/search.svg") |
273 | - } |
274 | - |
275 | - onTextChanged: { |
276 | - searchTimer.start() // start the countdown, baby! |
277 | - } |
278 | - |
279 | - // Provide a small pause before search |
280 | - Timer { |
281 | - id: searchTimer |
282 | - interval: 500 |
283 | - repeat: false |
284 | - onTriggered: { |
285 | - songsSearchModel.query = searchField.text; |
286 | - searchActivity.running = true // start the activity indicator |
287 | - |
288 | - indicatorTimer.start() |
289 | - } |
290 | - } |
291 | - // and onother one for the indicator |
292 | - Timer { |
293 | - id: indicatorTimer |
294 | - interval: 500 |
295 | - repeat: false |
296 | - onTriggered: { |
297 | - searchActivity.running = false |
298 | - } |
299 | - } |
300 | - |
301 | - // Indicator to show search activity |
302 | - ActivityIndicator { |
303 | - id: searchActivity |
304 | - anchors { |
305 | - verticalCenter: searchField.verticalCenter; |
306 | - right: searchField.right; |
307 | - rightMargin: units.gu(1) |
308 | - } |
309 | - running: false |
310 | - } |
311 | - } |
312 | - |
313 | - Rectangle { |
314 | - width: parent.width |
315 | - height: parent.height |
316 | - color: "transparent" |
317 | - visible: searchField.text |
318 | - clip: true |
319 | - anchors { |
320 | - top: searchField.bottom |
321 | - bottom: parent.bottom |
322 | - left: parent.left |
323 | - right: parent.right |
324 | - } |
325 | - |
326 | - // show each playlist and make them chosable |
327 | - ListView { |
328 | - id: searchTrackView |
329 | - objectName: "searchtrackview" |
330 | - width: parent.width |
331 | - height: parent.width |
332 | - model: SongsSearchModel { |
333 | - id: songsSearchModel |
334 | - store: musicStore |
335 | - } |
336 | - |
337 | - onMovementStarted: { |
338 | - searchTrackView.forceActiveFocus() |
339 | - } |
340 | - |
341 | - delegate: ListItem.Standard { |
342 | - id: search |
343 | - objectName: "playlist" |
344 | - width: parent.width |
345 | - height: styleMusic.common.itemHeight |
346 | - |
347 | - onClicked: { |
348 | - console.debug("Debug: "+title+" added to queue") |
349 | - // now play this track, but keep current queue |
350 | - trackQueue.append(model) |
351 | - trackQueueClick(trackQueue.model.count - 1); |
352 | - onDoneClicked: PopupUtils.close(searchTrack) |
353 | - } |
354 | - |
355 | - MusicRow { |
356 | - covers: [{author: model.author, album: model.title}] |
357 | - column: Column { |
358 | - spacing: units.gu(1) |
359 | - Label { |
360 | - id: trackArtist |
361 | - color: styleMusic.common.subtitle |
362 | - fontSize: "x-small" |
363 | - text: model.author |
364 | - } |
365 | - Label { |
366 | - id: trackTitle |
367 | - color: styleMusic.common.music |
368 | - fontSize: "small" |
369 | - objectName: "tracktitle" |
370 | - text: model.title |
371 | - } |
372 | - Label { |
373 | - id: trackAlbum |
374 | - color: styleMusic.common.subtitle |
375 | - fontSize: "xx-small" |
376 | - text: model.album |
377 | - } |
378 | - } |
379 | - } |
380 | - |
381 | - Expander { |
382 | - id: expandable |
383 | - anchors { |
384 | - fill: parent |
385 | - } |
386 | - listItem: search |
387 | - model: songsSearchModel.get(index, songsSearchModel.RoleModelData) |
388 | - row: Row { |
389 | - AddToPlaylist { |
390 | - |
391 | - } |
392 | - AddToQueue { |
393 | - |
394 | - } |
395 | - } |
396 | - } |
397 | - } |
398 | - } |
399 | - } |
400 | - } |
401 | - } |
402 | -} |
403 | |
404 | === modified file 'MusicSettings.qml' |
405 | --- MusicSettings.qml 2014-05-28 15:07:35 +0000 |
406 | +++ MusicSettings.qml 2014-07-14 18:02:21 +0000 |
407 | @@ -17,7 +17,7 @@ |
408 | */ |
409 | |
410 | import QtQuick 2.0 |
411 | -import Ubuntu.Components 0.1 |
412 | +import Ubuntu.Components 1.1 |
413 | import Ubuntu.Components.ListItems 0.1 as ListItem |
414 | import Ubuntu.Components.Popups 0.1 |
415 | import QtQuick.LocalStorage 2.0 |
416 | |
417 | === modified file 'MusicStart.qml' |
418 | --- MusicStart.qml 2014-07-09 03:16:28 +0000 |
419 | +++ MusicStart.qml 2014-07-14 18:02:21 +0000 |
420 | @@ -18,8 +18,7 @@ |
421 | */ |
422 | |
423 | import QtQuick 2.0 |
424 | -import Ubuntu.Components 0.1 |
425 | -import Ubuntu.Components 1.1 as Toolkit |
426 | +import Ubuntu.Components 1.1 |
427 | import Ubuntu.Components.ListItems 0.1 |
428 | import Ubuntu.Components.Popups 0.1 |
429 | import Ubuntu.Components.ListItems 0.1 as ListItem |
430 | @@ -34,6 +33,7 @@ |
431 | |
432 | MusicPage { |
433 | id: mainpage |
434 | + searchablePage: false |
435 | title: i18n.tr("Music") |
436 | |
437 | /* Dev button for search. |
438 | @@ -88,7 +88,12 @@ |
439 | spacing: units.gu(1) |
440 | height: units.gu(18) |
441 | // TODO: Update when view counts are collected |
442 | - model: recentModel.model |
443 | + model: SortFilterModel { |
444 | + id: recentListFilterModel |
445 | + model: recentModel.model |
446 | + filter.property: "genre" |
447 | + filter.pattern: new RegExp(searchValue, "i") |
448 | + } |
449 | delegate: recentDelegate |
450 | header: Item { |
451 | id: recentSpacer |
452 | @@ -233,8 +238,12 @@ |
453 | anchors.topMargin: units.gu(1) |
454 | spacing: units.gu(1) |
455 | height: units.gu(18) |
456 | - model: GenresModel { |
457 | - store: musicStore |
458 | + model: SortFilterModel { |
459 | + model: GenresModel { |
460 | + store: musicStore |
461 | + } |
462 | + filter.property: "genre" |
463 | + filter.pattern: new RegExp(searchValue, "i") |
464 | } |
465 | |
466 | delegate: genreDelegate |
467 | @@ -388,15 +397,15 @@ |
468 | anchors.topMargin: units.gu(1) |
469 | spacing: units.gu(1) |
470 | height: units.gu(18) |
471 | - model: Toolkit.SortFilterModel { |
472 | - id: albumsModelFilter |
473 | - property alias rowCount: albumsModel.rowCount |
474 | + model: SortFilterModel { |
475 | model: AlbumsModel { |
476 | id: albumsModel |
477 | store: musicStore |
478 | } |
479 | sort.property: "title" |
480 | sort.order: Qt.AscendingOrder |
481 | + filter.property: "title" |
482 | + filter.pattern: new RegExp(searchValue, "i") |
483 | } |
484 | delegate: albumDelegate |
485 | header: Item { |
486 | @@ -432,7 +441,6 @@ |
487 | anchors.fill: parent |
488 | onClicked: { |
489 | songsPage.album = album |
490 | - songsPage.covers = covers |
491 | songsPage.genre = undefined |
492 | songsPage.isAlbum = true |
493 | songsPage.line1 = artist |
494 | |
495 | === modified file 'MusicToolbar.qml' |
496 | --- MusicToolbar.qml 2014-07-02 22:28:59 +0000 |
497 | +++ MusicToolbar.qml 2014-07-14 18:02:21 +0000 |
498 | @@ -20,7 +20,7 @@ |
499 | import QtQuick 2.0 |
500 | import QtQuick.LocalStorage 2.0 |
501 | import QtMultimedia 5.0 |
502 | -import Ubuntu.Components 0.1 |
503 | +import Ubuntu.Components 1.1 |
504 | import Ubuntu.Components.Popups 0.1 |
505 | import "settings.js" as Settings |
506 | |
507 | @@ -494,44 +494,6 @@ |
508 | opacity: player.shuffle && !emptyPage.noMusic ? 1 : .4 |
509 | } |
510 | } |
511 | - |
512 | - /* Search button in wideAspect */ |
513 | - Item { |
514 | - id: nowPlayingSearchButton |
515 | - objectName: "searchShape" |
516 | - anchors { |
517 | - right: parent.right |
518 | - rightMargin: units.gu(1) |
519 | - verticalCenter: parent.verticalCenter |
520 | - } |
521 | - height: units.gu(6) |
522 | - opacity: !emptyPage.noMusic ? 1 : .4 |
523 | - width: height |
524 | - visible: wideAspect |
525 | - |
526 | - function trigger() { |
527 | - if (emptyPage.noMusic) { |
528 | - return; |
529 | - } |
530 | - |
531 | - if (!searchSheet.sheetVisible) { |
532 | - PopupUtils.open(searchSheet.sheet, |
533 | - mainView, { title: i18n.tr("Search")} ) |
534 | - } |
535 | - } |
536 | - |
537 | - Image { |
538 | - id: searchIcon |
539 | - anchors { |
540 | - horizontalCenter: parent.horizontalCenter |
541 | - verticalCenter: parent.verticalCenter |
542 | - } |
543 | - height: units.gu(3) |
544 | - opacity: !emptyPage.noMusic ? 1 : .4 |
545 | - source: Qt.resolvedUrl("images/search.svg") |
546 | - width: height |
547 | - } |
548 | - } |
549 | } |
550 | |
551 | /* Progress bar component */ |
552 | |
553 | === modified file 'MusicTracks.qml' |
554 | --- MusicTracks.qml 2014-07-11 22:29:21 +0000 |
555 | +++ MusicTracks.qml 2014-07-14 18:02:21 +0000 |
556 | @@ -18,8 +18,7 @@ |
557 | */ |
558 | |
559 | import QtQuick 2.0 |
560 | -import Ubuntu.Components 0.1 |
561 | -import Ubuntu.Components 1.1 as Toolkit |
562 | +import Ubuntu.Components 1.1 |
563 | import Ubuntu.Components.ListItems 0.1 |
564 | import Ubuntu.Components.ListItems 0.1 as ListItem |
565 | import Ubuntu.MediaScanner 0.1 |
566 | @@ -41,15 +40,17 @@ |
567 | anchors.fill: parent |
568 | anchors.bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight |
569 | highlightFollowsCurrentItem: false |
570 | - model: Toolkit.SortFilterModel { |
571 | + model: SortFilterModel { |
572 | id: songsModelFilter |
573 | - property alias rowCount: songsModel.rowCount |
574 | + property alias rowCount: songsModelFilter.count |
575 | model: SongsModel { |
576 | id: songsModel |
577 | store: musicStore |
578 | } |
579 | sort.property: "title" |
580 | sort.order: Qt.AscendingOrder |
581 | + filter.property: "title" |
582 | + filter.pattern: new RegExp(searchValue, "i") |
583 | } |
584 | delegate: trackDelegate |
585 | Component { |
586 | @@ -62,11 +63,12 @@ |
587 | MouseArea { |
588 | anchors.fill: parent |
589 | onClicked: { |
590 | - if (focus == false) { |
591 | - focus = true |
592 | - } |
593 | - |
594 | - trackClicked(tracklist.model, index) // play track |
595 | + if (searching) { |
596 | + playSingleTrack(tracklist.model, index) |
597 | + } |
598 | + else { |
599 | + trackClicked(tracklist.model, index) // play track |
600 | + } |
601 | } |
602 | } |
603 | |
604 | |
605 | === modified file 'MusicaddtoPlaylist.qml' |
606 | --- MusicaddtoPlaylist.qml 2014-07-11 22:29:21 +0000 |
607 | +++ MusicaddtoPlaylist.qml 2014-07-14 18:02:21 +0000 |
608 | @@ -19,7 +19,7 @@ |
609 | |
610 | import QtMultimedia 5.0 |
611 | import QtQuick 2.0 |
612 | -import Ubuntu.Components 0.1 |
613 | +import Ubuntu.Components 1.1 |
614 | import Ubuntu.Components.ListItems 0.1 as ListItem |
615 | import Ubuntu.Components.Popups 0.1 |
616 | import QtQuick.LocalStorage 2.0 |
617 | @@ -37,22 +37,21 @@ |
618 | // Page that will be used when adding tracks to playlists |
619 | MusicPage { |
620 | id: addtoPlaylist |
621 | + searchablePage: false |
622 | title: i18n.tr("Select playlist") |
623 | visible: false |
624 | |
625 | - tools: ToolbarItems { |
626 | - ToolbarButton { |
627 | - action: Action { |
628 | - objectName: "newplaylistButton" |
629 | - text: i18n.tr("New playlist") |
630 | - iconSource: "images/add.svg" |
631 | - onTriggered: { |
632 | - customdebug("New playlist.") |
633 | - PopupUtils.open(newPlaylistDialog, mainView) |
634 | - } |
635 | + head.actions: [ |
636 | + Action { |
637 | + objectName: "newplaylistButton" |
638 | + text: i18n.tr("New playlist") |
639 | + iconSource: "images/add.svg" |
640 | + onTriggered: { |
641 | + customdebug("New playlist.") |
642 | + PopupUtils.open(newPlaylistDialog, mainView) |
643 | } |
644 | } |
645 | - } |
646 | + ] |
647 | |
648 | Component.onCompleted: { |
649 | // check the four latest track in each playlist |
650 | @@ -65,14 +64,16 @@ |
651 | ListView { |
652 | id: addtoPlaylistView |
653 | anchors { |
654 | - bottom: newPlaylistItem.top |
655 | - left: parent.left |
656 | - right: parent.right |
657 | - top: parent.top |
658 | + bottomMargin: musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight |
659 | + fill: parent |
660 | } |
661 | clip: true |
662 | height: parent.width |
663 | - model: playlistModel.model |
664 | + model: SortFilterModel { |
665 | + model: playlistModel.model |
666 | + filter.property: "name" |
667 | + filter.pattern: new RegExp(searchValue, "i") |
668 | + } |
669 | objectName: "addtoplaylistview" |
670 | width: parent.width |
671 | delegate: ListItem.Standard { |
672 | |
673 | === modified file 'Style.qml' |
674 | --- Style.qml 2014-05-23 15:00:21 +0000 |
675 | +++ Style.qml 2014-07-14 18:02:21 +0000 |
676 | @@ -18,7 +18,7 @@ |
677 | */ |
678 | |
679 | import QtQuick 2.0 |
680 | -import Ubuntu.Components 0.1 |
681 | +import Ubuntu.Components 1.1 |
682 | |
683 | |
684 | QtObject { |
685 | |
686 | === modified file 'common/AlbumsPage.qml' |
687 | --- common/AlbumsPage.qml 2014-07-09 03:16:28 +0000 |
688 | +++ common/AlbumsPage.qml 2014-07-14 18:02:21 +0000 |
689 | @@ -18,7 +18,7 @@ |
690 | */ |
691 | |
692 | import QtQuick 2.0 |
693 | -import Ubuntu.Components 0.1 |
694 | +import Ubuntu.Components 1.1 |
695 | import Ubuntu.Components.Popups 0.1 |
696 | import Ubuntu.Components.ListItems 0.1 as ListItem |
697 | import Ubuntu.MediaScanner 0.1 |
698 | @@ -29,6 +29,7 @@ |
699 | MusicPage { |
700 | id: albumStackPage |
701 | anchors.bottomMargin: units.gu(.5) |
702 | + searchablePage: false |
703 | visible: false |
704 | |
705 | property string artist: "" |
706 | @@ -42,10 +43,14 @@ |
707 | } |
708 | delegate: albumTracksDelegate |
709 | header: artistHeaderDelegate |
710 | - model: AlbumsModel { |
711 | - id: artistsModel |
712 | - albumArtist: albumStackPage.artist |
713 | - store: musicStore |
714 | + model: SortFilterModel { |
715 | + model: AlbumsModel { |
716 | + id: artistsModel |
717 | + albumArtist: albumStackPage.artist |
718 | + store: musicStore |
719 | + } |
720 | + filter.property: "title" |
721 | + filter.pattern: new RegExp(searchValue, "i") |
722 | } |
723 | width: parent.width |
724 | |
725 | @@ -63,6 +68,7 @@ |
726 | } |
727 | height: parent.height - units.gu(2) |
728 | width: height |
729 | + |
730 | CoverRow { |
731 | id: artistImage |
732 | anchors { |
733 | @@ -70,9 +76,9 @@ |
734 | top: parent.top |
735 | } |
736 | |
737 | - count: albumtrackslist.count |
738 | + count: albumStackPage.covers.length |
739 | size: parent.height |
740 | - covers: albumStackPage.covers; |
741 | + covers: albumStackPage.covers |
742 | spacing: units.gu(4) |
743 | } |
744 | Item { // Background so can see text in current state |
745 | |
746 | === modified file 'common/BlurredBackground.qml' |
747 | --- common/BlurredBackground.qml 2014-05-23 15:00:21 +0000 |
748 | +++ common/BlurredBackground.qml 2014-07-14 18:02:21 +0000 |
749 | @@ -18,7 +18,7 @@ |
750 | */ |
751 | |
752 | import QtQuick 2.0 |
753 | -import Ubuntu.Components 0.1 |
754 | +import Ubuntu.Components 1.1 |
755 | import QtGraphicalEffects 1.0 |
756 | |
757 | // Blurred background |
758 | |
759 | === modified file 'common/CoverRow.qml' |
760 | --- common/CoverRow.qml 2014-05-23 15:00:21 +0000 |
761 | +++ common/CoverRow.qml 2014-07-14 18:02:21 +0000 |
762 | @@ -18,7 +18,7 @@ |
763 | */ |
764 | |
765 | import QtQuick 2.0 |
766 | -import Ubuntu.Components 0.1 |
767 | +import Ubuntu.Components 1.1 |
768 | |
769 | UbuntuShape { |
770 | id: coverRow |
771 | |
772 | === modified file 'common/Expander.qml' |
773 | --- common/Expander.qml 2014-05-23 15:00:21 +0000 |
774 | +++ common/Expander.qml 2014-07-14 18:02:21 +0000 |
775 | @@ -18,7 +18,7 @@ |
776 | */ |
777 | |
778 | import QtQuick 2.0 |
779 | -import Ubuntu.Components 0.1 |
780 | +import Ubuntu.Components 1.1 |
781 | import Ubuntu.Components.Popups 0.1 |
782 | |
783 | Item { |
784 | |
785 | === modified file 'common/ExpanderItems/AddToPlaylist.qml' |
786 | --- common/ExpanderItems/AddToPlaylist.qml 2014-06-19 21:16:33 +0000 |
787 | +++ common/ExpanderItems/AddToPlaylist.qml 2014-07-14 18:02:21 +0000 |
788 | @@ -17,7 +17,7 @@ |
789 | */ |
790 | |
791 | import QtQuick 2.0 |
792 | -import Ubuntu.Components 0.1 |
793 | +import Ubuntu.Components 1.1 |
794 | import Ubuntu.Components.Popups 0.1 |
795 | |
796 | // add to playlist |
797 | |
798 | === modified file 'common/ExpanderItems/AddToQueue.qml' |
799 | --- common/ExpanderItems/AddToQueue.qml 2014-05-10 19:11:33 +0000 |
800 | +++ common/ExpanderItems/AddToQueue.qml 2014-07-14 18:02:21 +0000 |
801 | @@ -17,7 +17,7 @@ |
802 | */ |
803 | |
804 | import QtQuick 2.0 |
805 | -import Ubuntu.Components 0.1 |
806 | +import Ubuntu.Components 1.1 |
807 | import Ubuntu.Components.Popups 0.1 |
808 | |
809 | Rectangle { |
810 | |
811 | === modified file 'common/ExpanderItems/DeletePlaylist.qml' |
812 | --- common/ExpanderItems/DeletePlaylist.qml 2014-04-26 17:13:02 +0000 |
813 | +++ common/ExpanderItems/DeletePlaylist.qml 2014-07-14 18:02:21 +0000 |
814 | @@ -17,7 +17,7 @@ |
815 | */ |
816 | |
817 | import QtQuick 2.0 |
818 | -import Ubuntu.Components 0.1 |
819 | +import Ubuntu.Components 1.1 |
820 | import Ubuntu.Components.Popups 0.1 |
821 | |
822 | Rectangle { |
823 | |
824 | === modified file 'common/ExpanderItems/EditPlaylist.qml' |
825 | --- common/ExpanderItems/EditPlaylist.qml 2014-04-26 17:13:02 +0000 |
826 | +++ common/ExpanderItems/EditPlaylist.qml 2014-07-14 18:02:21 +0000 |
827 | @@ -17,7 +17,7 @@ |
828 | */ |
829 | |
830 | import QtQuick 2.0 |
831 | -import Ubuntu.Components 0.1 |
832 | +import Ubuntu.Components 1.1 |
833 | import Ubuntu.Components.Popups 0.1 |
834 | |
835 | Rectangle { |
836 | |
837 | === modified file 'common/LoadingSpinnerComponent.qml' |
838 | --- common/LoadingSpinnerComponent.qml 2014-04-13 21:28:28 +0000 |
839 | +++ common/LoadingSpinnerComponent.qml 2014-07-14 18:02:21 +0000 |
840 | @@ -18,7 +18,7 @@ |
841 | * Andrew Starr-Bochicchio <a.starr.b@gmail.com> |
842 | */ |
843 | import QtQuick 2.0 |
844 | -import Ubuntu.Components 0.1 |
845 | +import Ubuntu.Components 1.1 |
846 | |
847 | Item { |
848 | id: refresh |
849 | |
850 | === modified file 'common/MusicPage.qml' |
851 | --- common/MusicPage.qml 2014-07-02 12:27:30 +0000 |
852 | +++ common/MusicPage.qml 2014-07-14 18:02:21 +0000 |
853 | @@ -17,16 +17,83 @@ |
854 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
855 | */ |
856 | |
857 | -import Ubuntu.Components 0.1 |
858 | +import QtQuick 2.0 |
859 | +import Ubuntu.Components 1.1 |
860 | |
861 | |
862 | // generic page for music, could be useful for bottomedge implementation |
863 | Page { |
864 | id: thisPage |
865 | |
866 | + property string searchValue: thisPage.state === "search" ? searchField.text : "" |
867 | + property bool searching: thisPage.state === "search" |
868 | + property bool searchablePage: true |
869 | + |
870 | + onStateChanged: { |
871 | + console.debug("PAGE:", title, "STATE CHANGED:", state) |
872 | + } |
873 | + |
874 | + Action { |
875 | + id: searchAction |
876 | + iconName: "search" |
877 | + onTriggered: { |
878 | + console.debug("SEARCHING MODE SELECTED, PAGE: ", thisPage.title) |
879 | + thisPage.state = "search" |
880 | + searchField.focus = true |
881 | + } |
882 | + } |
883 | + |
884 | + head.actions: searchablePage ? [ searchAction ] : [] |
885 | + |
886 | + state: "" |
887 | + states: [ |
888 | + State { |
889 | + name: "" |
890 | + PropertyChanges { |
891 | + target: thisPage.head |
892 | + // needed otherwise actions will not be |
893 | + // returned to its original state. |
894 | + actions: searchablePage ? [ searchAction ] : [] |
895 | + } |
896 | + }, |
897 | + PageHeadState { |
898 | + id: headerState |
899 | + name: "search" |
900 | + head: thisPage.head |
901 | + backAction: Action { |
902 | + id: leaveSearchAction |
903 | + text: "back" |
904 | + iconName: "back" |
905 | + onTriggered: { |
906 | + console.debug("BACK SELECTED WHEN SEARCHING, PAGE: ", thisPage.title) |
907 | + thisPage.state = "" |
908 | + searchField.text = "" |
909 | + } |
910 | + } |
911 | + contents: TextField { |
912 | + id: searchField |
913 | + anchors { |
914 | + right: parent ? parent.right : undefined |
915 | + rightMargin: units.gu(1) |
916 | + } |
917 | + hasClearButton: true |
918 | + inputMethodHints: Qt.ImhNoPredictiveText |
919 | + placeholderText: i18n.tr("Search...") |
920 | + onTextChanged: { |
921 | + console.debug("SEARCH TEXT CHANGED:", text, "PAGE: ", thisPage.title) |
922 | + } |
923 | + } |
924 | + } |
925 | + ] |
926 | + |
927 | onVisibleChanged: { |
928 | if (visible) { |
929 | musicToolbar.setPage(thisPage); |
930 | } |
931 | + else { |
932 | + console.debug("PAGE MADE INVISIBLE SEARCH STATE FORCED TO FALSE, PAGE: ", thisPage.title) |
933 | + thisPage.state = "" |
934 | + searchField.text = "" |
935 | + } |
936 | } |
937 | } |
938 | |
939 | === modified file 'common/SongsPage.qml' |
940 | --- common/SongsPage.qml 2014-07-11 22:29:21 +0000 |
941 | +++ common/SongsPage.qml 2014-07-14 18:02:21 +0000 |
942 | @@ -18,7 +18,7 @@ |
943 | */ |
944 | |
945 | import QtQuick 2.0 |
946 | -import Ubuntu.Components 0.1 |
947 | +import Ubuntu.Components 1.1 |
948 | import Ubuntu.Components.ListItems 0.1 as ListItem |
949 | import Ubuntu.MediaScanner 0.1 |
950 | import Ubuntu.Thumbnailer 0.1 |
951 | @@ -29,6 +29,7 @@ |
952 | MusicPage { |
953 | id: songStackPage |
954 | anchors.bottomMargin: units.gu(.5) |
955 | + searchablePage: false |
956 | visible: false |
957 | |
958 | property string line1: "" |
959 | @@ -54,7 +55,13 @@ |
960 | fill: parent |
961 | } |
962 | delegate: albumTracksDelegate |
963 | - model: isAlbum ? songsModel : albumTracksModel.model |
964 | + model: SortFilterModel { |
965 | + id: albumTrackFilterModel |
966 | + property alias rowCount: albumTrackFilterModel.count |
967 | + model: isAlbum ? songsModel : albumTracksModel.model |
968 | + filter.property: "title" |
969 | + filter.pattern: new RegExp(searchValue, "i") |
970 | + } |
971 | width: parent.width |
972 | header: ListItem.Standard { |
973 | id: albumInfo |
974 | @@ -154,6 +161,7 @@ |
975 | MouseArea { |
976 | anchors.fill: parent |
977 | onClicked: { |
978 | + // Play all will play all the shown tracks (takes filter into account) |
979 | trackClicked(albumtrackslist.model, 0) // play track |
980 | |
981 | if (isAlbum && songStackPage.line1 !== "Genre") { |
982 | @@ -201,6 +209,7 @@ |
983 | MouseArea { |
984 | anchors.fill: parent |
985 | onClicked: { |
986 | + // Play all will play all the shown tracks (takes filter into account) |
987 | addQueueFromModel(albumtrackslist.model) |
988 | } |
989 | } |
990 | @@ -226,7 +235,12 @@ |
991 | focus = true |
992 | } |
993 | |
994 | - trackClicked(albumtrackslist.model, index) // play track |
995 | + if (searching) { |
996 | + playSingleTrack(albumtrackslist.model, index) |
997 | + } |
998 | + else { |
999 | + trackClicked(albumtrackslist.model.model, index) // play track |
1000 | + } |
1001 | |
1002 | if (isAlbum && songStackPage.line1 !== "Genre") { |
1003 | Library.addRecent(songStackPage.line2, songStackPage.line1, songStackPage.covers[0], songStackPage.line2, "album") |
1004 | |
1005 | === modified file 'common/SwipeDelete.qml' |
1006 | --- common/SwipeDelete.qml 2013-11-19 04:57:30 +0000 |
1007 | +++ common/SwipeDelete.qml 2014-07-14 18:02:21 +0000 |
1008 | @@ -17,7 +17,7 @@ |
1009 | */ |
1010 | |
1011 | import QtQuick 2.0 |
1012 | -import Ubuntu.Components 0.1 |
1013 | +import Ubuntu.Components 1.1 |
1014 | |
1015 | /* SwipeDelete object */ |
1016 | Rectangle { |
1017 | |
1018 | === modified file 'music-app.qml' |
1019 | --- music-app.qml 2014-07-13 21:11:11 +0000 |
1020 | +++ music-app.qml 2014-07-14 18:02:21 +0000 |
1021 | @@ -18,7 +18,7 @@ |
1022 | */ |
1023 | |
1024 | import QtQuick 2.0 |
1025 | -import Ubuntu.Components 0.1 |
1026 | +import Ubuntu.Components 1.1 |
1027 | import Ubuntu.Components.ListItems 0.1 |
1028 | import Ubuntu.Components.Popups 0.1 |
1029 | import Ubuntu.Components.ListItems 0.1 as ListItem |
1030 | @@ -505,6 +505,19 @@ |
1031 | trackClicked(allSongsModel, index, true) |
1032 | } |
1033 | |
1034 | + function playSingleTrack(model, index) |
1035 | + { |
1036 | + // TODO: remove once playlists uses U1DB |
1037 | + if (model.hasOwnProperty("linkLibraryListModel")) { |
1038 | + model = model.linkLibraryListModel; |
1039 | + } |
1040 | + |
1041 | + trackQueue.model.clear() |
1042 | + trackQueue.append(makeDict(model.get(index, model.RoleModelData))) |
1043 | + |
1044 | + trackQueueClick(0); |
1045 | + } |
1046 | + |
1047 | // Load mediascanner store |
1048 | MediaStore { |
1049 | id: musicStore |
1050 | @@ -634,11 +647,6 @@ |
1051 | } |
1052 | } |
1053 | |
1054 | - // load sheets (after model) |
1055 | - MusicSearch { |
1056 | - id: searchSheet |
1057 | - } |
1058 | - |
1059 | // Blurred background |
1060 | BlurredBackground { |
1061 | } |
1062 | @@ -889,6 +897,8 @@ |
1063 | Component.onCompleted: musicToolbar.currentTab = selectedTab |
1064 | |
1065 | onSelectedTabChanged: { |
1066 | + console.debug("SELECTED TAB CHANGED:", selectedTab.title); |
1067 | + |
1068 | // pause loading of the models in the old tab |
1069 | if (musicToolbar.currentTab !== selectedTab && |
1070 | musicToolbar.currentTab !== null) |
FAILED: Continuous integration, rev:518 91.189. 93.70:8080/ job/music- app-ci/ 915/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 927 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 927/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/music- app-utopic- amd64-ci/ 139
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/music- app-ci/ 915/rebuild
http://