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

Proposed by Michael Vogt
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) Approve
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.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Looks fine to me! Thanks, mvo. :)

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/widgets/cellrenderers.py'
--- softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-03-22 23:05:26 +0000
+++ softwarecenter/ui/gtk3/widgets/cellrenderers.py 2012-04-10 10:43:22 +0000
@@ -44,17 +44,22 @@
44 MAX_STARS = 544 MAX_STARS = 5
45 STAR_SIZE = EM45 STAR_SIZE = EM
4646
47 __gproperties__ = {47 # initialize declared properties (LP: #965937)
48 'application': (GObject.TYPE_PYOBJECT, 'document',48 application = GObject.Property(
49 'a xapian document containing pkg information',49 type=GObject.TYPE_PYOBJECT,
50 GObject.PARAM_READWRITE),50 nick='document',
5151 blurb='a xapian document containing pkg information',
52 'isactive': (bool, 'isactive', 'is cell active/selected', False,52 flags=GObject.PARAM_READWRITE|GObject.PARAM_CONSTRUCT,
53 GObject.PARAM_READWRITE),53 default=None)
54 }54 isactive = GObject.Property(
55 type=bool,
56 nick='isactive',
57 blurb='is cell active/selected',
58 flags=GObject.PARAM_READWRITE|GObject.PARAM_CONSTRUCT,
59 default=False)
5560
56 def __init__(self, icons, layout, show_ratings, overlay_icon_name):61 def __init__(self, icons, layout, show_ratings, overlay_icon_name):
57 GObject.GObject.__init__(self)62 Gtk.CellRendererText.__init__(self)
5863
59 # the icon pixbuf to be displayed in the row64 # the icon pixbuf to be displayed in the row
60 self.icon = None65 self.icon = None

Subscribers

People subscribed via source and target branches