Merge lp:~unity-team/unity8/music-video_renderers into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 412
Merged at revision: 427
Proposed branch: lp:~unity-team/unity8/music-video_renderers
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/unrevertr388
Diff against target: 417 lines (+241/-50)
9 files modified
Components/Tile.qml (+1/-2)
Components/TileStyle.qml (+4/-3)
Dash/Generic/FlatTileStyle.qml (+4/-3)
Dash/GenericScopeView.qml (+1/-1)
Dash/Music/MusicFilterGrid.qml (+25/-26)
Dash/Music/MusicTileStyle.qml (+101/-0)
Dash/Video/VideoFilterGrid.qml (+18/-14)
Dash/Video/VideoTileStyle.qml (+86/-0)
tests/qmltests/Dash/tst_FilterGrids.qml (+1/-1)
To merge this branch: bzr merge lp:~unity-team/unity8/music-video_renderers
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+190198@code.launchpad.net

Commit message

Add music and video renderers

Description of the change

Add music and video renderers

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:409
http://jenkins.qa.ubuntu.com/job/unity8-ci/1334/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4840/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2702
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2200
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1334
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1334/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1333
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1018/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/715
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/715/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2704
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2704/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2240
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2252

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1334/rebuild

review: Needs Fixing (continuous-integration)
410. By Andrea Cimitan

Should fix the test

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:410
http://jenkins.qa.ubuntu.com/job/unity8-ci/1341/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4857/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2723
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2207
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/364
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1341
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1341/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1340
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1036/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/732
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/732/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2725
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2725/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2260
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2272

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1341/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I'm a little worried about how much copied but yet different the code seems to be, i.e. MusicTileStyle and VideoTileStyle labels are "almost" the same but one of them is eliding right and the other center, and of them is bold and the other is not.
Also the icon elements are very similar but not enterily.

Is there no way we can actually reuse most of the stuff here instead of copy&pasting and changing a few lines? Otherwise when we decide leftMargin: units.gu(1) has to be leftMargin: units.gu(2) for a Label or something it's going to be a pain having to find out all the places it was copied and pasted.

411. By Andrea Cimitan

Should work better on tablet

412. By Andrea Cimitan

Deal with wrap

Revision history for this message
Albert Astals Cid (aacid) wrote :

Been told we'll have a second look after the freeze to try to address my comments, so Ok i guess

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:411
http://jenkins.qa.ubuntu.com/job/unity8-ci/1347/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/4889
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2763
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2213
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/370
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1347
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1347/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1346
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1067
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/764
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/764/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2765
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2765/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2300
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2315

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1347/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/Tile.qml'
2--- Components/Tile.qml 2013-10-10 10:20:52 +0000
3+++ Components/Tile.qml 2013-10-10 10:20:52 +0000
4@@ -20,8 +20,7 @@
5 AbstractButton {
6 property url source
7 property int fillMode: Image.PreserveAspectCrop
8- property int horizontalAlignment: Image.AlignHCenter
9- property int verticalAlignment: Image.AlignVCenter
10+ property int horizontalAlignment: Text.AlignHCenter
11 property string text
12 property int imageWidth
13 property int imageHeight
14
15=== modified file 'Components/TileStyle.qml'
16--- Components/TileStyle.qml 2013-10-10 10:20:52 +0000
17+++ Components/TileStyle.qml 2013-10-10 10:20:52 +0000
18@@ -39,8 +39,8 @@
19 cache: false
20 source: styledItem.source
21 fillMode: styledItem.fillMode
22- horizontalAlignment: styledItem.horizontalAlignment
23- verticalAlignment: styledItem.verticalAlignment
24+ horizontalAlignment: Image.AlignHCenter
25+ verticalAlignment: Image.AlignVCenter
26 }
27 }
28
29@@ -73,8 +73,9 @@
30 styleColor: "black"
31 fontSize: "small"
32 elide: Text.ElideMiddle
33- horizontalAlignment: Text.AlignHCenter
34+ horizontalAlignment: styledItem.horizontalAlignment
35 text: styledItem.text
36+ wrapMode: Text.Wrap
37 maximumLineCount: styledItem.maximumLineCount
38 }
39 }
40
41=== modified file 'Dash/Generic/FlatTileStyle.qml'
42--- Dash/Generic/FlatTileStyle.qml 2013-10-10 10:20:52 +0000
43+++ Dash/Generic/FlatTileStyle.qml 2013-10-10 10:20:52 +0000
44@@ -38,8 +38,8 @@
45 source: styledItem.source
46 fillMode: styledItem.fillMode
47 opacity: tile.disabled ? 0.3 : 1.0
48- horizontalAlignment: styledItem.horizontalAlignment
49- verticalAlignment: styledItem.verticalAlignment
50+ horizontalAlignment: Image.AlignHCenter
51+ verticalAlignment: Image.AlignVCenter
52 }
53
54 UbuntuShape {
55@@ -71,8 +71,9 @@
56 styleColor: "black"
57 fontSize: "small"
58 elide: Text.ElideMiddle
59- horizontalAlignment: Text.AlignHCenter
60+ horizontalAlignment: styledItem.horizontalAlignment
61 text: styledItem.text
62+ wrapMode: Text.Wrap
63 maximumLineCount: styledItem.maximumLineCount
64 }
65 }
66
67=== modified file 'Dash/GenericScopeView.qml'
68--- Dash/GenericScopeView.qml 2013-10-10 10:20:52 +0000
69+++ Dash/GenericScopeView.qml 2013-10-10 10:20:52 +0000
70@@ -208,7 +208,7 @@
71 switch (rendererId) {
72 case "grid": {
73 switch (contentType) {
74- case "video": return "Generic/GenericFilterGridPotrait.qml";
75+ case "video": return "Video/VideoFilterGrid.qml";
76 case "music": return "Music/MusicFilterGrid.qml";
77 case "apps": {
78 if (rendererHint == "toggled")
79
80=== modified file 'Dash/Music/MusicFilterGrid.qml'
81--- Dash/Music/MusicFilterGrid.qml 2013-09-23 09:44:04 +0000
82+++ Dash/Music/MusicFilterGrid.qml 2013-10-10 10:20:52 +0000
83@@ -16,42 +16,41 @@
84
85 import QtQuick 2.0
86 import "../../Components"
87-
88-FilterGrid {
89- id: filterGrid
90-
91- minimumHorizontalSpacing: units.gu(2)
92- maximumNumberOfColumns: 5
93- delegateWidth: units.gu(17)
94- delegateHeight: iconHeight + units.gu(3.5)
95- verticalSpacing: units.gu(2)
96-
97- readonly property int iconWidth: (width / columns) * 0.8
98- readonly property int iconHeight: iconWidth
99-
100- signal clicked(int index, var delegateItem, real itemY)
101- signal pressAndHold(int index, var delegateItem, real itemY)
102-
103- delegate: AlbumTile {
104+import "../Generic"
105+
106+GenericFilterGrid {
107+ id: filtergrid
108+
109+ delegateWidth: units.gu(11)
110+ delegateHeight: units.gu(16)
111+
112+ iconWidth: units.gu(11)
113+ iconHeight: units.gu(11)
114+
115+ delegate: Tile {
116 id: tile
117 objectName: "delegate" + index
118- width: filterGrid.cellWidth
119- height: filterGrid.cellHeight
120- iconWidth: filterGrid.iconWidth
121- iconHeight: filterGrid.iconHeight
122-
123- artist: model.title
124- album: model.comment
125+ width: filtergrid.cellWidth
126+ height: filtergrid.cellHeight
127+ text: model.comment
128+ imageWidth: filtergrid.iconWidth
129+ imageHeight: filtergrid.iconHeight
130 source: model.icon
131+ maximumLineCount: 2
132+ horizontalAlignment: Text.AlignLeft
133+
134+ style: MusicTileStyle {
135+ artist: model.title
136+ }
137
138 onClicked: {
139 var data = { model: model }
140- filterGrid.clicked(index, data, tile.y)
141+ filtergrid.clicked(index, data, tile.y)
142 }
143
144 onPressAndHold: {
145 var data = { model: model }
146- filterGrid.pressAndHold(index, data, tile.y)
147+ filtergrid.pressAndHold(index, data, tile.y)
148 }
149 }
150 }
151
152=== added file 'Dash/Music/MusicTileStyle.qml'
153--- Dash/Music/MusicTileStyle.qml 1970-01-01 00:00:00 +0000
154+++ Dash/Music/MusicTileStyle.qml 2013-10-10 10:20:52 +0000
155@@ -0,0 +1,101 @@
156+/*
157+ * Copyright (C) 2013 Canonical, Ltd.
158+ *
159+ * This program is free software; you can redistribute it and/or modify
160+ * it under the terms of the GNU General Public License as published by
161+ * the Free Software Foundation; version 3.
162+ *
163+ * This program is distributed in the hope that it will be useful,
164+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
165+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
166+ * GNU General Public License for more details.
167+ *
168+ * You should have received a copy of the GNU General Public License
169+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
170+ */
171+
172+import QtQuick 2.0
173+import Ubuntu.Components 0.1
174+
175+Item {
176+ id: tile
177+
178+ property alias artist: artistLabel.text
179+
180+ anchors.fill: parent
181+
182+ UbuntuShape {
183+ id: icon
184+ anchors {
185+ top: parent.top
186+ horizontalCenter: parent.horizontalCenter
187+ }
188+ radius: "medium"
189+ width: styledItem.imageWidth
190+ height: styledItem.imageHeight
191+ image: Image {
192+ id: image
193+ objectName: "image"
194+ sourceSize { width: icon.width; height: icon.height }
195+ asynchronous: true
196+ cache: false
197+ source: styledItem.source
198+ fillMode: styledItem.fillMode
199+ horizontalAlignment: Image.AlignHCenter
200+ verticalAlignment: Image.AlignVCenter
201+ }
202+ }
203+
204+ UbuntuShape {
205+ id: borderPressed
206+ objectName: "borderPressed"
207+
208+ anchors.fill: icon
209+ radius: "medium"
210+ borderSource: "radius_pressed.sci"
211+ opacity: styledItem.pressed ? 1.0 : 0.0
212+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
213+ }
214+
215+ Label {
216+ id: label
217+ objectName: "label"
218+ anchors {
219+ baseline: icon.bottom
220+ baselineOffset: units.gu(2)
221+ left: icon.left
222+ right: parent.right
223+ rightMargin: units.gu(1)
224+ }
225+
226+ color: Theme.palette.selected.backgroundText
227+ opacity: 0.9
228+ style: Text.Raised
229+ styleColor: "black"
230+ fontSize: "small"
231+ font.weight: Font.Bold
232+ elide: Text.ElideRight
233+ horizontalAlignment: styledItem.horizontalAlignment
234+ text: styledItem.text
235+ wrapMode: Text.Wrap
236+ maximumLineCount: styledItem.maximumLineCount
237+ }
238+
239+ Label {
240+ id: artistLabel
241+ anchors {
242+ top: label.bottom
243+ left: label.left
244+ right: label.right
245+ rightMargin: units.gu(1)
246+ }
247+
248+ color: Theme.palette.selected.backgroundText
249+ opacity: 0.9
250+ style: Text.Raised
251+ styleColor: "black"
252+ fontSize: "x-small"
253+ elide: Text.ElideMiddle
254+ horizontalAlignment: styledItem.horizontalAlignment
255+ }
256+}
257
258=== renamed file 'Dash/Video/VideosFilterGrid.qml' => 'Dash/Video/VideoFilterGrid.qml'
259--- Dash/Video/VideosFilterGrid.qml 2013-08-02 14:44:55 +0000
260+++ Dash/Video/VideoFilterGrid.qml 2013-10-10 10:20:52 +0000
261@@ -16,20 +16,16 @@
262
263 import QtQuick 2.0
264 import "../../Components"
265+import "../Generic"
266
267-FilterGrid {
268+GenericFilterGrid {
269 id: filtergrid
270
271- minimumHorizontalSpacing: units.gu(0.5)
272- maximumNumberOfColumns: 5
273 delegateWidth: units.gu(11)
274- delegateHeight: iconHeight + units.gu(2.5)
275- verticalSpacing: units.gu(2)
276-
277- readonly property int iconWidth: (width / columns) * 0.8
278- readonly property int iconHeight: iconWidth * 16 / 11
279-
280- signal clicked(int index, var data, real itemY)
281+ delegateHeight: units.gu(15)
282+
283+ iconWidth: units.gu(11)
284+ iconHeight: units.gu(11)
285
286 delegate: Tile {
287 id: tile
288@@ -40,11 +36,19 @@
289 imageWidth: filtergrid.iconWidth
290 imageHeight: filtergrid.iconHeight
291 source: model.icon
292- fillMode: Image.PreserveAspectCrop
293+ maximumLineCount: 2
294+ horizontalAlignment: Text.AlignLeft
295+
296+ style: VideoTileStyle {}
297+
298 onClicked: {
299- var fileUri = model.uri.replace(/^[^:]+:/, "")
300- var data = {fileUri: fileUri, nfoUri: model.comment}
301- filtergrid.clicked(index, data, tile.y);
302+ var data = { model: model }
303+ filtergrid.clicked(index, data, tile.y)
304+ }
305+
306+ onPressAndHold: {
307+ var data = { model: model }
308+ filtergrid.pressAndHold(index, data, tile.y)
309 }
310 }
311 }
312
313=== added file 'Dash/Video/VideoTileStyle.qml'
314--- Dash/Video/VideoTileStyle.qml 1970-01-01 00:00:00 +0000
315+++ Dash/Video/VideoTileStyle.qml 2013-10-10 10:20:52 +0000
316@@ -0,0 +1,86 @@
317+/*
318+ * Copyright (C) 2013 Canonical, Ltd.
319+ *
320+ * This program is free software; you can redistribute it and/or modify
321+ * it under the terms of the GNU General Public License as published by
322+ * the Free Software Foundation; version 3.
323+ *
324+ * This program is distributed in the hope that it will be useful,
325+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
326+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
327+ * GNU General Public License for more details.
328+ *
329+ * You should have received a copy of the GNU General Public License
330+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
331+ */
332+
333+import QtQuick 2.0
334+import Ubuntu.Components 0.1
335+
336+Item {
337+ id: tile
338+
339+ anchors.fill: parent
340+
341+ Image {
342+ id: icon
343+ anchors {
344+ top: parent.top
345+ horizontalCenter: parent.horizontalCenter
346+ }
347+ width: styledItem.imageWidth
348+ height: styledItem.imageHeight
349+ source: "graphics/movie_icon_holder.png"
350+
351+ Image {
352+ id: image
353+ objectName: "image"
354+ anchors {
355+ fill: parent;
356+ topMargin: units.gu(2);
357+ bottomMargin: units.gu(2)
358+ }
359+ sourceSize { width: icon.width; height: icon.height }
360+ asynchronous: true
361+ cache: false
362+ source: styledItem.source
363+ fillMode: styledItem.fillMode
364+ horizontalAlignment: Image.AlignHCenter
365+ verticalAlignment: Image.AlignVCenter
366+ }
367+ }
368+
369+ UbuntuShape {
370+ id: borderPressed
371+ objectName: "borderPressed"
372+
373+ anchors.fill: icon
374+ radius: "medium"
375+ borderSource: "radius_pressed.sci"
376+ opacity: styledItem.pressed ? 1.0 : 0.0
377+ Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
378+ }
379+
380+ Label {
381+ id: label
382+ objectName: "label"
383+ anchors {
384+ baseline: icon.bottom
385+ baselineOffset: units.gu(2)
386+ left: icon.left
387+ right: parent.right
388+ rightMargin: units.gu(1)
389+ }
390+
391+ color: Theme.palette.selected.backgroundText
392+ opacity: 0.9
393+ style: Text.Raised
394+ styleColor: "black"
395+ fontSize: "small"
396+ elide: Text.ElideRight
397+ horizontalAlignment: styledItem.horizontalAlignment
398+ text: styledItem.text
399+ wrapMode: Text.Wrap
400+ maximumLineCount: styledItem.maximumLineCount
401+ }
402+}
403
404=== added file 'Dash/Video/graphics/movie_icon_holder@27.png'
405Binary files Dash/Video/graphics/movie_icon_holder@27.png 1970-01-01 00:00:00 +0000 and Dash/Video/graphics/movie_icon_holder@27.png 2013-10-10 10:20:52 +0000 differ
406=== modified file 'tests/qmltests/Dash/tst_FilterGrids.qml'
407--- tests/qmltests/Dash/tst_FilterGrids.qml 2013-08-02 11:08:42 +0000
408+++ tests/qmltests/Dash/tst_FilterGrids.qml 2013-10-10 10:20:52 +0000
409@@ -107,7 +107,7 @@
410
411 function test_clicked_signal_data() {
412 return [
413- {tag: "VideosFilterGrid", component: "Video/VideosFilterGrid.qml"},
414+ {tag: "VideoFilterGrid", component: "Video/VideoFilterGrid.qml"},
415 {tag: "MusicFilterGrid", component: "Music/MusicFilterGrid.qml"},
416 {tag: "ApplicationsFilterGrid", component: "Apps/ApplicationsFilterGrid.qml"}
417 ]

Subscribers

People subscribed via source and target branches