Merge lp:~gary-lasker/software-center/installed-pane-refresh into lp:software-center

Proposed by Gary Lasker
Status: Merged
Merged at revision: 2926
Proposed branch: lp:~gary-lasker/software-center/installed-pane-refresh
Merge into: lp:software-center
Diff against target: 49 lines (+18/-4)
1 file modified
softwarecenter/ui/gtk3/panes/installedpane.py (+18/-4)
To merge this branch: bzr merge lp:~gary-lasker/software-center/installed-pane-refresh
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+99641@code.launchpad.net

Description of the change

This branch implements a simple, low-risk fix to the quite annoying usability issue of the installed view pane refreshing every time that it is displayed, whether or not its contents have changed. Any expanded treeview categories are reset each time, and the user's place in the list is lost as well. Please take a look at corresponding bug 828887 for details, including steps to reproduce.

With this change, we only refresh the view when the contents have actually changed due to one of either 1. a different channel being selected, or 2. when the pane content itself has been refreshed (e.g., when an item is installed or removed).

All unit tests pass and I did a fair bit of additional testing of the application in use and was unable to find any regression or unwanted side effects.

Note that there is still room for improvement in the installed pane refreshing. Particularly, when there is a refresh on the view due to an install or removal, the entire treeview collapses again. This is annoying, but is far less often a use case than the one addressed by this fix (that is, simple navaigating between views).

Many thanks in advance for your review!

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, that looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/panes/installedpane.py'
--- softwarecenter/ui/gtk3/panes/installedpane.py 2012-03-15 01:00:27 +0000
+++ softwarecenter/ui/gtk3/panes/installedpane.py 2012-03-27 23:12:21 +0000
@@ -226,6 +226,9 @@
226226
227 self.hide_appview_spinner()227 self.hide_appview_spinner()
228228
229 # keep track of the current view by tracking its origin
230 self.current_displayed_origin = None
231
229 # now we are initialized232 # now we are initialized
230 self.emit("installed-pane-created")233 self.emit("installed-pane-created")
231234
@@ -655,11 +658,19 @@
655 if self.state.search_term:658 if self.state.search_term:
656 self._search()659 self._search()
657 self._build_oneconfview()660 self._build_oneconfview()
658 else:661 elif (view_state and
662 view_state.channel and
663 view_state.channel.origin is not self.current_displayed_origin):
664 # we don't need to refresh the full installed view every time it
665 # is displayed, so we check to see if we are viewing the same
666 # channel and if so we don't refresh the view, note that the view
667 # *is* is refreshed whenever the contents change and this is
668 # sufficient (see LP: #828887)
659 self._build_categorised_installedview()669 self._build_categorised_installedview()
670 self.current_displayed_origin = view_state.channel.origin
660671
661 if self.state.search_term:672 if self.state.search_term:
662 self._search(self.state.search_term)673 self._search(self.state.search_term)
663 return True674 return True
664675
665 def get_current_app(self):676 def get_current_app(self):
@@ -709,8 +720,11 @@
709 w.init_view()720 w.init_view()
710721
711 from softwarecenter.backend.channel import AllInstalledChannel722 from softwarecenter.backend.channel import AllInstalledChannel
723 from softwarecenter.ui.gtk3.panes.softwarepane import DisplayState
712 w.state.channel = AllInstalledChannel()724 w.state.channel = AllInstalledChannel()
713 w.display_overview_page(None, None)725 view_state = DisplayState()
726 view_state.channel = AllInstalledChannel()
727 w.display_overview_page(None, view_state)
714728
715 win.show()729 win.show()
716 return win730 return win

Subscribers

People subscribed via source and target branches