Merge lp:~mvo/software-center/remove-iso3166-support into lp:software-center

Proposed by Michael Vogt on 2012-03-02
Status: Work in progress
Proposed branch: lp:~mvo/software-center/remove-iso3166-support
Merge into: lp:software-center
Diff against target: 109 lines (+3/-53)
2 files modified
softwarecenter/ui/gtk3/views/appdetailsview.py (+3/-12)
test/gtk3/test_appdetailsview.py (+0/-41)
To merge this branch: bzr merge lp:~mvo/software-center/remove-iso3166-support
Reviewer Review Type Date Requested Status
Michael Vogt Needs Fixing on 2012-03-06
Gary Lasker 2012-03-02 Pending
Review via email: mp+95520@code.launchpad.net

Description of the change

This removes the support for a region warning (iso3166:: debtag) from the UI as MPT feels like this should be done in the description rather than with the explicit code we are using for this currently.

To post a comment you must log in.
Michael Vogt (mvo) wrote :

I put this on hold again, the rational is that we do have interesst from a customer in
such a feature.

review: Needs Fixing

Unmerged revisions

2803. By Michael Vogt on 2012-03-02

pyflake fix

2802. By Michael Vogt on 2012-03-02

remove region requirements warning after talking to mpt about it. he thinks it should be part of the description instead

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
2--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-02-27 16:05:43 +0000
3+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-03-02 09:40:27 +0000
4@@ -76,7 +76,6 @@
5 import softwarecenter.ui.gtk3.dialogs as dialogs
6
7 from softwarecenter.hw import get_hw_missing_long_description
8-from softwarecenter.region import REGION_WARNING_STRING
9
10 from softwarecenter.backend.reviews import get_review_loader
11 from softwarecenter.backend import get_install_backend
12@@ -378,8 +377,7 @@
13 # won't vary based on locale and as such we don't want
14 # it translated
15 self.set_label("US$ %s" % app_details.price)
16- if (app_details.hardware_requirements_satisfied and
17- app_details.region_requirements_satisfied):
18+ if app_details.hardware_requirements_satisfied:
19 self.set_button_label(_(u'Buy\u2026'))
20 else:
21 self.set_button_label(_(u'Buy Anyway\u2026'))
22@@ -413,8 +411,7 @@
23 else:
24 # TRANSLATORS: Free here means Gratis
25 self.set_label(_("Free"))
26- if (app_details.hardware_requirements_satisfied and
27- app_details.region_requirements_satisfied):
28+ if app_details.hardware_requirements_satisfied:
29 self.set_button_label(_('Install'))
30 else:
31 self.set_button_label(_('Install Anyway'))
32@@ -1454,17 +1451,11 @@
33 self.pkg_warningbar.show()
34 self.pkg_warningbar.label.set_text(app_details.error)
35 return
36- if (app_details.hardware_requirements_satisfied and
37- app_details.region_requirements_satisfied):
38+ if app_details.hardware_requirements_satisfied:
39 self.pkg_warningbar.hide()
40 else:
41 s = get_hw_missing_long_description(
42 app_details.hardware_requirements)
43- if not app_details.region_requirements_satisfied:
44- if len(s) > 0:
45- s += "\n"+REGION_WARNING_STRING
46- else:
47- s = REGION_WARNING_STRING
48 self.pkg_warningbar.label.set_text(s)
49 self.pkg_warningbar.show()
50
51
52=== modified file 'test/gtk3/test_appdetailsview.py'
53--- test/gtk3/test_appdetailsview.py 2012-02-23 16:40:27 +0000
54+++ test/gtk3/test_appdetailsview.py 2012-03-02 09:40:27 +0000
55@@ -15,7 +15,6 @@
56 from softwarecenter.ui.gtk3.widgets.labels import HardwareRequirementsBox
57 from softwarecenter.ui.gtk3.views.appdetailsview import get_test_window_appdetails
58 from softwarecenter.enums import PkgStates
59-from softwarecenter.region import REGION_WARNING_STRING
60
61 from test.test_database import make_purchased_app_details
62
63@@ -386,46 +385,6 @@
64 # check if the warning bar is invisible
65 self.assertFalse(self.view.pkg_warningbar.get_property("visible"))
66
67-class RegionRequirementsTestCase(unittest.TestCase):
68-
69- @classmethod
70- def setUpClass(cls):
71- # Set these as class attributes as we don't modify either
72- # during the tests.
73- from softwarecenter.testutils import get_test_db
74- cls.db = get_test_db()
75- cls.win = get_test_window_appdetails()
76- cls.view = cls.win.get_data("view")
77-
78- @classmethod
79- def tearDownClass(cls):
80- GObject.timeout_add(TIMEOUT, lambda: cls.win.destroy())
81- Gtk.main()
82-
83- def setUp(self):
84- app = Application("", "software-center")
85- self.app_mock = get_mock_app_from_real_app(app)
86- self.app_mock.details.pkg_state = PkgStates.UNINSTALLED
87-
88- def test_show_region_requirements(self):
89- self.app_mock.details.region_requirements_satisfied = False
90- self.view.show_app(self.app_mock)
91- do_events()
92- # ensure that the button is correct
93- self.assertEqual(
94- self.view.pkg_statusbar.button.get_label(), "Install Anyway")
95- # and again for purchase
96- self.app_mock.details.pkg_state = PkgStates.NEEDS_PURCHASE
97- self.view.show_app(self.app_mock)
98- self.assertEqual(
99- self.view.pkg_statusbar.button.get_label(),
100- _(u"Buy Anyway\u2026").encode("utf-8"))
101- # check if the warning bar is displayed
102- self.assertTrue(self.view.pkg_warningbar.get_property("visible"))
103- self.assertEqual(self.view.pkg_warningbar.label.get_text(),
104- REGION_WARNING_STRING)
105-
106-
107 class PurchasedAppDetailsStatusBarTestCase(unittest.TestCase):
108
109 @classmethod

Subscribers

People subscribed via source and target branches