After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672158 - Correct the Gtk.Window hiearchy
Correct the Gtk.Window hiearchy
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-15 15:56 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2012-03-16 09:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Correct the Gtk.Window hiearchy (7.63 KB, patch)
2012-03-15 15:56 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
Correct the Gtk.Window hiearchy (11.31 KB, patch)
2012-03-15 17:03 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review

Description Johan (not receiving bugmail) Dahlin 2012-03-15 15:56:53 UTC
Make sure that all Dialog subclasses are also Window subclasses,
otherwise isinstance breaks.

Avoid calling the constructor twice now when we actually have a Window
constructor. The arguments passed to the parent are just GObject properties.
Comment 1 Johan (not receiving bugmail) Dahlin 2012-03-15 15:56:55 UTC
Created attachment 209848 [details] [review]
Correct the Gtk.Window hiearchy
Comment 2 Johan (not receiving bugmail) Dahlin 2012-03-15 17:03:21 UTC
Created attachment 209861 [details] [review]
Correct the Gtk.Window hiearchy

We need to make sure that all Gtk.Dialog subclasses inherit from
the overridden Window class. For that to be done automaticly we need
to create the Window class before the Dialog class.

Now when it's inherited properly we need to avoid calling the Window
constructor twice as it passes in a construct-only parameter. So add
**kwargs to the Window constructor to allow us to pass in any kind
of GObject property to it and refactor the Dialog subclasses to pass
in all properties to the same constructor.

Also adds a bunch of tests to make sure that the hiearchy is correct.
Comment 3 Paolo Borelli 2012-03-15 19:54:49 UTC
Review of attachment 209861 [details] [review]:

I like this new patch a lot more, not only it fixes the issue and adds tests, but it also removes workarounds for some of the overrides.

I'd just suggest to add a comment near Window pointing out that the order of overrides matters
Comment 4 Martin Pitt 2012-03-16 09:01:53 UTC
Comment on attachment 209861 [details] [review]
Correct the Gtk.Window hiearchy

I unfuzzed this to apply to current git head, added the comment suggested by Paolo, and fixed the typo in the changelog.

Pushed now, so that make check works again.

Thanks for fixing this!