Merge lp:~stolowski/unity-lens-music/price-in-results into lp:unity-lens-music

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 105
Merged at revision: 104
Proposed branch: lp:~stolowski/unity-lens-music/price-in-results
Merge into: lp:unity-lens-music
Diff against target: 68 lines (+24/-4)
2 files modified
src/daemon.vala (+2/-2)
src/musicstore-collection.vala (+22/-2)
To merge this branch: bzr merge lp:~stolowski/unity-lens-music/price-in-results
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+124195@code.launchpad.net

Commit message

Use annotated icon in musicstore results. Renamed 'Available for purchase' category to 'More suggestions' and use new icon.

Description of the change

Use annotated icon in musicstore results. Renamed 'Available for purchase' category to 'More suggestions' and use new icon.

To post a comment you must log in.
105. By Paweł Stołowski

Renamed 'Treat yourself' to 'More suggestions', per design request.

Revision history for this message
Michal Hruby (mhr3) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/daemon.vala'
2--- src/daemon.vala 2012-08-21 11:06:54 +0000
3+++ src/daemon.vala 2012-09-13 16:45:34 +0000
4@@ -127,8 +127,8 @@
5 new FileIcon (icon_dir.get_child ("group-albums.svg")));
6 categories.append (cat);
7
8- cat = new Unity.Category (_("Available for Purchase"),
9- new FileIcon (icon_dir.get_child ("group-purchase.svg")),
10+ cat = new Unity.Category (_("More suggestions"),
11+ new FileIcon (icon_dir.get_child ("group-treat-yourself.svg")),
12 Unity.CategoryRenderer.FLOW);
13 categories.append (cat);
14
15
16=== modified file 'src/musicstore-collection.vala'
17--- src/musicstore-collection.vala 2012-09-11 12:50:34 +0000
18+++ src/musicstore-collection.vala 2012-09-13 16:45:34 +0000
19@@ -152,12 +152,22 @@
20 uri = album_obj.get_string_member ("purchase_url");
21 details_uri = album_obj.get_string_member ("details");
22 artwork_path = album_obj.get_string_member ("image");
23+
24+ string icon = artwork_path;
25+ if (album_obj.has_member ("formatted_price"))
26+ {
27+ var icon_obj = new AnnotatedIcon (new FileIcon (File.new_for_uri (artwork_path)));
28+ icon_obj.category = CategoryType.MUSIC;
29+ icon_obj.ribbon = album_obj.get_string_member ("formatted_price");
30+ icon = icon_obj.to_string ();
31+ }
32+
33 mimetype = "audio-x-generic";
34 title = album_obj.get_string_member ("title");
35 artist = album_obj.get_string_member ("artist");
36 dnd_uri = uri;
37
38- model.append (uri, artwork_path, PURCHASE_CATEGORY,
39+ model.append (uri, icon, PURCHASE_CATEGORY,
40 mimetype, title, artist, dnd_uri);
41
42 preview_uri_map.insert (uri.substring (7), details_uri); // strip off "u1ms://" from the uri
43@@ -169,6 +179,16 @@
44 uri = track_obj.get_string_member ("purchase_url");
45 details_uri = track_obj.get_string_member ("details");
46 artwork_path = track_obj.get_string_member ("image");
47+
48+ string icon = artwork_path;
49+ if (track_obj.has_member ("formatted_price"))
50+ {
51+ var icon_obj = new AnnotatedIcon (new FileIcon (File.new_for_uri (artwork_path)));
52+ icon_obj.category = CategoryType.MUSIC;
53+ icon_obj.ribbon = track_obj.get_string_member ("formatted_price");
54+ icon = icon_obj.to_string ();
55+ }
56+
57 mimetype = "audio-x-generic";
58 title = track_obj.get_string_member ("title");
59 artist = track_obj.get_string_member ("artist");
60@@ -176,7 +196,7 @@
61
62 // FIXME drag n drop uri needs to be the u1ms:// link
63
64- model.append (uri, artwork_path, PURCHASE_CATEGORY,
65+ model.append (uri, icon, PURCHASE_CATEGORY,
66 mimetype, title, artist, dnd_uri);
67 preview_uri_map.insert (uri.substring (7), details_uri); // strip off "u1ms://" from the uri
68 }

Subscribers

People subscribed via source and target branches

to all changes: