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 652673 - Project versions are ignored
Project versions are ignored
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
3.10.x
Other Linux
: Normal major
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-15 18:14 UTC by nathanael
Modified: 2011-09-19 20:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (20.04 KB, patch)
2011-07-06 21:48 UTC, Juan Pablo Ugarte
none Details | Review
Proposed patch 2nd try (23.23 KB, patch)
2011-07-08 18:01 UTC, Juan Pablo Ugarte
none Details | Review
Proposed patch 3rd try (30.96 KB, patch)
2011-07-11 21:10 UTC, Juan Pablo Ugarte
none Details | Review

Description nathanael 2011-06-15 18:14:53 UTC
I have a project that I was building an GTK app with. Using 3.7.1. The project targets gtk 2.24. Opening in glade 3.10 is fine, however now when I try to add either a vertical or horizontal box, it adds it to the glade file as GtkBox which is an abstract type so loading with GtkBuilder fails. Similarly it also creates GtkGrids which I don't know if they exist in the version of GTK I'm targetting. This makes editing the project a pain as I have to manually edit the xml afterwards to test it out. The 'check regressions' never has any issues with anything regardless of how low I set the target version.
Comment 1 garrett.mitchener 2011-06-27 16:53:55 UTC
I can confirm this: If you create a new project and specify that it should target GTK 2.24, the resulting GtkBuilder file refers to GtkBox objects with an orientation option, instead of GtkHBox or GtkVBox objects.
Comment 2 Juan Pablo Ugarte 2011-06-29 15:38:58 UTC
Hi guys, glade 3.10 only targets gtk3, the problem here is that it should change version and notify the user.
Comment 3 nathanael 2011-06-29 19:41:35 UTC
If that is the case you should also remove the project version options dialogue as its somewhat confusing.
Comment 4 Juan Pablo Ugarte 2011-07-06 21:48:02 UTC
Created attachment 191428 [details] [review]
Proposed patch

This patch makes glade change gtk target to 3.0 and warns the user if there are any unknown (deprecated) objects, it also replaces them with a stub to make it even more noticeable.
Comment 5 Tristan Van Berkom 2011-07-07 01:22:38 UTC
Hi Juan,
  This widget stub that you are adding, is it a good starting point at
least for fixing bug 376628 ? Does your fix possibly implicitly fix
the other old bug ? (sounds close)
Comment 6 Juan Pablo Ugarte 2011-07-08 03:43:16 UTC
Hey, I forgot about that bug, it does not, but its would be a perfect fit to extend GladeObjectStub to keep a copy of the xml nodes and dump it on write.

The write could be implemented in glade_widget_write() or in a GladeObjectStub adaptor class (as long as we can override the class name from the write_widget method which i think we can)
Comment 7 Juan Pablo Ugarte 2011-07-08 18:01:59 UTC
Created attachment 191529 [details] [review]
Proposed patch 2nd try

This patch makes GladeObjecStub remember uknown xml nodes
(fixes bug #376628)
Comment 8 Tristan Van Berkom 2011-07-08 22:20:57 UTC
Review of attachment 191529 [details] [review]:

Very nice all around to finally nail the other bug.

So some comments:

  - Never use a GET_PRIVATE() macro in the code as specially since
    it's a new object, instead create a ->priv pointer and call
    G_TYPE_INSTANCE_GET_PRIVATE() once in glade_object_stub_init().

  - There are typos, you mention "Unknow" where presumably you mean "Unknown".

  - Have you tested this with some older files or new files with missing
    plugins ?

    It should load and save and ideally not create a diff (however that's
    only possible now if the file was created with 3.10 using gtksourceview catalog
    and then loaded again in 3.10 without the sourceview catalog available,
    this scenario particularly should load and save with no diff).

  - Some things should be prohibited on these widgets, for instance you cannot
    copy or cut them but you can delete them (I don't think we want to let the
    user manipulate types Glade does not know, it should be enough to just
    not lose them).

I think that's all actually.
Comment 9 Juan Pablo Ugarte 2011-07-11 21:10:52 UTC
Created attachment 191757 [details] [review]
Proposed patch 3rd try

Patch includes fixes and also makes glade project remember unknown required libs and disables cut and copy for stubs objects.
Comment 10 Juan Pablo Ugarte 2011-09-19 20:26:29 UTC
Patch applied in master