Merge lp:~mvo/software-center/lp968974 into lp:software-center

Proposed by Michael Vogt on 2012-04-12
Status: Work in progress
Proposed branch: lp:~mvo/software-center/lp968974
Merge into: lp:software-center
Diff against target: 148 lines (+48/-5)
4 files modified
softwarecenter/enums.py (+4/-0)
softwarecenter/ui/gtk3/models/appstore2.py (+2/-2)
softwarecenter/ui/gtk3/views/appdetailsview.py (+21/-3)
test/gtk3/test_appdetailsview.py (+21/-0)
To merge this branch: bzr merge lp:~mvo/software-center/lp968974
Reviewer Review Type Date Requested Status
Matthew Paul Thomas design 2012-04-12 Needs Fixing on 2012-04-13
Natalia Bidart Approve on 2012-04-12
Review via email: mp+101710@code.launchpad.net

Description of the change

This branch changes the label/button in the appdetailsview for gratis/zero-dollar apps to show "Free" and "Install"
instead of USD$0 and Buy… (LP: #968974).

To avoid a string break its using "Install" instead of "Install…" but once 12.04 is released we should change
the string to include the "…".

To post a comment you must log in.
Natalia Bidart (nataliabidart) wrote :

Looks great! I tested it IRL as well.

review: Approve
Kiwinote (kiwinote) wrote :

Just a few quick comments based purely on ui testing rather than the code:
- in the list views 0$ apps don't have an install button (free apps have install and for purchase apps have buy) *

clicking on install for a 0$ app:
- displays a spinner view with 'connecting to payment service' (this scares people - 'i thought it was free') *
- then requires an sso login ('bit odd, but ok')
- then another spinner comes up with 'payment authorised' ('wait, why did it charge me') *
- then an auth dialog pops up with the text 'to install purchased software, authenticate'
- the text in the status bar is 'installing purchase'
- the progress pane says 'installing purchase'
- another auth dialog 'to install or remove software'

clicking on reinstall previous purchases we see:
- appname (already purchased) (shouldn't appear at all as it isn't a purchase)
- clicking on it gives a status bar 'purchased on 2012-04-12'

I think what it comes down to is that until the majority of the points above are fixed (or at a realistic minimum the ones marked *), in my opinion 'buying' something for 0$ is a lot less confusing and scary than being confronted with 'connecting to payment service' and 'payment authorised' messages.

I do of course agree that we do want to have free/install instead of 0$/buy, it just seems that the behaviour in this branch is more confusing/scary than the current situation?

Michael Vogt (mvo) wrote :

Based on the excellent comments from Kiwinote I set this back to Work-in-Progress and will talk with MPT about the points you mentioned.

Matthew Paul Thomas (mpt) wrote :

Kiwinote, you make a good case for leaving this as it is until we can fix more of the strings.

review: Needs Fixing (design)

Unmerged revisions

2961. By Michael Vogt on 2012-04-12

do not show "USD$0"/buy for gratis apps, but instead show "Free" and "Install" (LP: #968974)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/enums.py'
2--- softwarecenter/enums.py 2012-03-21 20:54:46 +0000
3+++ softwarecenter/enums.py 2012-04-12 10:19:20 +0000
4@@ -68,6 +68,10 @@
5 # the server size "page" for ratings&reviews
6 REVIEWS_BATCH_PAGE_SIZE = 10
7
8+# the values that a price property can have when a app is gratis
9+# this is used for e.g. demo apps in the for-purchase channel
10+PRICE_GRATIS = ("0.00", "0", "")
11+
12
13 # the various "views" that the app has
14 class ViewPages:
15
16=== modified file 'softwarecenter/ui/gtk3/models/appstore2.py'
17--- softwarecenter/ui/gtk3/models/appstore2.py 2012-03-30 09:11:08 +0000
18+++ softwarecenter/ui/gtk3/models/appstore2.py 2012-04-12 10:19:20 +0000
19@@ -25,6 +25,7 @@
20 from gettext import gettext as _
21
22 from softwarecenter.enums import (Icons,
23+ PRICE_GRATIS,
24 XapianValues)
25
26
27@@ -47,7 +48,6 @@
28
29
30 LOG = logging.getLogger(__name__)
31-_FREE_AS_IN_BEER = ("0.00", "")
32
33
34 class CategoryRowReference:
35@@ -168,7 +168,7 @@
36 def is_purchasable(self, doc):
37 if doc.purchasable is None:
38 doc.purchasable = (doc.get_value(XapianValues.PRICE) not in
39- _FREE_AS_IN_BEER)
40+ PRICE_GRATIS)
41 return doc.purchasable
42
43 def get_pkgname(self, doc):
44
45=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
46--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-03-27 14:40:22 +0000
47+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-04-12 10:19:20 +0000
48@@ -40,6 +40,7 @@
49 from softwarecenter.enums import (AppActions,
50 PkgStates,
51 Icons,
52+ PRICE_GRATIS,
53 SOFTWARE_CENTER_PKGNAME)
54 from softwarecenter.utils import (is_unity_running,
55 upstream_version,
56@@ -374,12 +375,29 @@
57 # translatable when hardcoded, since it (currently)
58 # won't vary based on locale and as such we don't want
59 # it translated
60- self.set_label("US$ %s" % app_details.price)
61+ # label
62+ if app_details.price in PRICE_GRATIS:
63+ self.set_label(_("Free"))
64+ else:
65+ self.set_label("US$ %s" % app_details.price)
66+ # button
67 if (app_details.hardware_requirements_satisfied and
68 app_details.region_requirements_satisfied):
69- self.set_button_label(_(u'Buy\u2026'))
70+ if app_details.price in PRICE_GRATIS:
71+ # FIXME: once the 12.04 string freeze is over, we can
72+ # change this to include the "..."
73+ #self.set_button_label(_(u"Install\u2026"))
74+ self.set_button_label(_(u"Install"))
75+ else:
76+ self.set_button_label(_(u'Buy\u2026'))
77 else:
78- self.set_button_label(_(u'Buy Anyway\u2026'))
79+ if app_details.price in PRICE_GRATIS:
80+ # FIXME: once the 12.04 string freeze is over, we can
81+ # change this to include the "..."
82+ #self.set_button_label(_(u"Install Anyway\u2026"))
83+ self.set_button_label(_(u"Install Anyway"))
84+ else:
85+ self.set_button_label(_(u'Buy Anyway\u2026'))
86 elif state == PkgStates.FORCE_VERSION:
87 self.set_button_label(_('Change'))
88 elif state in (
89
90=== modified file 'test/gtk3/test_appdetailsview.py'
91--- test/gtk3/test_appdetailsview.py 2012-03-15 21:19:02 +0000
92+++ test/gtk3/test_appdetailsview.py 2012-04-12 10:19:20 +0000
93@@ -375,6 +375,7 @@
94 self.assertEqual(
95 self.view.pkg_statusbar.button.get_label(), "Install Anyway")
96 # and again for purchase
97+ self.app_mock.details.price = "1.00"
98 self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
99 self.view.show_app(self.app_mock)
100 self.assertEqual(
101@@ -385,6 +386,15 @@
102 self.assertEqual(self.view.pkg_warningbar.label.get_text(),
103 _('This software requires a GPS, '
104 'but the computer does not have one.'))
105+ # and again for gratis "purchase"
106+ self.app_mock.details.price = "0.00"
107+ self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
108+ self.view.show_app(self.app_mock)
109+ self.assertEqual(
110+ self.view.pkg_statusbar.button.get_label(),
111+ # FIXME: update once the string freeze is over
112+ #_(u"Install Anyway\u2026").encode("utf-8"))
113+ _(u"Install Anyway").encode("utf-8"))
114
115 def test_no_show_hardware_requirements(self):
116 self.app_mock.details.hardware_requirements = {}
117@@ -398,6 +408,7 @@
118 self.assertEqual(
119 self.view.pkg_statusbar.button.get_label(), _("Install"))
120 # and again for purchase
121+ self.app_mock.details.price = "1.00"
122 self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
123 self.view.show_app(self.app_mock)
124 self.assertEqual(
125@@ -405,6 +416,15 @@
126 _(u'Buy\u2026').encode("utf-8"))
127 # check if the warning bar is invisible
128 self.assertFalse(self.view.pkg_warningbar.get_property("visible"))
129+ # and again for "gratis" purchase
130+ self.app_mock.details.price = "0.00"
131+ self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
132+ self.view.show_app(self.app_mock)
133+ self.assertEqual(
134+ self.view.pkg_statusbar.button.get_label(),
135+ # FIXME: update once the string freeze is over
136+ #_(u'Install\u2026').encode("utf-8"))
137+ _(u'Install').encode("utf-8"))
138
139 class RegionRequirementsTestCase(unittest.TestCase):
140
141@@ -435,6 +455,7 @@
142 self.assertEqual(
143 self.view.pkg_statusbar.button.get_label(), "Install Anyway")
144 # and again for purchase
145+ self.app_mock.details.price = "1.0"
146 self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
147 self.view.show_app(self.app_mock)
148 self.assertEqual(

Subscribers

People subscribed via source and target branches