[Glade-users] Importing an old .glade file



Damon Chaplin ?rta:
On Mon, 2005-08-01 at 20:20 +0200, Zoltan Boszormenyi wrote:

Hi,

I have to resume maintaining an old GTK-1.2 software,
which is huuuge. Last time I updated it was to recompile it
for RedHat 9, changing it to UTF-8 from ISO-8859-2.
Now I have to upgrade it to GTK-2.x. Is there a way to import
the .glade file from that project and export it in a newer format?
Simply opening it in glade-2.6 doesn't work.


The FAQ covers this a bit:

1.5 How do I port a GTK+ 1.2 or GNOME 1.4 project to GTK+/GNOME 2.0.

libglade includes a script called libglade-convert which will convert an
old GTK+ 1.2 or GNOME 1.4 Glade XML file to the new GTK+/GNOME 2.0
format.

However, for GTK+ applications there is currently a slight problem with
this.
You need to:
  (1) Convert the XML file with libglade-convert.
  (2) Open the new file in Glade and save it immediately. This will
create
      the project options file with the same name as the XML file but
with
      a 'p' on the end.
  (3) Add '<gnome_support>FALSE</gnome_support>'
      to the project options file, so Glade knows it is a GTK+ project.


Damon

Thanks for the answer, I just had the time to try it.
The software was actually for GNOME-1.2/1.4, not plain GTK+-1.2.
Converting the .glade file gave me this:

$ libglade-convert --verbose myproject.glade
Fixing app1 up as GnomeApp
Fixing app1 up as GtkWindow
Fixing dock1 up as BonoboDock
Fixing dockitem1 up as BonoboDockItem
Fixing menubar1 up as GtkMenuBar
Fixing file1 up as GtkMenuItem
Fixing file1_menu up as GtkMenu
Fixing exit1 up as GtkImageMenuItem
Fixing exit1 up as GtkMenuItem
Fixing Traceback (most recent call last):
   File "/usr/bin/libglade-convert", line 1201, in ?
     main()
   File "/usr/bin/libglade-convert", line 1198, in main
     handle_file(args[0])
   File "/usr/bin/libglade-convert", line 1160, in handle_file
     fixup_widget(widgetdef)
   File "/usr/bin/libglade-convert", line 428, in fixup_widget
     fixup_widget(childdef.widget)
   File "/usr/bin/libglade-convert", line 428, in fixup_widget
     fixup_widget(childdef.widget)
   File "/usr/bin/libglade-convert", line 428, in fixup_widget
     fixup_widget(childdef.widget)
   File "/usr/bin/libglade-convert", line 428, in fixup_widget
     fixup_widget(childdef.widget)
   File "/usr/bin/libglade-convert", line 424, in fixup_widget
     while (type and not fixup_as_type (widget, type)):
   File "/usr/bin/libglade-convert", line 600, in fixup_as_type
     print >> sys.stderr, 'Fixing', widget['name'], 'up as', type
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in 
position 9: ordinal not in range(128)

And it doesn't get converted. System is Fedora Core 3/x86-64.
glade2-2.6.0, libglade2-2.4.0.

All the project files, including the .glade file are in UTF-8,
they were run through "recode latin2..utf-8" during the upgrade
from RedHat 7.3 to RedHat 9, and glade-0.6.4 was happy with the file.
It still is, I just compiled glade-0.6.4-11 from FC2 on my FC3.
I converted my .glade file back to latin2 and libglade-convert dies
even earlier.

What can I try next to get my .glade file upgraded?

Best regards,
Zolt?n B?sz?rm?nyi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]