Merge lp:~stolowski/unity-lens-music/price-as-extra-text into lp:unity-lens-music

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 101
Merged at revision: 102
Proposed branch: lp:~stolowski/unity-lens-music/price-as-extra-text
Merge into: lp:unity-lens-music
Diff against target: 58 lines (+14/-1)
4 files modified
src/album.vala (+1/-0)
src/musicstore-collection.vala (+10/-0)
src/musicstore-scope.vala (+2/-0)
tests/manual/previews-musicstore.txt (+1/-1)
To merge this branch: bzr merge lp:~stolowski/unity-lens-music/price-as-extra-text
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+123741@code.launchpad.net

Commit message

Set price as extra_text of 'Download' action.

Description of the change

Set price as extra_text of 'Download' action.

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

Approving this, cause without a unity branch that actually renders the extra-text, there's no UI change.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/album.vala'
2--- src/album.vala 2011-09-14 18:33:52 +0000
3+++ src/album.vala 2012-09-11 13:29:55 +0000
4@@ -27,5 +27,6 @@
5 public string artist { get; set; }
6 public string uri { get; set; }
7 public string artwork_path { get; set; }
8+ public string formatted_price { get; set; }
9 }
10 }
11\ No newline at end of file
12
13=== modified file 'src/musicstore-collection.vala'
14--- src/musicstore-collection.vala 2012-08-10 15:49:37 +0000
15+++ src/musicstore-collection.vala 2012-09-11 13:29:55 +0000
16@@ -71,6 +71,16 @@
17 album.artist = root_obj.get_string_member ("artist");
18 album.uri = http_uri;
19
20+ // musicsearch should give us formatted_price, but fallback to price + currency
21+ if (root_obj.has_member ("formatted_price"))
22+ {
23+ album.formatted_price = root_obj.get_string_member ("formatted_price");
24+ }
25+ else if (root_obj.has_member ("price") && root_obj.has_member ("currency"))
26+ {
27+ album.formatted_price = root_obj.get_string_member ("price") + " " + root_obj.get_string_member ("currency");
28+ }
29+
30 if (root_obj.has_member ("tracks"))
31 {
32 var tracks_node = root_obj.get_array_member ("tracks");
33
34=== modified file 'src/musicstore-scope.vala'
35--- src/musicstore-scope.vala 2012-08-27 08:46:44 +0000
36+++ src/musicstore-scope.vala 2012-09-11 13:29:55 +0000
37@@ -171,6 +171,8 @@
38 }
39
40 var download_action = new Unity.PreviewAction ("download_album", _("Download"), null);
41+ if (album.formatted_price != null)
42+ download_action.extra_text = album.formatted_price;
43 download_action.activated.connect (download_album);
44 music_preview.add_action (download_action);
45 }
46
47=== modified file 'tests/manual/previews-musicstore.txt'
48--- tests/manual/previews-musicstore.txt 2012-08-30 11:55:24 +0000
49+++ tests/manual/previews-musicstore.txt 2012-09-11 13:29:55 +0000
50@@ -12,7 +12,7 @@
51
52 Expected Result:
53 Album preview should be displayed. It should display album cover, album title, album artist and year (as subtitle)
54-a list of tracks and 'Download' button.
55+a list of tracks and 'Download' button. 'Download' button should display price and currency.
56
57
58 Preview of U1ms album - 'Download' action.

Subscribers

People subscribed via source and target branches

to all changes: