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
=== modified file 'debian/changelog'
--- debian/changelog 2010-06-10 10:07:26 +0000
+++ debian/changelog 2010-06-10 15:28:29 +0000
@@ -1,3 +1,13 @@
1software-center (2.1.3) UNRELEASED; urgency=low
2
3 * softwarecenter/view/appview.py,
4 softwarecenter/view/availablepane.py,
5 softwarecenter/view/channelpane.py:
6 - fix visual glitch when updating a list view that contains
7 a large number of items (LP: #592296)
8
9 -- Gary Lasker <gary.lasker@canonical.com> Thu, 10 Jun 2010 11:25:22 -0400
10
1software-center (2.1.2) maverick; urgency=low11software-center (2.1.2) maverick; urgency=low
212
3 [ Gary Lasker ]13 [ Gary Lasker ]
414
=== modified file 'softwarecenter/view/appview.py'
--- softwarecenter/view/appview.py 2010-06-09 13:07:17 +0000
+++ softwarecenter/view/appview.py 2010-06-10 15:28:29 +0000
@@ -1186,6 +1186,9 @@
1186 if abs(len(new_model)-len(model)) > AppStore.DEFAULT_SEARCH_LIMIT:1186 if abs(len(new_model)-len(model)) > AppStore.DEFAULT_SEARCH_LIMIT:
1187 return super(AppView, self).set_model(new_model)1187 return super(AppView, self).set_model(new_model)
1188 return model.update(new_model)1188 return model.update(new_model)
1189
1190 def clear_model(self):
1191 self.set_model(None)
11891192
1190 def is_action_in_progress_for_selected_app(self):1193 def is_action_in_progress_for_selected_app(self):
1191 """1194 """
11921195
=== modified file 'softwarecenter/view/availablepane.py'
--- softwarecenter/view/availablepane.py 2010-06-09 13:07:17 +0000
+++ softwarecenter/view/availablepane.py 2010-06-10 15:28:29 +0000
@@ -209,9 +209,6 @@
209 def refresh_apps(self):209 def refresh_apps(self):
210 """refresh the applist and update the navigation bar210 """refresh the applist and update the navigation bar
211 """211 """
212 #import traceback
213 #print "refresh_apps"
214 #print traceback.print_stack()
215 logging.debug("refresh_apps")212 logging.debug("refresh_apps")
216 # mvo: its important to fist show the subcategories and then213 # mvo: its important to fist show the subcategories and then
217 # the new model, otherwise we run into visual lack214 # the new model, otherwise we run into visual lack
@@ -226,6 +223,13 @@
226 logging.debug("availablepane query: %s" % query)223 logging.debug("availablepane query: %s" % query)
227224
228 old_model = self.app_view.get_model()225 old_model = self.app_view.get_model()
226
227 # if a search is not in progress, clear the current model to
228 # display an empty list while the full list is generated; this
229 # prevents a visual glitch when a list is replaced
230 if not self.apps_search_term:
231 self.app_view.clear_model()
232
229 if old_model is not None:233 if old_model is not None:
230 # *ugh* deactivate the old model because otherwise it keeps234 # *ugh* deactivate the old model because otherwise it keeps
231 # getting progress_changed events and eats CPU time until its235 # getting progress_changed events and eats CPU time until its
232236
=== modified file 'softwarecenter/view/channelpane.py'
--- softwarecenter/view/channelpane.py 2010-06-09 14:34:01 +0000
+++ softwarecenter/view/channelpane.py 2010-06-10 15:28:29 +0000
@@ -101,6 +101,15 @@
101 # getting progress_changed events and eats CPU time until its101 # getting progress_changed events and eats CPU time until its
102 # garbage collected102 # garbage collected
103 old_model = self.app_view.get_model()103 old_model = self.app_view.get_model()
104
105 # if the list is expected to contain many items, clear the current model to display
106 # an empty list while the full list is generated; this prevents a visual glitch when
107 # the list is replaced
108 if ((self.channel.get_channel_name() == self.distro.get_distro_channel_name() and
109 self.channel.get_channel_component() != "partner") and
110 not self.search_terms):
111 self.app_view.clear_model()
112
104 if old_model is not None:113 if old_model is not None:
105 old_model.active = False114 old_model.active = False
106 while gtk.events_pending():115 while gtk.events_pending():

Subscribers

People subscribed via source and target branches