Merge lp:~gary-lasker/software-center/fix-crash-lp961198 into lp:software-center

Proposed by Gary Lasker on 2012-03-23
Status: Merged
Merged at revision: 2911
Proposed branch: lp:~gary-lasker/software-center/fix-crash-lp961198
Merge into: lp:software-center
Diff against target: 24 lines (+7/-0)
1 file modified
softwarecenter/ui/gtk3/app.py (+7/-0)
To merge this branch: bzr merge lp:~gary-lasker/software-center/fix-crash-lp961198
Reviewer Review Type Date Requested Status
Michael Vogt 2012-03-23 Approve on 2012-03-23
Review via email: mp+98956@code.launchpad.net

Description of the change

Here's a better fix for this crasher, following one of mvo's suggestions in my previous MP for this bug. Just added a couple of lines to disable the recommendations opt-in menu item until the UI is actually ready for it.

Thanks again!

To post a comment you must log in.
Michael Vogt (mvo) wrote :

Thanks for this fix, its fine and I merged it, but I added a comment and changed:
+ recommendations_menuitem = self.builder.get_object(
+ "menuitem_recommendations")
+ recommendations_menuitem.set_sensitive(True)

to

+ self.menuitem_recommendations.set_sensitive(True)

because the SimpleGtkbuilderApp that we use will make all widgets available with their names
as attributes of the application, so the call to self.builder is not really needed (will also
do no harm)

review: Approve
Michael Vogt (mvo) wrote :

I noticed that surrounding code is using a lot of the self.builder.get_object() I'm not sure why
this is the case, maybe older gtk version did not support the menu items as Gtk.Buildable. I will
submit a seperate branch with cleanup for this.

Gary Lasker (gary-lasker) wrote :

Thanks Michael, that is much nicer indeed! I forgot that app.py is actually just a SimpleGtkbuilderApp.

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-03-21 13:48:36 +0000
3+++ softwarecenter/ui/gtk3/app.py 2012-03-23 02:09:20 +0000
4@@ -383,6 +383,10 @@
5 "menuitem_view_supported_only")
6 supported_menuitem.set_label(self.distro.get_supported_filter_name())
7 file_menu = self.builder.get_object("menu1")
8+
9+ recommendations_menuitem = self.builder.get_object(
10+ "menuitem_recommendations")
11+ recommendations_menuitem.set_sensitive(False)
12
13 if not self.distro.DEVELOPER_URL:
14 help_menu = self.builder.get_object("menu_help")
15@@ -517,6 +521,9 @@
16 self.available_pane.cat_view.recommended_for_you_panel.connect(
17 "recommendations-opt-out",
18 self._on_recommendations_opt_out)
19+ recommendations_menuitem = self.builder.get_object(
20+ "menuitem_recommendations")
21+ recommendations_menuitem.set_sensitive(True)
22
23 #~ def on_installed_pane_created(self, widget):
24 #~ pass

Subscribers

People subscribed via source and target branches