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

Proposed by Michael Vogt on 2012-04-10
Status: Merged
Merged at revision: 2955
Proposed branch: lp:~mvo/software-center/lp977889
Merge into: lp:software-center
Diff against target: 37 lines (+9/-4)
1 file modified
softwarecenter/ui/gtk3/panes/availablepane.py (+9/-4)
To merge this branch: bzr merge lp:~mvo/software-center/lp977889
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-04-10 Approve on 2012-04-10
Review via email: mp+101389@code.launchpad.net

Description of the change

This fixes the disappearing sort combobox described in bug #977889. To reproduce:

1. search "foo"
2. click on "back"
3. click on "more" in "What's New" in the lobby view
4. click on back
5. search "bar"

with trunk the sort combo is no longer there, with this branch is should be there.

To post a comment you must log in.
Gary Lasker (gary-lasker) wrote :

Does the trick perfectly, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/panes/availablepane.py'
2--- softwarecenter/ui/gtk3/panes/availablepane.py 2012-03-30 09:46:20 +0000
3+++ softwarecenter/ui/gtk3/panes/availablepane.py 2012-04-10 15:01:24 +0000
4@@ -500,6 +500,13 @@
5 iconnames.append(self.db.get_iconname(doc))
6 self.backend.install_multiple(apps, iconnames)
7
8+ def _show_or_hide_search_combo_box(self, view_state):
9+ # show/hide the sort combobox headers if the category forces a
10+ # custom sort mode
11+ category = view_state.category
12+ allow_user_sort = category is None or not category.is_forced_sort_mode
13+ self.app_view.set_allow_user_sorting(allow_user_sort)
14+
15 def set_state(self, nav_item):
16 pass
17
18@@ -603,6 +610,7 @@
19
20 header_strings = self._get_header_for_view_state(view_state)
21 self.app_view.set_header_labels(*header_strings)
22+ self._show_or_hide_search_combo_box(view_state)
23
24 self.app_view.vadj = view_state.vadjustment
25
26@@ -631,10 +639,7 @@
27
28 header_strings = self._get_header_for_view_state(view_state)
29 self.app_view.set_header_labels(*header_strings)
30- # hide the sort combobox headers if the category forces a
31- # custom sort mode
32- allow_user_sort = category is None or not category.is_forced_sort_mode
33- self.app_view.set_allow_user_sorting(allow_user_sort)
34+ self._show_or_hide_search_combo_box(view_state)
35
36 if view_state.search_term:
37 self._clear_search()

Subscribers

People subscribed via source and target branches