GNOME Bugzilla – Bug 316651
Saves invalid glade file (even for self)
Last modified: 2006-05-28 14:33:14 UTC
Distribution/Version: Debian unstable Frederic-Emmanuel PICCA <picca@synchrotron-soleil.fr> has reported a bug on the Debian BTS (http://bugs.debian.org/311283) about gazpacho not being able to open a glade file. At the latest version gazpacho is able to load the file but if you save it the file will contain errors. Download the attachment he sent on his bug report, open it on gazpacho, 'save as' it and try to load it with gazpacho or use it with libglade. Gazpacho will display a message saying 'project could not be loaded' because of parse errors. These messages are displayed when saving: /usr/lib/python2.3/site-packages/gazpacho/properties.py:486: GtkWarning: gtktreeview.c:1283: invalid property id 5 for "headers-clickable" of type `GParamBoolean' in `GtkTreeView' return gobj.get_property(cls.name) /usr/lib/python2.3/site-packages/gazpacho/properties.py:430: GtkWarning: gtktreeview.c:1283: invalid property id 5 for "headers-clickable" of type `GParamBoolean' in `GtkTreeView' self._value = self._object.get_property(self.name) /usr/lib/python2.3/site-packages/gazpacho/properties.py:477: GtkWarning: gtktreeview.c:1283: invalid property id 5 for "headers-clickable" of type `GParamBoolean' in `GtkTreeView' return self._object.get_property(self.name) The thing on the glade file which caught my attention quickly was this: <widget class="GtkEntry" id="entry_h"> <property name="text" context="yes" translatable="yes">Project-Id-Version: Gazpacho 0.5 Report-Msgid-Bugs-To: POT-Creation-Date: 2005-02-04 15:32+0100 PO-Revision-Date: 2005-07-02 10:02+0200 Last-Translator: Henrique Romano <henrique@async.com.br> Language-Team: Brazilian portuguese <henrique@async.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit </property> I believe there's something really bad here... I tried running gazpacho with other locales like en_US.UTF-8 and C but the toolbar kept coming in pt_BR and this problem remained. If I can have some more info gathered for you, please let me know which =).
After some investigation it looks like the problem is the construtor for 'menubar1' not being found; I noticed this is the message used in the exception that is raised: constructor menubar1 for object initial-state could not be found I could not find a way of getting this message without manually editing the code and doing a print e when the exception is got at application.py; any hints for my next try? Anyway, that string looks wrong, I suggest to apply this: Index: loader.py =================================================================== --- loader.py (revisão 1791) +++ loader.py (cópia de trabalho) @@ -623,7 +623,7 @@ gobj = self._uimanager_construct(constructor, obj.id) else: raise ParseError("constructor %s for object %s could not " - "be found" % (obj.id, obj.constructor)) + "be found" % (obj.constructor, obj.id)) self._constructed_objects[gobj] = self._widgets[constructor] else: gobj = adapter.construct(obj.id, gtype, construct) Looks like it should be using UI Manager, and it correctly does this when creating a new glade file instead of reading one made by glade and resaving.
Few notes: 1) The glade file uses "old-style" menus, which Gazpacho does not support (there's a bug about converting them to the UIManager style, see bug #304372) 2) The original reporter is trying to load the saved file with libglade(-python), which in turn does not support the UIManager stuff (the menu bar located in the original will be saved as UIManager object and Actions). 3) the headers-clickable error is known, and even fixed in trunk (by disbaling the property at least for now). 4) The patch is valid, I've noticed the reversed arguments too.
I committed the patch. The rest is handled in other bugs.