Merge lp:~gary-lasker/software-center/hide_nonapps_pkgs_xapian into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 838
Proposed branch: lp:~gary-lasker/software-center/hide_nonapps_pkgs_xapian
Merge into: lp:software-center
Diff against target: 79 lines (+29/-3)
4 files modified
debian/changelog (+10/-0)
softwarecenter/view/appview.py (+3/-0)
softwarecenter/view/availablepane.py (+7/-3)
softwarecenter/view/channelpane.py (+9/-0)
To merge this branch: bzr merge lp:~gary-lasker/software-center/hide_nonapps_pkgs_xapian
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+27225@code.launchpad.net

Description of the change

Heya Michael,

Here's a branch that implements your suggestion to set the model to None on a refresh_apps as a fix for the visual glitch when (for instance) navigating to Developer Tools->Libraries (and the resulting extra .6 second delay when showing the non-app packages).

I found however that if I just implemented the model = None technique generally it introduced an ugly flash on those list view updates that are normally very clean and fast, including when selecting PPAs with very few packages in them and on every search update. You can see this effect if you try this branch at revision 836.

So I fine-tuned the effect to only come into play for the views where it actually helps, and to be skipped for those other cases where it made things worse. That's what you'll see at the latest revision.

Note that I agree it's not pretty to directly check the channel component string "partner". Really, I think that's just a reminder that I need to get my partner-fixmes branch updated and finalized.

Please let me know what you think. Thanks!
Gary

To post a comment you must log in.
839. By Gary Lasker

merge with trunk

840. By Gary Lasker

add changelog entry

841. By Gary Lasker

    a large number of items (LP: #592296)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-06-10 10:07:26 +0000
3+++ debian/changelog 2010-06-10 15:28:29 +0000
4@@ -1,3 +1,13 @@
5+software-center (2.1.3) UNRELEASED; urgency=low
6+
7+ * softwarecenter/view/appview.py,
8+ softwarecenter/view/availablepane.py,
9+ softwarecenter/view/channelpane.py:
10+ - fix visual glitch when updating a list view that contains
11+ a large number of items (LP: #592296)
12+
13+ -- Gary Lasker <gary.lasker@canonical.com> Thu, 10 Jun 2010 11:25:22 -0400
14+
15 software-center (2.1.2) maverick; urgency=low
16
17 [ Gary Lasker ]
18
19=== modified file 'softwarecenter/view/appview.py'
20--- softwarecenter/view/appview.py 2010-06-09 13:07:17 +0000
21+++ softwarecenter/view/appview.py 2010-06-10 15:28:29 +0000
22@@ -1186,6 +1186,9 @@
23 if abs(len(new_model)-len(model)) > AppStore.DEFAULT_SEARCH_LIMIT:
24 return super(AppView, self).set_model(new_model)
25 return model.update(new_model)
26+
27+ def clear_model(self):
28+ self.set_model(None)
29
30 def is_action_in_progress_for_selected_app(self):
31 """
32
33=== modified file 'softwarecenter/view/availablepane.py'
34--- softwarecenter/view/availablepane.py 2010-06-09 13:07:17 +0000
35+++ softwarecenter/view/availablepane.py 2010-06-10 15:28:29 +0000
36@@ -209,9 +209,6 @@
37 def refresh_apps(self):
38 """refresh the applist and update the navigation bar
39 """
40- #import traceback
41- #print "refresh_apps"
42- #print traceback.print_stack()
43 logging.debug("refresh_apps")
44 # mvo: its important to fist show the subcategories and then
45 # the new model, otherwise we run into visual lack
46@@ -226,6 +223,13 @@
47 logging.debug("availablepane query: %s" % query)
48
49 old_model = self.app_view.get_model()
50+
51+ # if a search is not in progress, clear the current model to
52+ # display an empty list while the full list is generated; this
53+ # prevents a visual glitch when a list is replaced
54+ if not self.apps_search_term:
55+ self.app_view.clear_model()
56+
57 if old_model is not None:
58 # *ugh* deactivate the old model because otherwise it keeps
59 # getting progress_changed events and eats CPU time until its
60
61=== modified file 'softwarecenter/view/channelpane.py'
62--- softwarecenter/view/channelpane.py 2010-06-09 14:34:01 +0000
63+++ softwarecenter/view/channelpane.py 2010-06-10 15:28:29 +0000
64@@ -101,6 +101,15 @@
65 # getting progress_changed events and eats CPU time until its
66 # garbage collected
67 old_model = self.app_view.get_model()
68+
69+ # if the list is expected to contain many items, clear the current model to display
70+ # an empty list while the full list is generated; this prevents a visual glitch when
71+ # the list is replaced
72+ if ((self.channel.get_channel_name() == self.distro.get_distro_channel_name() and
73+ self.channel.get_channel_component() != "partner") and
74+ not self.search_terms):
75+ self.app_view.clear_model()
76+
77 if old_model is not None:
78 old_model.active = False
79 while gtk.events_pending():

Subscribers

People subscribed via source and target branches