GNOME Bugzilla – Bug 652673
Project versions are ignored
Last modified: 2011-09-19 20:26:29 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.
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.
Hi guys, glade 3.10 only targets gtk3, the problem here is that it should change version and notify the user.
If that is the case you should also remove the project version options dialogue as its somewhat confusing.
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.
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)
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)
Created attachment 191529 [details] [review] Proposed patch 2nd try This patch makes GladeObjecStub remember uknown xml nodes (fixes bug #376628)
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.
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.
Patch applied in master