Merge lp:~mvo/software-center/pygi-properties-fixes into lp:software-center

Proposed by Michael Vogt on 2012-04-10
Status: Merged
Merged at revision: 2953
Proposed branch: lp:~mvo/software-center/pygi-properties-fixes
Merge into: lp:software-center
Diff against target: 35 lines (+14/-9)
1 file modified
softwarecenter/ui/gtk3/widgets/cellrenderers.py (+14/-9)
To merge this branch: bzr merge lp:~mvo/software-center/pygi-properties-fixes
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-04-10 Approve on 2012-04-10
Review via email: mp+101354@code.launchpad.net

Description of the change

This changes the code from using __gproperties__ to "GObject.Property()" to install gobject properties.

The former use seems to be no longer supported with pygi. Fortunately we only use this in the cellrenderers.py
code so the change is small.

It also includes a tiny drive-by fix to init CellRendererAppView() with Gtk.CellRendererText instead of just
the generic GObject.

To post a comment you must log in.
Gary Lasker (gary-lasker) wrote :

Looks fine to me! Thanks, mvo. :)

Gary Lasker (gary-lasker) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/widgets/cellrenderers.py'
2--- softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-03-22 23:05:26 +0000
3+++ softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-04-10 10:43:22 +0000
4@@ -44,17 +44,22 @@
5 MAX_STARS = 5
6 STAR_SIZE = EM
7
8- __gproperties__ = {
9- 'application': (GObject.TYPE_PYOBJECT, 'document',
10- 'a xapian document containing pkg information',
11- GObject.PARAM_READWRITE),
12-
13- 'isactive': (bool, 'isactive', 'is cell active/selected', False,
14- GObject.PARAM_READWRITE),
15- }
16+ # initialize declared properties (LP: #965937)
17+ application = GObject.Property(
18+ type=GObject.TYPE_PYOBJECT,
19+ nick='document',
20+ blurb='a xapian document containing pkg information',
21+ flags=GObject.PARAM_READWRITE|GObject.PARAM_CONSTRUCT,
22+ default=None)
23+ isactive = GObject.Property(
24+ type=bool,
25+ nick='isactive',
26+ blurb='is cell active/selected',
27+ flags=GObject.PARAM_READWRITE|GObject.PARAM_CONSTRUCT,
28+ default=False)
29
30 def __init__(self, icons, layout, show_ratings, overlay_icon_name):
31- GObject.GObject.__init__(self)
32+ Gtk.CellRendererText.__init__(self)
33
34 # the icon pixbuf to be displayed in the row
35 self.icon = None

Subscribers

People subscribed via source and target branches