Merge lp:~gary-lasker/software-center/toolbar-buttons-insensitive-during-startup into lp:software-center/5.2

Proposed by Gary Lasker
Status: Merged
Merged at revision: 3017
Proposed branch: lp:~gary-lasker/software-center/toolbar-buttons-insensitive-during-startup
Merge into: lp:software-center/5.2
Diff against target: 27 lines (+6/-5)
1 file modified
softwarecenter/ui/gtk3/app.py (+6/-5)
To merge this branch: bzr merge lp:~gary-lasker/software-center/toolbar-buttons-insensitive-during-startup
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Gary Lasker (community) Needs Resubmitting
Review via email: mp+105765@code.launchpad.net

Description of the change

This branch contains a fix for crasher bug 999486 and bug 994341, both of which are caused by clicking on toolbar buttons in the main lobby view before the UI has fully initialized (and the cache is ready).

Initially, I experimented with the @wait_for_apt_cache_ready decorator to fix bug 999486 (similar to the fix for bug 920196), but I found that this caused the lobby panels to be displayed blank for a short time after the spinner was hidden. Since both of these crashes are caused directly by clicks on the "All Software" button during startup, I decided that a better fix is to simply set the toolbar buttons insensitive for the duration of time that the lobby panels are initializing. It seems simple and sensible to me to do this anyway. Please let me know if you don't agree.

Thanks for your review!

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

Thanks, that looks fine.

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Unfortunately I need to revert this again as it breaks when running software-center with a argument like "software-center 2vcard" (or any other app/packagename). When run this way the toolbar stay insensitive and you can not click on any of the toolbar items.

Revision history for this message
Michael Vogt (mvo) wrote :

Hm, it appears its only a issue for installed software (e.g. software-center apt). When reverting this branch
it appears to work again. It needs to also make it sensitive once the installedpane is created.

review: Needs Fixing
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, I've pushed a fix for this in the branch. It fixes the case that you mentioned. Please take a look when you get a chance and meanwhile I will keep testing this for every corner case that I can think of.

review: Needs Resubmitting
3008. By Gary Lasker

fix regression where the toolbar buttons are not re-enabled when launching with an argument pointing at an installed package, e.g. software-center apt

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Just fyi, also works fine now for apt urls and standalone debs.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, looks good, one pep8 issue, but I will fix that during the merge

review: Approve
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Yes, my apologies for that! I noticed it and uploaded the fix in the 5.2 branch, but we probably overlapped.

Thanks again, Michael!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/app.py'
--- softwarecenter/ui/gtk3/app.py 2012-05-15 16:53:24 +0000
+++ softwarecenter/ui/gtk3/app.py 2012-05-15 17:41:19 +0000
@@ -296,8 +296,8 @@
296 self.distro,296 self.distro,
297 self.icons,297 self.icons,
298 self.datadir)298 self.datadir)
299 #~ self.installed_pane.connect("installed-pane-created",299 self.installed_pane.connect("installed-pane-created",
300 #~ self.on_installed_pane_created)300 self.on_installed_pane_created)
301 self.view_manager.register(self.installed_pane,301 self.view_manager.register(self.installed_pane,
302 ViewPages.INSTALLED)302 ViewPages.INSTALLED)
303303
@@ -487,9 +487,10 @@
487 # set the main toolbar buttons sensitive487 # set the main toolbar buttons sensitive
488 self.global_pane.view_switcher.set_sensitive(True)488 self.global_pane.view_switcher.set_sensitive(True)
489489
490 #~ def on_installed_pane_created(self, widget):490 def on_installed_pane_created(self, widget):
491 #~ pass491 # set the main toolbar buttons sensitive
492492 self.global_pane.view_switcher.set_sensitive(True)
493
493 def _on_recommendations_opt_in(self, rec_panel):494 def _on_recommendations_opt_in(self, rec_panel):
494 self._update_recommendations_menuitem(opted_in=True)495 self._update_recommendations_menuitem(opted_in=True)
495496

Subscribers

People subscribed via source and target branches