Merge lp:~ahayzen/music-app/remix-add-multi-select-mode into lp:music-app/remix
- remix-add-multi-select-mode
- Merge into remix
Status: | Merged |
---|---|
Approved by: | Victor Thompson |
Approved revision: | 681 |
Merged at revision: | 689 |
Proposed branch: | lp:~ahayzen/music-app/remix-add-multi-select-mode |
Merge into: | lp:music-app/remix |
Diff against target: |
1307 lines (+669/-182) 9 files modified
MusicNowPlaying.qml (+151/-69) MusicSearch.qml (+25/-0) MusicTracks.qml (+91/-7) MusicaddtoPlaylist.qml (+4/-5) common/ListItemActions/AddToPlaylist.qml (+1/-1) common/ListItemActions/CheckBox.qml (+25/-0) common/ListItemWithActions.qml (+261/-86) common/SongsPage.qml (+104/-10) music-app.qml (+7/-4) |
To merge this branch: | bzr merge lp:~ahayzen/music-app/remix-add-multi-select-mode |
Related bugs: | |
Related blueprints: |
Music Remix for RTM
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Victor Thompson | Approve | ||
Review via email: mp+239098@code.launchpad.net |
Commit message
* Pull upstream ListItemWithAct
* Add support for multiselect mode
* Disable triggerOnRelease
Description of the change
* Pull upstream ListItemWithAct
* Add support for multiselect mode
* Disable triggerOnRelease
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:679
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
A few initial things need fixing:
1. It seems as though the playlists are filtered again while reordering, this causes the view to flicker and the checked items get confused.
2. After reordering selected items and adding them to a playlist from the queue the items aren't quite right. Perhaps we shouldn't allow reordering when items are being selected.
Victor Thompson (vthompson) wrote : | # |
Also, we may want to talk to design about the "select all"/"select none" icon. Perhaps it could/should toggle to an empty square or a "clear" icon when all is selected?
Andrew Hayzen (ahayzen) wrote : | # |
1) Fixed due to the change in 2)
2) Disabled reordering when selectmode is enabled
Victor Thompson (vthompson) wrote : | # |
While I think preventing reorder when items are selected is the proper way of doing this... we probably should talk to Design about it.
Victor Thompson (vthompson) wrote : | # |
Could we please have 2 signals...
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:680
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
LGTM! This should help a lot and put us on the path towards improving performance elsewhere! Thanks!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:681
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
Preview Diff
1 | === modified file 'MusicNowPlaying.qml' | |||
2 | --- MusicNowPlaying.qml 2014-10-21 16:22:20 +0000 | |||
3 | +++ MusicNowPlaying.qml 2014-10-21 21:53:07 +0000 | |||
4 | @@ -25,6 +25,7 @@ | |||
5 | 25 | import "common" | 25 | import "common" |
6 | 26 | import "common/ListItemActions" | 26 | import "common/ListItemActions" |
7 | 27 | import "settings.js" as Settings | 27 | import "settings.js" as Settings |
8 | 28 | import "playlists.js" as Playlists | ||
9 | 28 | 29 | ||
10 | 29 | MusicPage { | 30 | MusicPage { |
11 | 30 | id: nowPlaying | 31 | id: nowPlaying |
12 | @@ -41,43 +42,110 @@ | |||
13 | 41 | } | 42 | } |
14 | 42 | } | 43 | } |
15 | 43 | 44 | ||
16 | 44 | head.backAction: Action { | ||
17 | 45 | iconName: "back"; | ||
18 | 46 | objectName: "backButton" | ||
19 | 47 | onTriggered: { | ||
20 | 48 | mainPageStack.pop(); | ||
21 | 49 | |||
22 | 50 | while (mainPageStack.depth > 1) { // jump back to the tab layer if via SongsPage | ||
23 | 51 | mainPageStack.pop(); | ||
24 | 52 | } | ||
25 | 53 | } | ||
26 | 54 | } | ||
27 | 55 | |||
28 | 56 | head { | ||
29 | 57 | actions: [ | ||
30 | 58 | Action { | ||
31 | 59 | objectName: "clearQueue" | ||
32 | 60 | iconName: "delete" | ||
33 | 61 | visible: isListView | ||
34 | 62 | onTriggered: { | ||
35 | 63 | head.backAction.trigger() | ||
36 | 64 | trackQueue.model.clear() | ||
37 | 65 | } | ||
38 | 66 | }, | ||
39 | 67 | Action { | ||
40 | 68 | objectName: "toggleView" | ||
41 | 69 | iconName: "media-playlist" | ||
42 | 70 | onTriggered: { | ||
43 | 71 | isListView = !isListView | ||
44 | 72 | } | ||
45 | 73 | } | ||
46 | 74 | ] | ||
47 | 75 | } | ||
48 | 76 | |||
49 | 77 | function positionAt(index) { | 45 | function positionAt(index) { |
50 | 78 | queuelist.positionViewAtIndex(index, ListView.Center); | 46 | queuelist.positionViewAtIndex(index, ListView.Center); |
51 | 79 | } | 47 | } |
52 | 80 | 48 | ||
53 | 49 | state: isListView && queuelist.state === "multiselectable" ? "selection" : "default" | ||
54 | 50 | states: [ | ||
55 | 51 | PageHeadState { | ||
56 | 52 | id: defaultState | ||
57 | 53 | |||
58 | 54 | name: "default" | ||
59 | 55 | backAction: Action { | ||
60 | 56 | iconName: "back"; | ||
61 | 57 | objectName: "backButton" | ||
62 | 58 | onTriggered: { | ||
63 | 59 | mainPageStack.pop(); | ||
64 | 60 | |||
65 | 61 | while (mainPageStack.depth > 1) { // jump back to the tab layer if via SongsPage | ||
66 | 62 | mainPageStack.pop(); | ||
67 | 63 | } | ||
68 | 64 | } | ||
69 | 65 | } | ||
70 | 66 | actions: [ | ||
71 | 67 | Action { | ||
72 | 68 | objectName: "clearQueue" | ||
73 | 69 | iconName: "delete" | ||
74 | 70 | visible: isListView | ||
75 | 71 | onTriggered: { | ||
76 | 72 | head.backAction.trigger() | ||
77 | 73 | trackQueue.model.clear() | ||
78 | 74 | } | ||
79 | 75 | }, | ||
80 | 76 | Action { | ||
81 | 77 | objectName: "toggleView" | ||
82 | 78 | iconName: "media-playlist" | ||
83 | 79 | onTriggered: { | ||
84 | 80 | isListView = !isListView | ||
85 | 81 | } | ||
86 | 82 | } | ||
87 | 83 | ] | ||
88 | 84 | PropertyChanges { | ||
89 | 85 | target: nowPlaying.head | ||
90 | 86 | backAction: defaultState.backAction | ||
91 | 87 | actions: defaultState.actions | ||
92 | 88 | } | ||
93 | 89 | }, | ||
94 | 90 | PageHeadState { | ||
95 | 91 | id: selectionState | ||
96 | 92 | |||
97 | 93 | name: "selection" | ||
98 | 94 | backAction: Action { | ||
99 | 95 | text: i18n.tr("Cancel selection") | ||
100 | 96 | iconName: "back" | ||
101 | 97 | onTriggered: queuelist.state = "normal" | ||
102 | 98 | } | ||
103 | 99 | actions: [ | ||
104 | 100 | Action { | ||
105 | 101 | text: i18n.tr("Select All") | ||
106 | 102 | iconName: "select" | ||
107 | 103 | onTriggered: { | ||
108 | 104 | if (queuelist.selectedItems.length === queuelist.model.count) { | ||
109 | 105 | queuelist.clearSelection() | ||
110 | 106 | } else { | ||
111 | 107 | queuelist.selectAll() | ||
112 | 108 | } | ||
113 | 109 | } | ||
114 | 110 | }, | ||
115 | 111 | Action { | ||
116 | 112 | enabled: queuelist.selectedItems.length > 0 | ||
117 | 113 | iconName: "add-to-playlist" | ||
118 | 114 | text: i18n.tr("Add to playlist") | ||
119 | 115 | onTriggered: { | ||
120 | 116 | var items = [] | ||
121 | 117 | |||
122 | 118 | for (var i=0; i < queuelist.selectedItems.length; i++) { | ||
123 | 119 | items.push(makeDict(trackQueue.model.get(queuelist.selectedItems[i]))); | ||
124 | 120 | } | ||
125 | 121 | |||
126 | 122 | chosenElements = items; | ||
127 | 123 | mainPageStack.push(addtoPlaylist) | ||
128 | 124 | |||
129 | 125 | queuelist.closeSelection() | ||
130 | 126 | } | ||
131 | 127 | }, | ||
132 | 128 | Action { | ||
133 | 129 | enabled: queuelist.selectedItems.length > 0 | ||
134 | 130 | iconName: "delete" | ||
135 | 131 | text: i18n.tr("Delete") | ||
136 | 132 | onTriggered: { | ||
137 | 133 | for (var i=0; i < queuelist.selectedItems.length; i++) { | ||
138 | 134 | removeQueue(queuelist.selectedItems[i]) | ||
139 | 135 | } | ||
140 | 136 | |||
141 | 137 | queuelist.closeSelection() | ||
142 | 138 | } | ||
143 | 139 | } | ||
144 | 140 | ] | ||
145 | 141 | PropertyChanges { | ||
146 | 142 | target: nowPlaying.head | ||
147 | 143 | backAction: selectionState.backAction | ||
148 | 144 | actions: selectionState.actions | ||
149 | 145 | } | ||
150 | 146 | } | ||
151 | 147 | ] | ||
152 | 148 | |||
153 | 81 | Rectangle { | 149 | Rectangle { |
154 | 82 | id: fullview | 150 | id: fullview |
155 | 83 | anchors.fill: parent | 151 | anchors.fill: parent |
156 | @@ -376,6 +444,25 @@ | |||
157 | 376 | } | 444 | } |
158 | 377 | } | 445 | } |
159 | 378 | 446 | ||
160 | 447 | function removeQueue(index) | ||
161 | 448 | { | ||
162 | 449 | var removedIndex = index | ||
163 | 450 | |||
164 | 451 | if (queuelist.count === 1) { | ||
165 | 452 | player.stop() | ||
166 | 453 | musicToolbar.goBack() | ||
167 | 454 | } else if (index === player.currentIndex) { | ||
168 | 455 | player.nextSong(player.isPlaying); | ||
169 | 456 | } | ||
170 | 457 | |||
171 | 458 | queuelist.model.remove(index); | ||
172 | 459 | |||
173 | 460 | if (removedIndex < player.currentIndex) { | ||
174 | 461 | // update index as the old has been removed | ||
175 | 462 | player.currentIndex -= 1; | ||
176 | 463 | } | ||
177 | 464 | } | ||
178 | 465 | |||
179 | 379 | ListView { | 466 | ListView { |
180 | 380 | id: queuelist | 467 | id: queuelist |
181 | 381 | anchors { | 468 | anchors { |
182 | @@ -388,23 +475,6 @@ | |||
183 | 388 | } | 475 | } |
184 | 389 | model: trackQueue.model | 476 | model: trackQueue.model |
185 | 390 | objectName: "nowPlayingQueueList" | 477 | objectName: "nowPlayingQueueList" |
186 | 391 | state: "normal" | ||
187 | 392 | states: [ | ||
188 | 393 | State { | ||
189 | 394 | name: "normal" | ||
190 | 395 | PropertyChanges { | ||
191 | 396 | target: queuelist | ||
192 | 397 | interactive: true | ||
193 | 398 | } | ||
194 | 399 | }, | ||
195 | 400 | State { | ||
196 | 401 | name: "reorder" | ||
197 | 402 | PropertyChanges { | ||
198 | 403 | target: queuelist | ||
199 | 404 | interactive: false | ||
200 | 405 | } | ||
201 | 406 | } | ||
202 | 407 | ] | ||
203 | 408 | visible: isListView | 478 | visible: isListView |
204 | 409 | 479 | ||
205 | 410 | property int normalHeight: units.gu(6) | 480 | property int normalHeight: units.gu(6) |
206 | @@ -414,6 +484,35 @@ | |||
207 | 414 | customdebug("Queue: Now has: " + queuelist.count + " tracks") | 484 | customdebug("Queue: Now has: " + queuelist.count + " tracks") |
208 | 415 | } | 485 | } |
209 | 416 | 486 | ||
210 | 487 | // Requirements for ListItemWithActions | ||
211 | 488 | property var selectedItems: [] | ||
212 | 489 | |||
213 | 490 | signal clearSelection() | ||
214 | 491 | signal closeSelection() | ||
215 | 492 | signal selectAll() | ||
216 | 493 | |||
217 | 494 | onClearSelection: selectedItems = [] | ||
218 | 495 | onCloseSelection: { | ||
219 | 496 | clearSelection() | ||
220 | 497 | state = "normal" | ||
221 | 498 | } | ||
222 | 499 | onSelectAll: { | ||
223 | 500 | var tmp = selectedItems | ||
224 | 501 | |||
225 | 502 | for (var i=0; i < model.count; i++) { | ||
226 | 503 | if (tmp.indexOf(i) === -1) { | ||
227 | 504 | tmp.push(i) | ||
228 | 505 | } | ||
229 | 506 | } | ||
230 | 507 | |||
231 | 508 | selectedItems = tmp | ||
232 | 509 | } | ||
233 | 510 | onVisibleChanged: { | ||
234 | 511 | if (!visible) { | ||
235 | 512 | clearSelection(true) | ||
236 | 513 | } | ||
237 | 514 | } | ||
238 | 515 | |||
239 | 417 | Component { | 516 | Component { |
240 | 418 | id: queueDelegate | 517 | id: queueDelegate |
241 | 419 | ListItemWithActions { | 518 | ListItemWithActions { |
242 | @@ -421,35 +520,18 @@ | |||
243 | 421 | color: player.currentIndex === index ? "#2c2c34" : "transparent" | 520 | color: player.currentIndex === index ? "#2c2c34" : "transparent" |
244 | 422 | height: queuelist.normalHeight | 521 | height: queuelist.normalHeight |
245 | 423 | objectName: "nowPlayingListItem" + index | 522 | objectName: "nowPlayingListItem" + index |
246 | 424 | showDivider: false | ||
247 | 425 | state: "" | 523 | state: "" |
248 | 426 | 524 | ||
249 | 427 | leftSideAction: Remove { | 525 | leftSideAction: Remove { |
267 | 428 | onTriggered: { | 526 | onTriggered: removeQueue(index) |
251 | 429 | var removedIndex = index | ||
252 | 430 | |||
253 | 431 | if (queuelist.count === 1) { | ||
254 | 432 | player.stop() | ||
255 | 433 | musicToolbar.goBack() | ||
256 | 434 | } else if (index === player.currentIndex) { | ||
257 | 435 | player.nextSong(player.isPlaying); | ||
258 | 436 | } | ||
259 | 437 | |||
260 | 438 | queuelist.model.remove(index); | ||
261 | 439 | |||
262 | 440 | if (removedIndex < player.currentIndex) { | ||
263 | 441 | // update index as the old has been removed | ||
264 | 442 | player.currentIndex -= 1; | ||
265 | 443 | } | ||
266 | 444 | } | ||
268 | 445 | } | 527 | } |
269 | 528 | multiselectable: true | ||
270 | 446 | reorderable: true | 529 | reorderable: true |
271 | 447 | rightSideActions: [ | 530 | rightSideActions: [ |
272 | 448 | AddToPlaylist{ | 531 | AddToPlaylist{ |
273 | 449 | 532 | ||
274 | 450 | } | 533 | } |
275 | 451 | ] | 534 | ] |
276 | 452 | triggerActionOnMouseRelease: true | ||
277 | 453 | 535 | ||
278 | 454 | onItemClicked: { | 536 | onItemClicked: { |
279 | 455 | customdebug("File: " + model.filename) // debugger | 537 | customdebug("File: " + model.filename) // debugger |
280 | 456 | 538 | ||
281 | === modified file 'MusicSearch.qml' | |||
282 | --- MusicSearch.qml 2014-09-20 15:41:33 +0000 | |||
283 | +++ MusicSearch.qml 2014-10-21 21:53:07 +0000 | |||
284 | @@ -154,6 +154,31 @@ | |||
285 | 154 | searchTrackView.forceActiveFocus() | 154 | searchTrackView.forceActiveFocus() |
286 | 155 | } | 155 | } |
287 | 156 | 156 | ||
288 | 157 | // Requirements for ListItemWithActions | ||
289 | 158 | property var selectedItems: [] | ||
290 | 159 | |||
291 | 160 | signal clearSelection(bool closeSelection) | ||
292 | 161 | signal selectAll() | ||
293 | 162 | |||
294 | 163 | onClearSelection: { | ||
295 | 164 | selectedItems = [] | ||
296 | 165 | |||
297 | 166 | if (closeSelection || closeSelection === undefined) { | ||
298 | 167 | state = "normal" | ||
299 | 168 | } | ||
300 | 169 | } | ||
301 | 170 | onSelectAll: { | ||
302 | 171 | for (var i=0; i < model.count; i++) { | ||
303 | 172 | if (selectedItems.indexOf(i) === -1) { | ||
304 | 173 | selectedItems.push(i) | ||
305 | 174 | } | ||
306 | 175 | } | ||
307 | 176 | } | ||
308 | 177 | onVisibleChanged: { | ||
309 | 178 | if (!visible) { | ||
310 | 179 | clearSelection(true) | ||
311 | 180 | } | ||
312 | 181 | } | ||
313 | 157 | delegate: ListItemWithActions { | 182 | delegate: ListItemWithActions { |
314 | 158 | id: search | 183 | id: search |
315 | 159 | color: "transparent" | 184 | color: "transparent" |
316 | 160 | 185 | ||
317 | === modified file 'MusicTracks.qml' | |||
318 | --- MusicTracks.qml 2014-10-10 05:50:32 +0000 | |||
319 | +++ MusicTracks.qml 2014-10-21 21:53:07 +0000 | |||
320 | @@ -34,6 +34,66 @@ | |||
321 | 34 | objectName: "tracksPage" | 34 | objectName: "tracksPage" |
322 | 35 | title: i18n.tr("Songs") | 35 | title: i18n.tr("Songs") |
323 | 36 | 36 | ||
324 | 37 | state: tracklist.state === "multiselectable" ? "selection" : "default" | ||
325 | 38 | states: [ | ||
326 | 39 | PageHeadState { | ||
327 | 40 | id: selectionState | ||
328 | 41 | name: "selection" | ||
329 | 42 | backAction: Action { | ||
330 | 43 | text: i18n.tr("Cancel selection") | ||
331 | 44 | iconName: "back" | ||
332 | 45 | onTriggered: tracklist.state = "normal" | ||
333 | 46 | } | ||
334 | 47 | actions: [ | ||
335 | 48 | Action { | ||
336 | 49 | iconName: "select" | ||
337 | 50 | text: i18n.tr("Select All") | ||
338 | 51 | onTriggered: { | ||
339 | 52 | if (tracklist.selectedItems.length === tracklist.model.count) { | ||
340 | 53 | tracklist.clearSelection() | ||
341 | 54 | } else { | ||
342 | 55 | tracklist.selectAll() | ||
343 | 56 | } | ||
344 | 57 | } | ||
345 | 58 | }, | ||
346 | 59 | Action { | ||
347 | 60 | enabled: tracklist.selectedItems.length !== 0 | ||
348 | 61 | iconName: "add-to-playlist" | ||
349 | 62 | text: i18n.tr("Add to playlist") | ||
350 | 63 | onTriggered: { | ||
351 | 64 | var items = [] | ||
352 | 65 | |||
353 | 66 | for (var i=0; i < tracklist.selectedItems.length; i++) { | ||
354 | 67 | items.push(makeDict(tracklist.model.get(tracklist.selectedItems[i], tracklist.model.RoleModelData))); | ||
355 | 68 | } | ||
356 | 69 | |||
357 | 70 | chosenElements = items; | ||
358 | 71 | mainPageStack.push(addtoPlaylist) | ||
359 | 72 | |||
360 | 73 | tracklist.closeSelection() | ||
361 | 74 | } | ||
362 | 75 | }, | ||
363 | 76 | Action { | ||
364 | 77 | enabled: tracklist.selectedItems.length > 0 | ||
365 | 78 | iconName: "add" | ||
366 | 79 | text: i18n.tr("Add to queue") | ||
367 | 80 | onTriggered: { | ||
368 | 81 | for (var i=0; i < tracklist.selectedItems.length; i++) { | ||
369 | 82 | trackQueue.model.append(makeDict(tracklist.model.get(tracklist.selectedItems[i], tracklist.model.RoleModelData))); | ||
370 | 83 | } | ||
371 | 84 | |||
372 | 85 | tracklist.closeSelection() | ||
373 | 86 | } | ||
374 | 87 | } | ||
375 | 88 | ] | ||
376 | 89 | PropertyChanges { | ||
377 | 90 | target: mainpage.head | ||
378 | 91 | backAction: selectionState.backAction | ||
379 | 92 | actions: selectionState.actions | ||
380 | 93 | } | ||
381 | 94 | } | ||
382 | 95 | ] | ||
383 | 96 | |||
384 | 37 | ListView { | 97 | ListView { |
385 | 38 | id: tracklist | 98 | id: tracklist |
386 | 39 | anchors { | 99 | anchors { |
387 | @@ -52,18 +112,46 @@ | |||
388 | 52 | sort.property: "title" | 112 | sort.property: "title" |
389 | 53 | sort.order: Qt.AscendingOrder | 113 | sort.order: Qt.AscendingOrder |
390 | 54 | } | 114 | } |
391 | 115 | |||
392 | 116 | // Requirements for ListItemWithActions | ||
393 | 117 | property var selectedItems: [] | ||
394 | 118 | |||
395 | 119 | signal clearSelection() | ||
396 | 120 | signal closeSelection() | ||
397 | 121 | signal selectAll() | ||
398 | 122 | |||
399 | 123 | onClearSelection: selectedItems = [] | ||
400 | 124 | onCloseSelection: { | ||
401 | 125 | clearSelection() | ||
402 | 126 | state = "normal" | ||
403 | 127 | } | ||
404 | 128 | onSelectAll: { | ||
405 | 129 | var tmp = selectedItems | ||
406 | 130 | |||
407 | 131 | for (var i=0; i < model.count; i++) { | ||
408 | 132 | if (tmp.indexOf(i) === -1) { | ||
409 | 133 | tmp.push(i) | ||
410 | 134 | } | ||
411 | 135 | } | ||
412 | 136 | |||
413 | 137 | selectedItems = tmp | ||
414 | 138 | } | ||
415 | 139 | onVisibleChanged: { | ||
416 | 140 | if (!visible) { | ||
417 | 141 | clearSelection(true) | ||
418 | 142 | } | ||
419 | 143 | } | ||
420 | 144 | |||
421 | 55 | delegate: trackDelegate | 145 | delegate: trackDelegate |
422 | 56 | Component { | 146 | Component { |
423 | 57 | id: trackDelegate | 147 | id: trackDelegate |
424 | 58 | 148 | ||
425 | 59 | ListItemWithActions { | 149 | ListItemWithActions { |
426 | 60 | id: track | 150 | id: track |
427 | 61 | color: "transparent" | ||
428 | 62 | objectName: "tracksPageListItem" + index | 151 | objectName: "tracksPageListItem" + index |
429 | 63 | width: parent.width | ||
430 | 64 | height: units.gu(7) | 152 | height: units.gu(7) |
431 | 65 | showDivider: false | ||
432 | 66 | 153 | ||
433 | 154 | multiselectable: true | ||
434 | 67 | rightSideActions: [ | 155 | rightSideActions: [ |
435 | 68 | AddToQueue { | 156 | AddToQueue { |
436 | 69 | }, | 157 | }, |
437 | @@ -71,10 +159,6 @@ | |||
438 | 71 | 159 | ||
439 | 72 | } | 160 | } |
440 | 73 | ] | 161 | ] |
441 | 74 | triggerActionOnMouseRelease: true | ||
442 | 75 | |||
443 | 76 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
444 | 77 | onPressedChanged: musicRow.pressed = pressed | ||
445 | 78 | 162 | ||
446 | 79 | onItemClicked: trackClicked(tracklist.model, index) // play track | 163 | onItemClicked: trackClicked(tracklist.model, index) // play track |
447 | 80 | 164 | ||
448 | 81 | 165 | ||
449 | === modified file 'MusicaddtoPlaylist.qml' | |||
450 | --- MusicaddtoPlaylist.qml 2014-09-30 15:18:25 +0000 | |||
451 | +++ MusicaddtoPlaylist.qml 2014-10-21 21:53:07 +0000 | |||
452 | @@ -81,18 +81,17 @@ | |||
453 | 81 | property string count: model.count | 81 | property string count: model.count |
454 | 82 | 82 | ||
455 | 83 | onClicked: { | 83 | onClicked: { |
457 | 84 | console.debug("Debug: "+chosenElement.filename+" added to "+name) | 84 | for (var i=0; i < chosenElements.length; i++) { |
458 | 85 | console.debug("Debug: "+chosenElements[i].filename+" added to "+name) | ||
459 | 85 | 86 | ||
461 | 86 | Playlists.addToPlaylist(name, chosenElement) | 87 | Playlists.addToPlaylist(name, chosenElements[i]) |
462 | 88 | } | ||
463 | 87 | 89 | ||
464 | 88 | playlistModel.filterPlaylists(); | 90 | playlistModel.filterPlaylists(); |
465 | 89 | 91 | ||
466 | 90 | musicToolbar.goBack(); // go back to the previous page | 92 | musicToolbar.goBack(); // go back to the previous page |
467 | 91 | } | 93 | } |
468 | 92 | 94 | ||
469 | 93 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
470 | 94 | onPressedChanged: musicRow.pressed = pressed | ||
471 | 95 | |||
472 | 96 | MusicRow { | 95 | MusicRow { |
473 | 97 | id: musicRow | 96 | id: musicRow |
474 | 98 | covers: Playlists.getPlaylistCovers(playlist.name) | 97 | covers: Playlists.getPlaylistCovers(playlist.name) |
475 | 99 | 98 | ||
476 | === modified file 'common/ListItemActions/AddToPlaylist.qml' | |||
477 | --- common/ListItemActions/AddToPlaylist.qml 2014-09-20 10:50:45 +0000 | |||
478 | +++ common/ListItemActions/AddToPlaylist.qml 2014-10-21 21:53:07 +0000 | |||
479 | @@ -27,7 +27,7 @@ | |||
480 | 27 | property bool primed: false | 27 | property bool primed: false |
481 | 28 | 28 | ||
482 | 29 | onTriggered: { | 29 | onTriggered: { |
484 | 30 | chosenElement = makeDict(model); | 30 | chosenElements = [makeDict(model)]; |
485 | 31 | console.debug("Debug: Add track to playlist"); | 31 | console.debug("Debug: Add track to playlist"); |
486 | 32 | mainPageStack.push(addtoPlaylist) | 32 | mainPageStack.push(addtoPlaylist) |
487 | 33 | } | 33 | } |
488 | 34 | 34 | ||
489 | === added file 'common/ListItemActions/CheckBox.qml' | |||
490 | --- common/ListItemActions/CheckBox.qml 1970-01-01 00:00:00 +0000 | |||
491 | +++ common/ListItemActions/CheckBox.qml 2014-10-21 21:53:07 +0000 | |||
492 | @@ -0,0 +1,25 @@ | |||
493 | 1 | /* | ||
494 | 2 | * Copyright (C) 2012-2014 Canonical, Ltd. | ||
495 | 3 | * | ||
496 | 4 | * This program is free software; you can redistribute it and/or modify | ||
497 | 5 | * it under the terms of the GNU General Public License as published by | ||
498 | 6 | * the Free Software Foundation; version 3. | ||
499 | 7 | * | ||
500 | 8 | * This program is distributed in the hope that it will be useful, | ||
501 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
502 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
503 | 11 | * GNU General Public License for more details. | ||
504 | 12 | * | ||
505 | 13 | * You should have received a copy of the GNU General Public License | ||
506 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
507 | 15 | */ | ||
508 | 16 | |||
509 | 17 | import QtQuick 2.2 | ||
510 | 18 | import Ubuntu.Components 1.1 | ||
511 | 19 | |||
512 | 20 | CheckBox { | ||
513 | 21 | checked: root.selected | ||
514 | 22 | width: implicitWidth | ||
515 | 23 | // disable item mouse area to avoid conflicts with parent mouse area | ||
516 | 24 | __mouseArea.enabled: false | ||
517 | 25 | } | ||
518 | 0 | 26 | ||
519 | === modified file 'common/ListItemWithActions.qml' | |||
520 | --- common/ListItemWithActions.qml 2014-09-20 10:50:45 +0000 | |||
521 | +++ common/ListItemWithActions.qml 2014-10-21 21:53:07 +0000 | |||
522 | @@ -19,116 +19,170 @@ | |||
523 | 19 | import Ubuntu.Components.ListItems 1.0 as ListItem | 19 | import Ubuntu.Components.ListItems 1.0 as ListItem |
524 | 20 | 20 | ||
525 | 21 | 21 | ||
528 | 22 | ListItem.Standard { // CUSTOM | 22 | Item { |
527 | 23 | //Item { | ||
529 | 24 | id: root | 23 | id: root |
530 | 24 | width: parent.width | ||
531 | 25 | 25 | ||
532 | 26 | property Action leftSideAction: null | 26 | property Action leftSideAction: null |
533 | 27 | property list<Action> rightSideActions | 27 | property list<Action> rightSideActions |
534 | 28 | property double defaultHeight: units.gu(8) | 28 | property double defaultHeight: units.gu(8) |
535 | 29 | property bool locked: false | 29 | property bool locked: false |
536 | 30 | property bool pressed: false | ||
537 | 31 | property Action activeAction: null | 30 | property Action activeAction: null |
538 | 32 | property var activeItem: null | 31 | property var activeItem: null |
539 | 33 | property bool triggerActionOnMouseRelease: false | 32 | property bool triggerActionOnMouseRelease: false |
547 | 34 | property alias color: main.color | 33 | property color color: Theme.palette.normal.background |
548 | 35 | default property alias contents: main.children | 34 | property color selectedColor: "#3d3d45" // "#E6E6E6" // CUSTOM |
549 | 36 | 35 | property bool selected: false | |
550 | 37 | property bool reorderable: false // CUSTOM | 36 | property bool selectionMode: false |
551 | 38 | property bool reordering: false // CUSTOM | 37 | property alias internalAnchors: mainContents.anchors |
552 | 39 | 38 | default property alias contents: mainContents.children | |
553 | 40 | readonly property double actionWidth: units.gu(5) | 39 | |
554 | 40 | readonly property double actionWidth: units.gu(4) // CUSTOM 5? | ||
555 | 41 | readonly property double leftActionWidth: units.gu(10) | 41 | readonly property double leftActionWidth: units.gu(10) |
556 | 42 | readonly property double actionThreshold: actionWidth * 0.4 | 42 | readonly property double actionThreshold: actionWidth * 0.4 |
557 | 43 | readonly property double threshold: 0.4 | 43 | readonly property double threshold: 0.4 |
558 | 44 | readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft" | 44 | readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft" |
559 | 45 | readonly property alias swipping: mainItemMoving.running | 45 | readonly property alias swipping: mainItemMoving.running |
560 | 46 | readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping | ||
561 | 47 | |||
562 | 48 | property bool reorderable: false // CUSTOM | ||
563 | 49 | property bool reordering: false // CUSTOM | ||
564 | 50 | property bool multiselectable: false // CUSTOM | ||
565 | 51 | |||
566 | 52 | property int previousListItemIndex: -1 // CUSTOM | ||
567 | 53 | property int listItemIndex: index // CUSTOM | ||
568 | 54 | |||
569 | 55 | /* internal */ | ||
570 | 56 | property var _visibleRightSideActions: filterVisibleActions(rightSideActions) | ||
571 | 46 | 57 | ||
572 | 47 | signal itemClicked(var mouse) | 58 | signal itemClicked(var mouse) |
573 | 48 | signal itemPressAndHold(var mouse) | 59 | signal itemPressAndHold(var mouse) |
574 | 49 | 60 | ||
575 | 50 | signal reorder(int from, int to) // CUSTOM | 61 | signal reorder(int from, int to) // CUSTOM |
576 | 51 | 62 | ||
580 | 52 | onItemPressAndHold: reordering = reorderable && !reordering // CUSTOM | 63 | onItemPressAndHold: { |
581 | 53 | onReorderingChanged: { // CUSTOM | 64 | //reordering = reorderable && !reordering // CUSTOM |
582 | 54 | if (reordering) { | 65 | if (multiselectable) { |
583 | 66 | selectionMode = true | ||
584 | 67 | } | ||
585 | 68 | } | ||
586 | 69 | onListItemIndexChanged: { | ||
587 | 70 | var i = parent.parent.selectedItems.lastIndexOf(previousListItemIndex) | ||
588 | 71 | |||
589 | 72 | if (i !== -1) { | ||
590 | 73 | parent.parent.selectedItems[i] = listItemIndex | ||
591 | 74 | } | ||
592 | 75 | |||
593 | 76 | previousListItemIndex = listItemIndex | ||
594 | 77 | } | ||
595 | 78 | |||
596 | 79 | onSelectedChanged: { | ||
597 | 80 | if (selectionMode) { | ||
598 | 81 | var tmp = parent.parent.selectedItems | ||
599 | 82 | |||
600 | 83 | if (selected) { | ||
601 | 84 | if (parent.parent.selectedItems.indexOf(listItemIndex) === -1) { | ||
602 | 85 | tmp.push(listItemIndex) | ||
603 | 86 | parent.parent.selectedItems = tmp | ||
604 | 87 | } | ||
605 | 88 | } else { | ||
606 | 89 | tmp.splice(parent.parent.selectedItems.indexOf(listItemIndex), 1) | ||
607 | 90 | parent.parent.selectedItems = tmp | ||
608 | 91 | } | ||
609 | 92 | } | ||
610 | 93 | } | ||
611 | 94 | |||
612 | 95 | onSelectionModeChanged: { // CUSTOM | ||
613 | 96 | if (reorderable && selectionMode) { | ||
614 | 55 | resetSwipe() | 97 | resetSwipe() |
615 | 56 | } | 98 | } |
616 | 57 | 99 | ||
617 | 58 | for (var j=0; j < main.children.length; j++) { | 100 | for (var j=0; j < main.children.length; j++) { |
622 | 59 | main.children[j].anchors.rightMargin = reordering ? actionReorder.width + units.gu(2) : 0 | 101 | main.children[j].anchors.rightMargin = reorderable && selectionMode ? actionReorder.width + units.gu(2) : 0 |
623 | 60 | } | 102 | } |
624 | 61 | 103 | ||
625 | 62 | parent.state = reordering ? "reorder" : "normal" | 104 | parent.parent.state = selectionMode ? "multiselectable" : "normal" |
626 | 105 | |||
627 | 106 | if (!selectionMode) { | ||
628 | 107 | selected = false | ||
629 | 108 | } | ||
630 | 63 | } | 109 | } |
631 | 64 | 110 | ||
633 | 65 | function returnToBoundsRTL() | 111 | function returnToBoundsRTL(direction) |
634 | 66 | { | 112 | { |
635 | 67 | var actionFullWidth = actionWidth + units.gu(2) | 113 | var actionFullWidth = actionWidth + units.gu(2) |
636 | 114 | |||
637 | 115 | // go back to normal state if swipping reverse | ||
638 | 116 | if (direction === "LTR") { | ||
639 | 117 | updatePosition(0) | ||
640 | 118 | return | ||
641 | 119 | } else if (!triggerActionOnMouseRelease) { | ||
642 | 120 | updatePosition(-rightActionsView.width + units.gu(2)) | ||
643 | 121 | return | ||
644 | 122 | } | ||
645 | 123 | |||
646 | 68 | var xOffset = Math.abs(main.x) | 124 | var xOffset = Math.abs(main.x) |
656 | 69 | var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length) | 125 | var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length) |
657 | 70 | var j; // CUSTOM | 126 | var newX = 0 |
658 | 71 | 127 | var j // CUSTOM | |
659 | 72 | if (index < 1) { | 128 | |
660 | 73 | main.x = 0 | 129 | if (index === _visibleRightSideActions.length) { |
661 | 74 | 130 | newX = -(rightActionsView.width - units.gu(2)) | |
653 | 75 | resetPrimed() // CUSTOM | ||
654 | 76 | } else if (index === rightSideActions.length) { | ||
655 | 77 | main.x = -rightActionsView.width | ||
662 | 78 | 131 | ||
663 | 79 | for (j=0; j < rightSideActions.length; j++) { // CUSTOM | 132 | for (j=0; j < rightSideActions.length; j++) { // CUSTOM |
664 | 80 | rightActionsRepeater.itemAt(j).primed = true | 133 | rightActionsRepeater.itemAt(j).primed = true |
665 | 81 | } | 134 | } |
668 | 82 | } else { | 135 | } else if (index >= 1) { |
669 | 83 | main.x = -(actionFullWidth * index) | 136 | newX = -(actionFullWidth * index) |
670 | 84 | 137 | ||
671 | 85 | for (j=0; j < rightSideActions.length; j++) { // CUSTOM | 138 | for (j=0; j < rightSideActions.length; j++) { // CUSTOM |
672 | 86 | rightActionsRepeater.itemAt(j).primed = j === index | 139 | rightActionsRepeater.itemAt(j).primed = j === index |
673 | 87 | } | 140 | } |
674 | 88 | } | 141 | } |
675 | 142 | |||
676 | 143 | updatePosition(newX) | ||
677 | 89 | } | 144 | } |
678 | 90 | 145 | ||
680 | 91 | function returnToBoundsLTR() | 146 | function returnToBoundsLTR(direction) |
681 | 92 | { | 147 | { |
682 | 93 | var finalX = leftActionWidth | 148 | var finalX = leftActionWidth |
690 | 94 | if (main.x > (finalX * root.threshold)) | 149 | if ((direction === "RTL") || (main.x <= (finalX * root.threshold))) |
691 | 95 | main.x = finalX | 150 | finalX = 0 |
692 | 96 | else { | 151 | updatePosition(finalX) |
686 | 97 | main.x = 0 | ||
687 | 98 | |||
688 | 99 | resetPrimed() // CUSTOM | ||
689 | 100 | } | ||
693 | 101 | 152 | ||
694 | 102 | if (leftSideAction !== null) { // CUSTOM | 153 | if (leftSideAction !== null) { // CUSTOM |
695 | 103 | leftActionIcon.primed = main.x > (finalX * root.threshold) | 154 | leftActionIcon.primed = main.x > (finalX * root.threshold) |
696 | 104 | } | 155 | } |
697 | 105 | } | 156 | } |
698 | 106 | 157 | ||
700 | 107 | function returnToBounds() | 158 | function returnToBounds(direction) |
701 | 108 | { | 159 | { |
702 | 109 | if (main.x < 0) { | 160 | if (main.x < 0) { |
704 | 110 | returnToBoundsRTL() | 161 | returnToBoundsRTL(direction) |
705 | 111 | } else if (main.x > 0) { | 162 | } else if (main.x > 0) { |
709 | 112 | returnToBoundsLTR() | 163 | returnToBoundsLTR(direction) |
710 | 113 | } else { // CUSTOM | 164 | } else { |
711 | 114 | resetPrimed() // CUSTOM | 165 | updatePosition(0) |
712 | 115 | } | 166 | } |
713 | 116 | } | 167 | } |
714 | 117 | 168 | ||
716 | 118 | function contains(item, point) | 169 | function contains(item, point, marginX) |
717 | 119 | { | 170 | { |
719 | 120 | return (point.x >= item.x) && (point.x <= (item.x + item.width)) && (point.y >= item.y) && (point.y <= (item.y + item.height)); | 171 | var itemStartX = item.x - marginX |
720 | 172 | var itemEndX = item.x + item.width + marginX | ||
721 | 173 | return (point.x >= itemStartX) && (point.x <= itemEndX) && | ||
722 | 174 | (point.y >= item.y) && (point.y <= (item.y + item.height)); | ||
723 | 121 | } | 175 | } |
724 | 122 | 176 | ||
725 | 123 | function getActionAt(point) | 177 | function getActionAt(point) |
726 | 124 | { | 178 | { |
728 | 125 | if (contains(leftActionView, point)) { | 179 | if (contains(leftActionView, point, 0)) { |
729 | 126 | return leftSideAction | 180 | return leftSideAction |
731 | 127 | } else if (contains(rightActionsView, point)) { | 181 | } else if (contains(rightActionsView, point, 0)) { |
732 | 128 | var newPoint = root.mapToItem(rightActionsView, point.x, point.y) | 182 | var newPoint = root.mapToItem(rightActionsView, point.x, point.y) |
733 | 129 | for (var i = 0; i < rightActionsRepeater.count; i++) { | 183 | for (var i = 0; i < rightActionsRepeater.count; i++) { |
734 | 130 | var child = rightActionsRepeater.itemAt(i) | 184 | var child = rightActionsRepeater.itemAt(i) |
736 | 131 | if (contains(child, newPoint)) { | 185 | if (contains(child, newPoint, units.gu(1))) { |
737 | 132 | return i | 186 | return i |
738 | 133 | } | 187 | } |
739 | 134 | } | 188 | } |
740 | @@ -138,15 +192,16 @@ | |||
741 | 138 | 192 | ||
742 | 139 | function updateActiveAction() | 193 | function updateActiveAction() |
743 | 140 | { | 194 | { |
746 | 141 | if ((main.x <= -root.actionWidth) && | 195 | if (triggerActionOnMouseRelease && |
747 | 142 | (main.x > -rightActionsView.width)) { | 196 | (main.x <= -(root.actionWidth + units.gu(2))) && |
748 | 197 | (main.x > -(rightActionsView.width - units.gu(2)))) { | ||
749 | 143 | var actionFullWidth = actionWidth + units.gu(2) | 198 | var actionFullWidth = actionWidth + units.gu(2) |
750 | 144 | var xOffset = Math.abs(main.x) | 199 | var xOffset = Math.abs(main.x) |
752 | 145 | var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length) | 200 | var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length) |
753 | 146 | index = index - 1 | 201 | index = index - 1 |
754 | 147 | if (index > -1) { | 202 | if (index > -1) { |
755 | 148 | root.activeItem = rightActionsRepeater.itemAt(index) | 203 | root.activeItem = rightActionsRepeater.itemAt(index) |
757 | 149 | root.activeAction = root.rightSideActions[index] | 204 | root.activeAction = root._visibleRightSideActions[index] |
758 | 150 | } | 205 | } |
759 | 151 | } else { | 206 | } else { |
760 | 152 | root.activeAction = null | 207 | root.activeAction = null |
761 | @@ -160,15 +215,40 @@ | |||
762 | 160 | } | 215 | } |
763 | 161 | 216 | ||
764 | 162 | for (var j=0; j < rightSideActions.length; j++) { | 217 | for (var j=0; j < rightSideActions.length; j++) { |
765 | 218 | console.debug(rightActionsRepeater.itemAt(j)); | ||
766 | 163 | rightActionsRepeater.itemAt(j).primed = false | 219 | rightActionsRepeater.itemAt(j).primed = false |
767 | 164 | } | 220 | } |
768 | 165 | } | 221 | } |
769 | 166 | 222 | ||
770 | 167 | function resetSwipe() | 223 | function resetSwipe() |
771 | 168 | { | 224 | { |
775 | 169 | main.x = 0 | 225 | updatePosition(0) |
776 | 170 | 226 | } | |
777 | 171 | resetPrimed() // CUSTOM | 227 | |
778 | 228 | function filterVisibleActions(actions) | ||
779 | 229 | { | ||
780 | 230 | var visibleActions = [] | ||
781 | 231 | for(var i = 0; i < actions.length; i++) { | ||
782 | 232 | var action = actions[i] | ||
783 | 233 | if (action.visible) { | ||
784 | 234 | visibleActions.push(action) | ||
785 | 235 | } | ||
786 | 236 | } | ||
787 | 237 | return visibleActions | ||
788 | 238 | } | ||
789 | 239 | |||
790 | 240 | function updatePosition(pos) | ||
791 | 241 | { | ||
792 | 242 | if (!root.triggerActionOnMouseRelease && (pos !== 0)) { | ||
793 | 243 | mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight" | ||
794 | 244 | } else { | ||
795 | 245 | mouseArea.state = "" | ||
796 | 246 | } | ||
797 | 247 | main.x = pos | ||
798 | 248 | |||
799 | 249 | if (pos === 0) { // CUSTOM | ||
800 | 250 | //resetPrimed() | ||
801 | 251 | } | ||
802 | 172 | } | 252 | } |
803 | 173 | 253 | ||
804 | 174 | Connections { // CUSTOM | 254 | Connections { // CUSTOM |
805 | @@ -181,8 +261,10 @@ | |||
806 | 181 | } | 261 | } |
807 | 182 | 262 | ||
808 | 183 | Connections { // CUSTOM | 263 | Connections { // CUSTOM |
811 | 184 | target: root.parent | 264 | target: root.parent.parent |
812 | 185 | onStateChanged: reordering = root.parent.state === "reorder" | 265 | onClearSelection: selected = false |
813 | 266 | onSelectAll: selected = true | ||
814 | 267 | onStateChanged: selectionMode = root.parent.parent.state === "multiselectable" | ||
815 | 186 | onVisibleChanged: { | 268 | onVisibleChanged: { |
816 | 187 | if (!visible) { | 269 | if (!visible) { |
817 | 188 | reordering = false | 270 | reordering = false |
818 | @@ -190,7 +272,13 @@ | |||
819 | 190 | } | 272 | } |
820 | 191 | } | 273 | } |
821 | 192 | 274 | ||
823 | 193 | Component.onCompleted: reordering = root.parent.state === "reorder" // CUSTOM | 275 | Component.onCompleted: { // CUSTOM |
824 | 276 | if (parent.parent.selectedItems.indexOf(index) !== -1) { // FIXME: | ||
825 | 277 | selected = true | ||
826 | 278 | } | ||
827 | 279 | |||
828 | 280 | selectionMode = root.parent.parent.state === "multiselectable" | ||
829 | 281 | } | ||
830 | 194 | 282 | ||
831 | 195 | /* CUSTOM Dim Component */ | 283 | /* CUSTOM Dim Component */ |
832 | 196 | Rectangle { | 284 | Rectangle { |
833 | @@ -228,6 +316,26 @@ | |||
834 | 228 | } | 316 | } |
835 | 229 | } | 317 | } |
836 | 230 | 318 | ||
837 | 319 | states: [ | ||
838 | 320 | State { | ||
839 | 321 | name: "select" | ||
840 | 322 | when: selectionMode || selected | ||
841 | 323 | PropertyChanges { | ||
842 | 324 | target: selectionIcon | ||
843 | 325 | source: Qt.resolvedUrl("ListItemActions/CheckBox.qml") | ||
844 | 326 | anchors.leftMargin: units.gu(2) | ||
845 | 327 | } | ||
846 | 328 | PropertyChanges { | ||
847 | 329 | target: root | ||
848 | 330 | locked: true | ||
849 | 331 | } | ||
850 | 332 | PropertyChanges { | ||
851 | 333 | target: main | ||
852 | 334 | x: 0 | ||
853 | 335 | } | ||
854 | 336 | } | ||
855 | 337 | ] | ||
856 | 338 | |||
857 | 231 | height: defaultHeight | 339 | height: defaultHeight |
858 | 232 | clip: height !== defaultHeight | 340 | clip: height !== defaultHeight |
859 | 233 | 341 | ||
860 | @@ -241,16 +349,15 @@ | |||
861 | 241 | } | 349 | } |
862 | 242 | width: root.leftActionWidth + actionThreshold | 350 | width: root.leftActionWidth + actionThreshold |
863 | 243 | visible: leftSideAction | 351 | visible: leftSideAction |
865 | 244 | color: "red" | 352 | color: UbuntuColors.red |
866 | 245 | 353 | ||
867 | 246 | Icon { | 354 | Icon { |
868 | 247 | id: leftActionIcon | ||
869 | 248 | anchors { | 355 | anchors { |
870 | 249 | centerIn: parent | 356 | centerIn: parent |
871 | 250 | horizontalCenterOffset: actionThreshold / 2 | 357 | horizontalCenterOffset: actionThreshold / 2 |
872 | 251 | } | 358 | } |
873 | 252 | objectName: "swipeDeleteAction" // CUSTOM | 359 | objectName: "swipeDeleteAction" // CUSTOM |
875 | 253 | name: leftSideAction ? leftSideAction.iconName : "" | 360 | name: leftSideAction && _showActions ? leftSideAction.iconName : "" |
876 | 254 | color: Theme.palette.selected.field | 361 | color: Theme.palette.selected.field |
877 | 255 | height: units.gu(3) | 362 | height: units.gu(3) |
878 | 256 | width: units.gu(3) | 363 | width: units.gu(3) |
879 | @@ -259,7 +366,8 @@ | |||
880 | 259 | } | 366 | } |
881 | 260 | } | 367 | } |
882 | 261 | 368 | ||
884 | 262 | Item { | 369 | //Rectangle { |
885 | 370 | Item { // CUSTOM | ||
886 | 263 | id: rightActionsView | 371 | id: rightActionsView |
887 | 264 | 372 | ||
888 | 265 | anchors { | 373 | anchors { |
889 | @@ -268,8 +376,9 @@ | |||
890 | 268 | leftMargin: reordering ? actionReorder.width : units.gu(1) // CUSTOM | 376 | leftMargin: reordering ? actionReorder.width : units.gu(1) // CUSTOM |
891 | 269 | bottom: main.bottom | 377 | bottom: main.bottom |
892 | 270 | } | 378 | } |
895 | 271 | visible: rightSideActions.length > 0 | 379 | visible: _visibleRightSideActions.length > 0 |
896 | 272 | width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + actionThreshold : 0 | 380 | width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0 |
897 | 381 | // color: "white" // CUSTOM | ||
898 | 273 | 382 | ||
899 | 274 | Rectangle { // CUSTOM | 383 | Rectangle { // CUSTOM |
900 | 275 | anchors { | 384 | anchors { |
901 | @@ -283,22 +392,23 @@ | |||
902 | 283 | } | 392 | } |
903 | 284 | 393 | ||
904 | 285 | Row { | 394 | Row { |
908 | 286 | anchors { | 395 | anchors{ |
909 | 287 | fill: parent | 396 | top: parent.top |
910 | 288 | leftMargin: units.gu(2) // CUSTOM | 397 | left: parent.left |
911 | 398 | leftMargin: units.gu(2) | ||
912 | 399 | right: parent.right | ||
913 | 400 | rightMargin: units.gu(2) | ||
914 | 401 | bottom: parent.bottom | ||
915 | 289 | } | 402 | } |
916 | 290 | spacing: units.gu(2) | 403 | spacing: units.gu(2) |
917 | 291 | Repeater { | 404 | Repeater { |
918 | 292 | id: rightActionsRepeater | 405 | id: rightActionsRepeater |
919 | 293 | 406 | ||
921 | 294 | model: rightSideActions | 407 | model: _showActions ? _visibleRightSideActions : [] |
922 | 295 | Item { | 408 | Item { |
923 | 296 | property alias image: img | 409 | property alias image: img |
924 | 297 | 410 | ||
929 | 298 | anchors { | 411 | height: rightActionsView.height |
926 | 299 | top: parent.top | ||
927 | 300 | bottom: parent.bottom | ||
928 | 301 | } | ||
930 | 302 | width: root.actionWidth | 412 | width: root.actionWidth |
931 | 303 | 413 | ||
932 | 304 | property alias primed: img.primed // CUSTOM | 414 | property alias primed: img.primed // CUSTOM |
933 | @@ -310,8 +420,8 @@ | |||
934 | 310 | objectName: rightSideActions[index].objectName // CUSTOM | 420 | objectName: rightSideActions[index].objectName // CUSTOM |
935 | 311 | width: units.gu(3) | 421 | width: units.gu(3) |
936 | 312 | height: units.gu(3) | 422 | height: units.gu(3) |
939 | 313 | name: iconName | 423 | name: modelData.iconName |
940 | 314 | color: root.activeAction === modelData || !root.triggerActionOnMouseRelease ? UbuntuColors.orange : styleMusic.common.white // CUSTOM | 424 | color: root.activeAction === modelData ? UbuntuColors.orange : styleMusic.common.white // CUSTOM |
941 | 315 | 425 | ||
942 | 316 | property bool primed: false // CUSTOM | 426 | property bool primed: false // CUSTOM |
943 | 317 | } | 427 | } |
944 | @@ -330,6 +440,38 @@ | |||
945 | 330 | } | 440 | } |
946 | 331 | 441 | ||
947 | 332 | width: parent.width | 442 | width: parent.width |
948 | 443 | color: root.selected ? root.selectedColor : root.color | ||
949 | 444 | |||
950 | 445 | Loader { | ||
951 | 446 | id: selectionIcon | ||
952 | 447 | |||
953 | 448 | anchors { | ||
954 | 449 | left: main.left | ||
955 | 450 | verticalCenter: main.verticalCenter | ||
956 | 451 | } | ||
957 | 452 | width: (status === Loader.Ready) ? item.implicitWidth : 0 | ||
958 | 453 | visible: (status === Loader.Ready) && (item.width === item.implicitWidth) | ||
959 | 454 | Behavior on width { | ||
960 | 455 | NumberAnimation { | ||
961 | 456 | duration: UbuntuAnimation.SnapDuration | ||
962 | 457 | } | ||
963 | 458 | } | ||
964 | 459 | } | ||
965 | 460 | |||
966 | 461 | Item { | ||
967 | 462 | id: mainContents | ||
968 | 463 | |||
969 | 464 | anchors { | ||
970 | 465 | left: selectionIcon.right | ||
971 | 466 | //leftMargin: units.gu(2) // CUSTOM | ||
972 | 467 | top: parent.top | ||
973 | 468 | //topMargin: units.gu(1) // CUSTOM | ||
974 | 469 | right: parent.right | ||
975 | 470 | //rightMargin: units.gu(2) // CUSTOM | ||
976 | 471 | bottom: parent.bottom | ||
977 | 472 | //bottomMargin: units.gu(1) // CUSTOM | ||
978 | 473 | } | ||
979 | 474 | } | ||
980 | 333 | 475 | ||
981 | 334 | Behavior on x { | 476 | Behavior on x { |
982 | 335 | UbuntuNumberAnimation { | 477 | UbuntuNumberAnimation { |
983 | @@ -342,7 +484,7 @@ | |||
984 | 342 | } | 484 | } |
985 | 343 | 485 | ||
986 | 344 | /* CUSTOM Reorder Component */ | 486 | /* CUSTOM Reorder Component */ |
988 | 345 | Rectangle { | 487 | Item { |
989 | 346 | id: actionReorder | 488 | id: actionReorder |
990 | 347 | anchors { | 489 | anchors { |
991 | 348 | bottom: parent.bottom | 490 | bottom: parent.bottom |
992 | @@ -350,9 +492,8 @@ | |||
993 | 350 | rightMargin: units.gu(1) | 492 | rightMargin: units.gu(1) |
994 | 351 | top: parent.top | 493 | top: parent.top |
995 | 352 | } | 494 | } |
996 | 353 | color: "transparent" | ||
997 | 354 | width: units.gu(4) | 495 | width: units.gu(4) |
999 | 355 | visible: reordering | 496 | visible: reorderable && selectionMode && root.parent.parent.selectedItems.length === 0 |
1000 | 356 | 497 | ||
1001 | 357 | Icon { | 498 | Icon { |
1002 | 358 | anchors { | 499 | anchors { |
1003 | @@ -469,7 +610,10 @@ | |||
1004 | 469 | value: 1.0 | 610 | value: 1.0 |
1005 | 470 | } | 611 | } |
1006 | 471 | ScriptAction { | 612 | ScriptAction { |
1008 | 472 | script: root.activeAction.triggered(root) | 613 | script: { |
1009 | 614 | root.activeAction.triggered(root) | ||
1010 | 615 | mouseArea.state = "" | ||
1011 | 616 | } | ||
1012 | 473 | } | 617 | } |
1013 | 474 | PauseAnimation { | 618 | PauseAnimation { |
1014 | 475 | duration: 500 | 619 | duration: 500 |
1015 | @@ -479,23 +623,53 @@ | |||
1016 | 479 | property: "x" | 623 | property: "x" |
1017 | 480 | to: 0 | 624 | to: 0 |
1018 | 481 | } | 625 | } |
1019 | 482 | ScriptAction { | ||
1020 | 483 | script: resetPrimed() | ||
1021 | 484 | } | ||
1022 | 485 | } | 626 | } |
1023 | 486 | 627 | ||
1024 | 487 | MouseArea { | 628 | MouseArea { |
1025 | 488 | id: mouseArea | 629 | id: mouseArea |
1026 | 489 | 630 | ||
1028 | 490 | property bool locked: root.locked || ((root.leftSideAction === null) && (root.rightSideActions.count === 0)) || reordering // CUSTOM | 631 | property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0)) || reordering // CUSTOM |
1029 | 491 | property bool manual: false | 632 | property bool manual: false |
1030 | 633 | property string direction: "None" | ||
1031 | 634 | property real lastX: -1 | ||
1032 | 492 | 635 | ||
1033 | 493 | anchors.fill: parent | 636 | anchors.fill: parent |
1034 | 494 | drag { | 637 | drag { |
1035 | 495 | target: locked ? null : main | 638 | target: locked ? null : main |
1036 | 496 | axis: Drag.XAxis | 639 | axis: Drag.XAxis |
1038 | 497 | minimumX: rightActionsView.visible ? -(rightActionsView.width + root.actionThreshold) : 0 | 640 | minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0 |
1039 | 498 | maximumX: leftActionView.visible ? leftActionView.width : 0 | 641 | maximumX: leftActionView.visible ? leftActionView.width : 0 |
1040 | 642 | threshold: root.actionThreshold | ||
1041 | 643 | } | ||
1042 | 644 | |||
1043 | 645 | states: [ | ||
1044 | 646 | State { | ||
1045 | 647 | name: "LeftToRight" | ||
1046 | 648 | PropertyChanges { | ||
1047 | 649 | target: mouseArea | ||
1048 | 650 | drag.maximumX: 0 | ||
1049 | 651 | } | ||
1050 | 652 | }, | ||
1051 | 653 | State { | ||
1052 | 654 | name: "RightToLeft" | ||
1053 | 655 | PropertyChanges { | ||
1054 | 656 | target: mouseArea | ||
1055 | 657 | drag.minimumX: 0 | ||
1056 | 658 | } | ||
1057 | 659 | } | ||
1058 | 660 | ] | ||
1059 | 661 | |||
1060 | 662 | onMouseXChanged: { | ||
1061 | 663 | var offset = (lastX - mouseX) | ||
1062 | 664 | if (Math.abs(offset) <= root.actionThreshold) { | ||
1063 | 665 | return | ||
1064 | 666 | } | ||
1065 | 667 | lastX = mouseX | ||
1066 | 668 | direction = offset > 0 ? "RTL" : "LTR"; | ||
1067 | 669 | } | ||
1068 | 670 | |||
1069 | 671 | onPressed: { | ||
1070 | 672 | lastX = mouse.x | ||
1071 | 499 | } | 673 | } |
1072 | 500 | 674 | ||
1073 | 501 | onReleased: { | 675 | onReleased: { |
1074 | @@ -505,10 +679,13 @@ | |||
1075 | 505 | root.returnToBounds() | 679 | root.returnToBounds() |
1076 | 506 | root.activeAction = null | 680 | root.activeAction = null |
1077 | 507 | } | 681 | } |
1078 | 682 | lastX = -1 | ||
1079 | 683 | direction = "None" | ||
1080 | 508 | } | 684 | } |
1081 | 509 | onClicked: { | 685 | onClicked: { |
1084 | 510 | if (reordering) { // CUSTOM | 686 | if (selectionMode) { // CUSTOM |
1085 | 511 | reordering = false | 687 | selected = !selected |
1086 | 688 | return | ||
1087 | 512 | } | 689 | } |
1088 | 513 | else if (main.x === 0) { | 690 | else if (main.x === 0) { |
1089 | 514 | root.itemClicked(mouse) | 691 | root.itemClicked(mouse) |
1090 | @@ -544,8 +721,6 @@ | |||
1091 | 544 | } | 721 | } |
1092 | 545 | } | 722 | } |
1093 | 546 | 723 | ||
1094 | 547 | onPressedChanged: root.pressed = pressed | ||
1095 | 548 | |||
1096 | 549 | z: -1 | 724 | z: -1 |
1097 | 550 | } | 725 | } |
1098 | 551 | } | 726 | } |
1099 | 552 | 727 | ||
1100 | === modified file 'common/SongsPage.qml' | |||
1101 | --- common/SongsPage.qml 2014-10-21 17:30:51 +0000 | |||
1102 | +++ common/SongsPage.qml 2014-10-21 21:53:07 +0000 | |||
1103 | @@ -44,7 +44,7 @@ | |||
1104 | 44 | property alias album: songsModel.album | 44 | property alias album: songsModel.album |
1105 | 45 | property alias genre: songsModel.genre | 45 | property alias genre: songsModel.genre |
1106 | 46 | 46 | ||
1108 | 47 | state: songStackPage.line1 === i18n.tr("Playlist") ? "playlist" : "album" | 47 | state: albumtrackslist.state === "multiselectable" ? "selection" : (songStackPage.line1 === i18n.tr("Playlist") ? "playlist" : "album") |
1109 | 48 | states: [ | 48 | states: [ |
1110 | 49 | PageHeadState { | 49 | PageHeadState { |
1111 | 50 | id: albumState | 50 | id: albumState |
1112 | @@ -57,7 +57,6 @@ | |||
1113 | 57 | }, | 57 | }, |
1114 | 58 | PageHeadState { | 58 | PageHeadState { |
1115 | 59 | id: playlistState | 59 | id: playlistState |
1116 | 60 | |||
1117 | 61 | name: "playlist" | 60 | name: "playlist" |
1118 | 62 | actions: [ | 61 | actions: [ |
1119 | 63 | Action { | 62 | Action { |
1120 | @@ -82,6 +81,78 @@ | |||
1121 | 82 | backAction: playlistState.backAction | 81 | backAction: playlistState.backAction |
1122 | 83 | actions: playlistState.actions | 82 | actions: playlistState.actions |
1123 | 84 | } | 83 | } |
1124 | 84 | }, | ||
1125 | 85 | PageHeadState { | ||
1126 | 86 | id: selectionState | ||
1127 | 87 | name: "selection" | ||
1128 | 88 | backAction: Action { | ||
1129 | 89 | text: i18n.tr("Cancel selection") | ||
1130 | 90 | iconName: "back" | ||
1131 | 91 | onTriggered: albumtrackslist.state = "normal" | ||
1132 | 92 | } | ||
1133 | 93 | actions: [ | ||
1134 | 94 | Action { | ||
1135 | 95 | iconName: "select" | ||
1136 | 96 | text: i18n.tr("Select All") | ||
1137 | 97 | onTriggered: { | ||
1138 | 98 | if (albumtrackslist.selectedItems.length === albumtrackslist.model.count) { | ||
1139 | 99 | albumtrackslist.clearSelection() | ||
1140 | 100 | } else { | ||
1141 | 101 | albumtrackslist.selectAll() | ||
1142 | 102 | } | ||
1143 | 103 | } | ||
1144 | 104 | }, | ||
1145 | 105 | Action { | ||
1146 | 106 | enabled: albumtrackslist.selectedItems.length > 0 | ||
1147 | 107 | iconName: "add-to-playlist" | ||
1148 | 108 | text: i18n.tr("Add to playlist") | ||
1149 | 109 | onTriggered: { | ||
1150 | 110 | var items = [] | ||
1151 | 111 | |||
1152 | 112 | for (var i=0; i < albumtrackslist.selectedItems.length; i++) { | ||
1153 | 113 | items.push(makeDict(albumtrackslist.model.get(albumtrackslist.selectedItems[i], albumtrackslist.model.RoleModelData))); | ||
1154 | 114 | } | ||
1155 | 115 | |||
1156 | 116 | chosenElements = items; | ||
1157 | 117 | mainPageStack.push(addtoPlaylist) | ||
1158 | 118 | |||
1159 | 119 | albumtrackslist.closeSelection() | ||
1160 | 120 | } | ||
1161 | 121 | }, | ||
1162 | 122 | Action { | ||
1163 | 123 | enabled: albumtrackslist.selectedItems.length > 0 | ||
1164 | 124 | iconName: "add" | ||
1165 | 125 | text: i18n.tr("Add to queue") | ||
1166 | 126 | onTriggered: { | ||
1167 | 127 | for (var i=0; i < albumtrackslist.selectedItems.length; i++) { | ||
1168 | 128 | trackQueue.model.append(makeDict(albumtrackslist.model.get(albumtrackslist.selectedItems[i], albumtrackslist.model.RoleModelData))); | ||
1169 | 129 | } | ||
1170 | 130 | |||
1171 | 131 | albumtrackslist.closeSelection() | ||
1172 | 132 | } | ||
1173 | 133 | }, | ||
1174 | 134 | Action { | ||
1175 | 135 | enabled: albumtrackslist.selectedItems.length > 0 | ||
1176 | 136 | iconName: "delete" | ||
1177 | 137 | text: i18n.tr("Delete") | ||
1178 | 138 | visible: songStackPage.line1 === i18n.tr("Playlist") | ||
1179 | 139 | onTriggered: { | ||
1180 | 140 | for (var i=0; i < albumtrackslist.selectedItems.length; i++) { | ||
1181 | 141 | Playlists.removeFromPlaylist(songStackPage.line2, albumtrackslist.selectedItems[i] - i) | ||
1182 | 142 | } | ||
1183 | 143 | |||
1184 | 144 | albumtrackslist.closeSelection() | ||
1185 | 145 | |||
1186 | 146 | albumTracksModel.filterPlaylistTracks(songStackPage.line2) | ||
1187 | 147 | playlistModel.filterPlaylists() | ||
1188 | 148 | } | ||
1189 | 149 | } | ||
1190 | 150 | ] | ||
1191 | 151 | PropertyChanges { | ||
1192 | 152 | target: songStackPage.head | ||
1193 | 153 | backAction: selectionState.backAction | ||
1194 | 154 | actions: selectionState.actions | ||
1195 | 155 | } | ||
1196 | 85 | } | 156 | } |
1197 | 86 | ] | 157 | ] |
1198 | 87 | 158 | ||
1199 | @@ -99,6 +170,36 @@ | |||
1200 | 99 | model: isAlbum ? songsModel : albumTracksModel.model | 170 | model: isAlbum ? songsModel : albumTracksModel.model |
1201 | 100 | objectName: "songspage-listview" | 171 | objectName: "songspage-listview" |
1202 | 101 | width: parent.width | 172 | width: parent.width |
1203 | 173 | |||
1204 | 174 | // Requirements for ListItemWithActions | ||
1205 | 175 | property var selectedItems: [] | ||
1206 | 176 | |||
1207 | 177 | signal clearSelection() | ||
1208 | 178 | signal closeSelection() | ||
1209 | 179 | signal selectAll() | ||
1210 | 180 | |||
1211 | 181 | onClearSelection: selectedItems = [] | ||
1212 | 182 | onCloseSelection: { | ||
1213 | 183 | clearSelection() | ||
1214 | 184 | state = "normal" | ||
1215 | 185 | } | ||
1216 | 186 | onSelectAll: { | ||
1217 | 187 | var tmp = selectedItems | ||
1218 | 188 | |||
1219 | 189 | for (var i=0; i < model.count; i++) { | ||
1220 | 190 | if (tmp.indexOf(i) === -1) { | ||
1221 | 191 | tmp.push(i) | ||
1222 | 192 | } | ||
1223 | 193 | } | ||
1224 | 194 | |||
1225 | 195 | selectedItems = tmp | ||
1226 | 196 | } | ||
1227 | 197 | onVisibleChanged: { | ||
1228 | 198 | if (!visible) { | ||
1229 | 199 | clearSelection(true) | ||
1230 | 200 | } | ||
1231 | 201 | } | ||
1232 | 202 | |||
1233 | 102 | header: BlurredHeader { | 203 | header: BlurredHeader { |
1234 | 103 | rightColumn: Column { | 204 | rightColumn: Column { |
1235 | 104 | spacing: units.gu(2) | 205 | spacing: units.gu(2) |
1236 | @@ -238,15 +339,12 @@ | |||
1237 | 238 | 339 | ||
1238 | 239 | ListItemWithActions { | 340 | ListItemWithActions { |
1239 | 240 | id: track | 341 | id: track |
1240 | 241 | color: "transparent" | ||
1241 | 242 | objectName: "songsPageListItem" + index | 342 | objectName: "songsPageListItem" + index |
1242 | 243 | iconFrame: false | ||
1243 | 244 | progression: false | ||
1244 | 245 | showDivider: false | ||
1245 | 246 | height: units.gu(6) | 343 | height: units.gu(6) |
1246 | 247 | 344 | ||
1247 | 248 | leftSideAction: songStackPage.line1 === i18n.tr("Playlist") | 345 | leftSideAction: songStackPage.line1 === i18n.tr("Playlist") |
1248 | 249 | ? playlistRemoveAction.item : null | 346 | ? playlistRemoveAction.item : null |
1249 | 347 | multiselectable: true | ||
1250 | 250 | reorderable: songStackPage.line1 === i18n.tr("Playlist") | 348 | reorderable: songStackPage.line1 === i18n.tr("Playlist") |
1251 | 251 | rightSideActions: [ | 349 | rightSideActions: [ |
1252 | 252 | AddToQueue { | 350 | AddToQueue { |
1253 | @@ -256,7 +354,6 @@ | |||
1254 | 256 | 354 | ||
1255 | 257 | } | 355 | } |
1256 | 258 | ] | 356 | ] |
1257 | 259 | triggerActionOnMouseRelease: true | ||
1258 | 260 | 357 | ||
1259 | 261 | onItemClicked: { | 358 | onItemClicked: { |
1260 | 262 | trackClicked(albumtrackslist.model, index) // play track | 359 | trackClicked(albumtrackslist.model, index) // play track |
1261 | @@ -289,9 +386,6 @@ | |||
1262 | 289 | } | 386 | } |
1263 | 290 | } | 387 | } |
1264 | 291 | 388 | ||
1265 | 292 | // TODO: If http://pad.lv/1354753 is fixed to expose whether the Shape should appear pressed, update this as well. | ||
1266 | 293 | onPressedChanged: musicRow.pressed = pressed | ||
1267 | 294 | |||
1268 | 295 | MusicRow { | 389 | MusicRow { |
1269 | 296 | id: musicRow | 390 | id: musicRow |
1270 | 297 | covers: [] | 391 | covers: [] |
1271 | 298 | 392 | ||
1272 | === modified file 'music-app.qml' | |||
1273 | --- music-app.qml 2014-10-21 14:59:51 +0000 | |||
1274 | +++ music-app.qml 2014-10-21 21:53:07 +0000 | |||
1275 | @@ -594,7 +594,7 @@ | |||
1276 | 594 | property string lastfmusername | 594 | property string lastfmusername |
1277 | 595 | property string lastfmpassword | 595 | property string lastfmpassword |
1278 | 596 | property string timestamp // used to scrobble | 596 | property string timestamp // used to scrobble |
1280 | 597 | property var chosenElement: null | 597 | property var chosenElements: [] |
1281 | 598 | property bool toolbarShown: musicToolbar.visible | 598 | property bool toolbarShown: musicToolbar.visible |
1282 | 599 | property bool selectedAlbum: false | 599 | property bool selectedAlbum: false |
1283 | 600 | 600 | ||
1284 | @@ -875,7 +875,7 @@ | |||
1285 | 875 | } | 875 | } |
1286 | 876 | 876 | ||
1287 | 877 | // Popover for tracks, queue and add to playlist, for example | 877 | // Popover for tracks, queue and add to playlist, for example |
1289 | 878 | Component { | 878 | Component { // TODO: needed anymore? remove? |
1290 | 879 | id: trackPopoverComponent | 879 | id: trackPopoverComponent |
1291 | 880 | Popover { | 880 | Popover { |
1292 | 881 | id: trackPopover | 881 | id: trackPopover |
1293 | @@ -895,9 +895,12 @@ | |||
1294 | 895 | anchors.verticalCenter: parent.verticalCenter | 895 | anchors.verticalCenter: parent.verticalCenter |
1295 | 896 | } | 896 | } |
1296 | 897 | onClicked: { | 897 | onClicked: { |
1298 | 898 | console.debug("Debug: Add track to queue: " + JSON.stringify(chosenElement)) | 898 | console.debug("Debug: Add track to queue: " + JSON.stringify(chosenElements)) |
1299 | 899 | PopupUtils.close(trackPopover) | 899 | PopupUtils.close(trackPopover) |
1301 | 900 | trackQueue.append(chosenElement) | 900 | |
1302 | 901 | for (var i=0; i < chosenElements.length; i++) { | ||
1303 | 902 | trackQueue.append(chosenElements[i]) | ||
1304 | 903 | } | ||
1305 | 901 | } | 904 | } |
1306 | 902 | } | 905 | } |
1307 | 903 | ListItem.Standard { | 906 | ListItem.Standard { |
PASSED: Continuous integration, rev:677 91.189. 93.70:8080/ job/music- app-remix- ci/128/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 1108 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 1108/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/music- app-remix- utopic- amd64-ci/ 128
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/music- app-remix- ci/128/ rebuild
http://