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

Proposed by Gary Lasker on 2012-05-15
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 2012-05-15 Approve on 2012-05-15
Gary Lasker (community) Resubmit on 2012-05-15
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.
Michael Vogt (mvo) wrote :

Thanks, that looks fine.

review: Approve
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.

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
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: Resubmit
3008. By Gary Lasker on 2012-05-15

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

Gary Lasker (gary-lasker) wrote :

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

Michael Vogt (mvo) wrote :

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

review: Approve
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
1=== modified file 'softwarecenter/ui/gtk3/app.py'
2--- softwarecenter/ui/gtk3/app.py 2012-05-15 16:53:24 +0000
3+++ softwarecenter/ui/gtk3/app.py 2012-05-15 17:41:19 +0000
4@@ -296,8 +296,8 @@
5 self.distro,
6 self.icons,
7 self.datadir)
8- #~ self.installed_pane.connect("installed-pane-created",
9- #~ self.on_installed_pane_created)
10+ self.installed_pane.connect("installed-pane-created",
11+ self.on_installed_pane_created)
12 self.view_manager.register(self.installed_pane,
13 ViewPages.INSTALLED)
14
15@@ -487,9 +487,10 @@
16 # set the main toolbar buttons sensitive
17 self.global_pane.view_switcher.set_sensitive(True)
18
19- #~ def on_installed_pane_created(self, widget):
20- #~ pass
21-
22+ def on_installed_pane_created(self, widget):
23+ # set the main toolbar buttons sensitive
24+ self.global_pane.view_switcher.set_sensitive(True)
25+
26 def _on_recommendations_opt_in(self, rec_panel):
27 self._update_recommendations_menuitem(opted_in=True)
28

Subscribers

People subscribed via source and target branches