Merge lp:~vthompson/music-app/music-uc1.3-sort-songs into lp:music-app

Proposed by Victor Thompson
Status: Work in progress
Proposed branch: lp:~vthompson/music-app/music-uc1.3-sort-songs
Merge into: lp:music-app
Prerequisite: lp:~vthompson/music-app/music-uc1.3
Diff against target: 294 lines (+67/-41)
3 files modified
app/ui/Songs.qml (+17/-0)
debian/changelog (+1/-0)
po/com.ubuntu.music.pot (+49/-41)
To merge this branch: bzr merge lp:~vthompson/music-app/music-uc1.3-sort-songs
Reviewer Review Type Date Requested Status
Andrew Hayzen Needs Information
Victor Thompson Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+275634@code.launchpad.net

Commit message

* Use Page Head Section to allow Songs tab to be sorted.

Description of the change

* Use Page Head Section to allow Songs tab to be sorted.

The related bug [1] has initial approval for using these Sections in the Now Playing view. This change allows the Songs tab to be sorted by date added.

1 - https://bugs.launchpad.net/music-app/+bug/1447428

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

PASSED: Continuous integration, rev:908
http://91.189.93.70:8080/job/music-app-ci/1398/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/music-app-vivid-amd64-ci/250

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/1398/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Using this in the 'root' pages could be problematic when the convergence stuff lands [2] as it uses the head sections instead of tabs. As we would then have double sections it would look a bit weird, I think header actions would be preferable here.

1 - https://code.launchpad.net/~ahayzen/music-app/refactor-adaptive-page-layout

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

Agreed, since the converged view will use the sections for the different tabs/views we should find a different pattern for the sorting options.

review: Needs Fixing
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

My suggestion is:
Create a header action called "Sort..." then use a popup (like the one in the webbrowser when you press and hold a link) that gives the options "Alphabetical", "Date added" etc.

review: Needs Information

Unmerged revisions

908. By Victor Thompson

* Use Page Head Section to allow Songs tab to be sorted.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ui/Songs.qml'
2--- app/ui/Songs.qml 2015-10-24 18:37:51 +0000
3+++ app/ui/Songs.qml 2015-10-24 18:37:51 +0000
4@@ -53,6 +53,23 @@
5 }
6 ]
7
8+ PageHeadSections {
9+ id: defaultStateSections
10+ model: [i18n.tr("Title"), i18n.tr("Date added")]
11+ selectedIndex: 0
12+ }
13+
14+ head {
15+ sections {
16+ model: defaultStateSections.model
17+ selectedIndex: defaultStateSections.selectedIndex
18+ onSelectedIndexChanged: {
19+ songsModelFilter.sort.property = head.sections.selectedIndex == 0 ? "title" : "eTag"
20+ songsModelFilter.sort.order = head.sections.selectedIndex == 0 ? Qt.AscendingOrder : Qt.DescendingOrder
21+ }
22+ }
23+ }
24+
25 // Hack for autopilot otherwise Albums appears as MusicPage
26 // due to bug 1341671 it is required that there is a property so that
27 // qml doesn't optimise using the parent type
28
29=== modified file 'debian/changelog'
30--- debian/changelog 2015-10-24 18:37:51 +0000
31+++ debian/changelog 2015-10-24 18:37:51 +0000
32@@ -6,6 +6,7 @@
33 [ Victor Thompson ]
34 * Remove some deprecated code for the UbuntuShape image property.
35 * Update app to use the Ubuntu Components version 1.3 (LP: #1508363)
36+ * Use Page Head Section to allow Songs tab to be sorted.
37
38 -- Bartosz Kosiorek <gang65@poczta.onet.pl> Tue, 08 Sep 2015 10:08:49 +0200
39
40
41=== modified file 'po/com.ubuntu.music.pot'
42--- po/com.ubuntu.music.pot 2015-08-21 19:41:03 +0000
43+++ po/com.ubuntu.music.pot 2015-10-24 18:37:51 +0000
44@@ -8,7 +8,7 @@
45 msgstr ""
46 "Project-Id-Version: music-app\n"
47 "Report-Msgid-Bugs-To: \n"
48-"POT-Creation-Date: 2015-08-21 20:40+0100\n"
49+"POT-Creation-Date: 2015-10-24 13:31-0500\n"
50 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
51 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
52 "Language-Team: LANGUAGE <LL@li.org>\n"
53@@ -37,7 +37,7 @@
54 msgid "Cancel"
55 msgstr ""
56
57-#: ../app/components/Dialog/ContentHubWaitDialog.qml:34
58+#: ../app/components/Dialog/ContentHubWaitDialog.qml:33
59 msgid "Waiting for file(s)..."
60 msgstr ""
61
62@@ -83,7 +83,7 @@
63 msgstr ""
64
65 #: ../app/components/Dialog/RemovePlaylistDialog.qml:37
66-#: ../app/components/ListItemActions/Remove.qml:28
67+#: ../app/components/ListItemActions/Remove.qml:27
68 msgid "Remove"
69 msgstr ""
70
71@@ -180,11 +180,11 @@
72 msgid "Shuffle"
73 msgstr ""
74
75-#: ../app/components/Walkthrough/Slide1.qml:58
76+#: ../app/components/Walkthrough/Slide1.qml:59
77 msgid "Welcome to Music"
78 msgstr ""
79
80-#: ../app/components/Walkthrough/Slide1.qml:72
81+#: ../app/components/Walkthrough/Slide1.qml:73
82 msgid ""
83 "Enjoy your favorite music with Ubuntu's Music App. Take a short tour on how "
84 "to get started or press skip to start listening now."
85@@ -195,7 +195,7 @@
86 msgstr ""
87
88 #: ../app/components/Walkthrough/Slide2.qml:67
89-#: ../app/ui/LibraryEmptyState.qml:117
90+#: ../app/ui/LibraryEmptyState.qml:123
91 msgid ""
92 "Connect your device to any computer and simply drag files to the Music "
93 "folder or insert removable media with music."
94@@ -213,84 +213,84 @@
95 msgid "Start"
96 msgstr ""
97
98-#: ../app/components/Walkthrough/Walkthrough.qml:84
99+#: ../app/components/Walkthrough/Walkthrough.qml:120
100 msgid "Skip"
101 msgstr ""
102
103-#: ../app/music-app.qml:155
104+#: ../app/music-app.qml:156
105 msgid "Next"
106 msgstr ""
107
108-#: ../app/music-app.qml:156
109+#: ../app/music-app.qml:157
110 msgid "Next Track"
111 msgstr ""
112
113-#: ../app/music-app.qml:162
114+#: ../app/music-app.qml:163
115 msgid "Pause"
116 msgstr ""
117
118-#: ../app/music-app.qml:162
119+#: ../app/music-app.qml:163
120 msgid "Play"
121 msgstr ""
122
123-#: ../app/music-app.qml:164
124+#: ../app/music-app.qml:165
125 msgid "Pause Playback"
126 msgstr ""
127
128-#: ../app/music-app.qml:164
129+#: ../app/music-app.qml:165
130 msgid "Continue or start playback"
131 msgstr ""
132
133-#: ../app/music-app.qml:169
134+#: ../app/music-app.qml:170
135 msgid "Back"
136 msgstr ""
137
138-#: ../app/music-app.qml:170
139+#: ../app/music-app.qml:171
140 msgid "Go back to last page"
141 msgstr ""
142
143-#: ../app/music-app.qml:178
144+#: ../app/music-app.qml:179
145 msgid "Previous"
146 msgstr ""
147
148-#: ../app/music-app.qml:179
149+#: ../app/music-app.qml:180
150 msgid "Previous Track"
151 msgstr ""
152
153-#: ../app/music-app.qml:184
154+#: ../app/music-app.qml:185
155 msgid "Stop"
156 msgstr ""
157
158-#: ../app/music-app.qml:185
159+#: ../app/music-app.qml:186
160 msgid "Stop Playback"
161 msgstr ""
162
163-#: ../app/music-app.qml:276 com.ubuntu.music_music.desktop.in.in.h:1
164+#: ../app/music-app.qml:277 com.ubuntu.music_music.desktop.in.in.h:1
165 msgid "Music"
166 msgstr ""
167
168-#: ../app/music-app.qml:306
169+#: ../app/music-app.qml:307
170 msgid "Debug: "
171 msgstr ""
172
173 #. TRANSLATORS: this appears in the header with limited space (around 20 characters)
174-#: ../app/music-app.qml:371 ../app/music-app.qml:986
175+#: ../app/music-app.qml:372 ../app/music-app.qml:987
176 #: ../app/ui/NowPlaying.qml:38
177 msgid "Now playing"
178 msgstr ""
179
180 #. TRANSLATORS: this appears in the header with limited space (around 20 characters)
181-#: ../app/music-app.qml:371 ../app/music-app.qml:403 ../app/music-app.qml:987
182-#: ../app/music-app.qml:991 ../app/ui/NowPlaying.qml:40
183+#: ../app/music-app.qml:372 ../app/music-app.qml:404 ../app/music-app.qml:988
184+#: ../app/music-app.qml:992 ../app/ui/NowPlaying.qml:40
185 msgid "Queue"
186 msgstr ""
187
188 #. TRANSLATORS: this appears in the header with limited space (around 20 characters)
189-#: ../app/ui/AddToPlaylist.qml:46
190+#: ../app/ui/AddToPlaylist.qml:45
191 msgid "Select playlist"
192 msgstr ""
193
194-#: ../app/ui/AddToPlaylist.qml:94 ../app/ui/Playlists.qml:87
195+#: ../app/ui/AddToPlaylist.qml:93 ../app/ui/Playlists.qml:86
196 #: ../app/ui/SongsView.qml:292 ../app/ui/SongsView.qml:293
197 #, qt-format
198 msgid "%1 song"
199@@ -300,12 +300,12 @@
200
201 #. TRANSLATORS: this is the name of the playlists page shown in the tab header.
202 #. Remember to keep the translation short to fit the screen width
203-#: ../app/ui/AddToPlaylist.qml:99 ../app/ui/Playlists.qml:38
204+#: ../app/ui/AddToPlaylist.qml:98 ../app/ui/Playlists.qml:37
205 #: ../app/ui/SongsView.qml:103
206 msgid "Playlists"
207 msgstr ""
208
209-#: ../app/ui/AddToPlaylist.qml:109 ../app/ui/Recent.qml:37
210+#: ../app/ui/AddToPlaylist.qml:108 ../app/ui/Recent.qml:36
211 #: ../app/ui/SongsView.qml:91
212 msgid "Recent"
213 msgstr ""
214@@ -314,35 +314,35 @@
215 msgid "Albums"
216 msgstr ""
217
218-#: ../app/ui/Albums.qml:72 ../app/ui/ArtistView.qml:129
219-#: ../app/ui/ArtistView.qml:142 ../app/ui/Recent.qml:82
220+#: ../app/ui/Albums.qml:72 ../app/ui/ArtistView.qml:128
221+#: ../app/ui/ArtistView.qml:141 ../app/ui/Recent.qml:81
222 #: ../app/ui/SongsView.qml:249
223 msgid "Unknown Album"
224 msgstr ""
225
226-#: ../app/ui/Albums.qml:73 ../app/ui/ArtistView.qml:85
227-#: ../app/ui/ArtistView.qml:141 ../app/ui/Artists.qml:80
228-#: ../app/ui/Recent.qml:83 ../app/ui/SongsView.qml:270
229+#: ../app/ui/Albums.qml:73 ../app/ui/ArtistView.qml:84
230+#: ../app/ui/ArtistView.qml:140 ../app/ui/Artists.qml:79
231+#: ../app/ui/Recent.qml:82 ../app/ui/SongsView.qml:270
232 msgid "Unknown Artist"
233 msgstr ""
234
235-#: ../app/ui/Albums.qml:83 ../app/ui/ArtistView.qml:140
236-#: ../app/ui/Recent.qml:98
237+#: ../app/ui/Albums.qml:83 ../app/ui/ArtistView.qml:139
238+#: ../app/ui/Recent.qml:97
239 msgid "Album"
240 msgstr ""
241
242-#: ../app/ui/ArtistView.qml:104
243+#: ../app/ui/ArtistView.qml:103
244 #, qt-format
245 msgid "%1 album"
246 msgid_plural "%1 albums"
247 msgstr[0] ""
248 msgstr[1] ""
249
250-#: ../app/ui/Artists.qml:38
251+#: ../app/ui/Artists.qml:37
252 msgid "Artists"
253 msgstr ""
254
255-#: ../app/ui/Artists.qml:108
256+#: ../app/ui/Artists.qml:107
257 msgid "Artist"
258 msgstr ""
259
260@@ -361,7 +361,7 @@
261 msgid "Genre"
262 msgstr ""
263
264-#: ../app/ui/LibraryEmptyState.qml:106
265+#: ../app/ui/LibraryEmptyState.qml:112
266 msgid "No music found"
267 msgstr ""
268
269@@ -370,8 +370,8 @@
270 msgid "Clear queue"
271 msgstr ""
272
273-#: ../app/ui/Playlists.qml:99 ../app/ui/Playlists.qml:100
274-#: ../app/ui/Recent.qml:83 ../app/ui/Recent.qml:98 ../app/ui/SongsView.qml:67
275+#: ../app/ui/Playlists.qml:98 ../app/ui/Playlists.qml:99
276+#: ../app/ui/Recent.qml:82 ../app/ui/Recent.qml:97 ../app/ui/SongsView.qml:67
277 #: ../app/ui/SongsView.qml:82 ../app/ui/SongsView.qml:114
278 #: ../app/ui/SongsView.qml:154 ../app/ui/SongsView.qml:188
279 #: ../app/ui/SongsView.qml:203 ../app/ui/SongsView.qml:222
280@@ -385,6 +385,14 @@
281 msgid "Songs"
282 msgstr ""
283
284+#: ../app/ui/Songs.qml:58
285+msgid "Title"
286+msgstr ""
287+
288+#: ../app/ui/Songs.qml:58
289+msgid "Date added"
290+msgstr ""
291+
292 #: com.ubuntu.music_music.desktop.in.in.h:2
293 msgid "A music application for Ubuntu"
294 msgstr ""

Subscribers

People subscribed via source and target branches