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 530740 - Use GtkBuilder instead of libglade
Use GtkBuilder instead of libglade
Status: RESOLVED FIXED
Product: anjuta
Classification: Applications
Component: unknown
SVN TRUNK
Other Linux
: Normal normal
: ---
Assigned To: Anjuta maintainers
Anjuta maintainers
Depends on: 530748
Blocks: 572883
 
 
Reported: 2008-04-30 14:48 UTC by Jaap A. Haitsma
Modified: 2009-07-26 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for this bug (657.97 KB, patch)
2009-04-11 11:35 UTC, Maxim Ermilov
none Details | Review
corrected patch (661.00 KB, patch)
2009-04-11 16:00 UTC, Maxim Ermilov
none Details | Review
patch for this bug (1MB) (978.98 KB, patch)
2009-04-19 19:34 UTC, Maxim Ermilov
none Details | Review
corrected patch (.tgz) (121.13 KB, application/x-compressed-tar)
2009-04-23 16:15 UTC, Maxim Ermilov
  Details
patch for this bug (200.54 KB, patch)
2009-05-20 21:23 UTC, Maxim Ermilov
committed Details | Review
patch for anjuta-extras (569.71 KB, patch)
2009-05-22 22:41 UTC, Maxim Ermilov
committed Details | Review
Migrate gtk wizard from libglade to GtkBuilder (5.99 KB, patch)
2009-07-12 15:18 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Migrate anjuta plugin wizard from libglade to GtkBuilder (10.45 KB, patch)
2009-07-12 16:30 UTC, Javier Jardón (IRC: jjardon)
accepted-commit_now Details | Review
Migrate gtk wizard from libglade to GtkBuilder v2 (5.99 KB, patch)
2009-07-12 16:59 UTC, Javier Jardón (IRC: jjardon)
accepted-commit_now Details | Review
Migrate gtkmm plugin wizard from libglade to GtkBuiler (6.67 KB, patch)
2009-07-12 17:00 UTC, Javier Jardón (IRC: jjardon)
accepted-commit_now Details | Review
Migrate anjuta vala plugin wizard from libglade to GtkBuiler (4.23 KB, patch)
2009-07-12 17:18 UTC, Javier Jardón (IRC: jjardon)
accepted-commit_now Details | Review

Description Jaap A. Haitsma 2008-04-30 14:48:17 UTC
libglade is deprecated. Migration instructions are overhere

http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkBuilder.html

glade3 in SVN trunk now also support GtkBuilder files.

The most common extension for builder files is .ui. Anjuta now uses these for UIManager files. Most other apps use <name>-ui.xml for these files.
Comment 1 Johannes Schmid 2008-04-30 14:58:00 UTC
Hmm, can't find that it is deprecated:

http://live.gnome.org/TwoPointTwentythree/Platform

We will adapt this some time in the future but currently glade3 trunk is not stable enough for general development and there is not much benefit in migrating now. We will try to get gio in place for this release which will be enough work. Maybe we can also get rid of libgnome though that could become very hard.
Comment 2 Jaap A. Haitsma 2008-04-30 15:43:44 UTC
With cheese we have both the glade file and the builder file in SVN. We use the glade file still with glade and then simply run gtk-builder-convert to produce the builder file.

I just saw that GtkBuilder actually misses some functions which would be really handy to have to make migration easy. 

glade_xml_get_widget_prefix
glade_get_widget_name


I filed bug 530748 for this.

Let's see if these functions get into gtk after that I can help with migration
Comment 3 Sébastien Granjoux 2009-01-24 11:46:57 UTC
I have used GtkBuilder in the project wizard plugin.

Converting the other plugins shouldn't be very difficult, but I think there is no urgency.
Comment 4 Tina Russell 2009-02-14 23:49:57 UTC
If I create a GtkBuilder UI in the Glade plugin and then save it (with a “.ui” extension), I now cannot open it again; Anjuta always wants to use the text editor if I open the file from the file manager. Perhaps this should be a separate bug, I don’t know. Anyway, though GTKBuilder support is still rudimentary, it seems silly to have it closed off entirely.
Comment 5 Johannes Schmid 2009-02-16 10:06:29 UTC
(In reply to comment #4)
> If I create a GtkBuilder UI in the Glade plugin and then save it (with a
> “.ui” extension), I now cannot open it again; Anjuta always wants to use
> the text editor if I open the file from the file manager. Perhaps this should
> be a separate bug, I don’t know. Anyway, though GTKBuilder support is still
> rudimentary, it seems silly to have it closed off entirely.
> 

Hmm, actually it works after assigning ui files to glade in Nautilus. The glade plugin claims to support application/x-designer as mime-type. Don't know exactly why it doesn't work from the beginning, probably a gio-issue.
Comment 6 Tina Russell 2009-02-23 23:22:04 UTC
I found the problem! There's something in the code that tells Anjuta to ignore the mimetype on files whose names end with ".ui", and assume they are XML files. I changed the assumed MIME type to "application/x-designer" and it worked, though I'd imagine removing the line would work better.

(Sorry, I don't remember where in the code it was... I should have brought this up sooner)
Comment 7 Johannes Schmid 2009-04-07 12:27:45 UTC
OK, this is now fixed for the sourceview plugin and the preference system. That means all plugins can be ported rather easy.
Comment 8 Maxim Ermilov 2009-04-11 11:35:39 UTC
Created attachment 132504 [details] [review]
patch for this bug

With this patch, this is fixed for: build-basic-autotools, class-gen, document-manager, file-manager, file-wizard, language-support-cpp-java, message-view, patch, project-import, search, symbol-db, terminal, run-program.
Comment 9 Maxim Ermilov 2009-04-11 16:00:27 UTC
Created attachment 132517 [details] [review]
corrected patch
Comment 10 Maxim Ermilov 2009-04-19 19:34:41 UTC
Created attachment 132915 [details] [review]
patch for this bug (1MB)

Port all plugin to GtkBuilder (except git, cvs-plugin)
Comment 11 Johannes Schmid 2009-04-19 21:24:31 UTC
Thanks a lot! The patch looks good but some things need to be adjusted:

- Please rename the GtkBuilder files into *.ui and rename the old *.ui files into *.xml. That's not pretty consistent but it's the best we can do at the moment and seems consistent with most GNOME modules

- Fix the schemas generation in the Makefile.am, you can take plugins/sourceview/Makefile.am as an example on how to generate the schemas correctly.

You can also use gzip to compress the patch but please set the mime-type correctly in bugzilla then.
Comment 12 Maxim Ermilov 2009-04-23 16:15:32 UTC
Created attachment 133191 [details]
corrected patch (.tgz)

glade & ui files renamed. Corrected schemas generation.
Comment 13 Johannes Schmid 2009-05-03 19:59:22 UTC
Committed last patch! Thanks a lot. Would be cool if you could also fix git and cvs and check if everything builds without libglade!
Comment 14 Maxim Ermilov 2009-05-20 21:23:44 UTC
Created attachment 135053 [details] [review]
patch for this bug

With this patch, everything can be build without libglade(except libanjuta - anjuta_preferences_add_page)
Comment 15 Johannes Schmid 2009-05-21 07:49:51 UTC
Thanks! Some will need to port the plugins in anjuta-extras so we can remove anjuta_preferences_add_page().
Comment 16 Maxim Ermilov 2009-05-22 22:41:18 UTC
Created attachment 135211 [details] [review]
patch for anjuta-extras
Comment 17 Johannes Schmid 2009-05-24 11:44:44 UTC
Removed the remaining libglade bits from anjuta and applied patch - Thanks!
Comment 18 Massimo Cora' 2009-06-01 09:59:12 UTC
Compiling valgrind I get:

make: *** No rule to make target `anjuta-valgrind.xml', needed by `all-am'.  Stop.

Should the anjuta-valgrind.ui be renamed into anjuta-valgrind.xml?
Comment 19 Massimo Cora' 2009-06-01 10:17:06 UTC
I'm reopening this bug because the simple `mv anjuta-valgrind.xml anjuta-valgrind.ui` doesn't work as expected.

Comment 20 Massimo Cora' 2009-06-01 10:26:32 UTC
The profiler plugin has compiling problems too:

In file included from plugin.c:25:
plugin.h:63: error: expected specifier-qualifier-list before ‘GladeXML’
plugin.c: In function ‘setup_options’:
plugin.c:137: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:141: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:142: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:143: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c: In function ‘profiler_get_data’:
plugin.c:159: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c:172: error: ‘Profiler’ has no member named ‘profile_data’
plugin.c:173: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c: In function ‘on_profile_data_changed’:
plugin.c:210: error: ‘Profiler’ has no member named ‘view_manager’
plugin.c:214: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:215: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c: In function ‘profiler_set_target’:
plugin.c:232: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c:234: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c:235: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c:265: error: ‘Profiler’ has no member named ‘profile_target_path’
plugin.c:273: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:274: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:276: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:278: error: ‘Profiler’ has no member named ‘profile_data_monitor’
plugin.c:286: error: ‘Profiler’ has no member named ‘view_manager’
plugin.c: In function ‘on_profiler_select_target’:
[...]

Comment 21 Sébastien Granjoux 2009-06-01 12:27:14 UTC
3 files containing menu definitions (old .ui now .xml) are missing in Maxim's patch in plugins valgrind, profile and indent. I have restored all of them. 
Comment 22 Javier Jardón (IRC: jjardon) 2009-07-12 14:00:23 UTC
I've reopened this bug because seems that anjuta still uses libglade libraries

$ git grep "glade_xml_get"
plugins/class-gen/window.c:     button = glade_xml_get_widget (xml, button_id);
plugins/class-gen/window.c:     entry = glade_xml_get_widget (xml, entry_id);
plugins/debug-manager/watch.c:  dialog = glade_xml_get_widget (gxml, CHANGE_WATCH_DIALOG);
plugins/debug-manager/watch.c:  name_entry = glade_xml_get_widget (gxml, NAME_ENTRY);
plugins/debug-manager/watch.c:  value_entry = glade_xml_get_widget (gxml, VALUE_ENTRY);
plugins/project-wizard/templates/anjuta-plugin/src/plugin.c:    wid = glade_xml_get_widget (gxml, "top_widget");
plugins/project-wizard/templates/gtk/src/main.c:        window = glade_xml_get_widget (gxml, "window");

liblgade code in plugins/class-gen/window.c and plugins/debug-manager/watch.c is on dead code, but plugins/project-wizard/templates/anjuta-plugin/src/plugin.c and plugins/project-wizard/templates/gtk/src/main.c is still used

See http://www.gnome.org/~fpeters/299.html for more info
Comment 23 Sébastien Granjoux 2009-07-12 14:08:35 UTC
No libglade is really unused in Anjuta. 

The 2 living references are in files used in new project created by Anjuta not in Anjuta itself.

Then, it would be nice to use GtkBuilder instead of libglade here too but it's less important. There is a new project kind to create a Gnome project containing mainly obsolete libraries too. I don't know how to avoid using bonobo for panel applet too.
Comment 24 Javier Jardón (IRC: jjardon) 2009-07-12 15:18:01 UTC
Created attachment 138275 [details] [review]
Migrate gtk wizard from libglade to GtkBuilder
Comment 25 Javier Jardón (IRC: jjardon) 2009-07-12 16:30:22 UTC
Created attachment 138282 [details] [review]
Migrate anjuta plugin wizard from libglade to GtkBuilder

I've renamed older .ui files to .xml and .glade to .ui
Comment 26 Javier Jardón (IRC: jjardon) 2009-07-12 16:59:28 UTC
Created attachment 138284 [details] [review]
Migrate gtk wizard from libglade to GtkBuilder v2

The .ui files are in glade/ directory, not ui/
Comment 27 Javier Jardón (IRC: jjardon) 2009-07-12 17:00:15 UTC
Created attachment 138285 [details] [review]
Migrate gtkmm plugin wizard from libglade to GtkBuiler
Comment 28 Javier Jardón (IRC: jjardon) 2009-07-12 17:18:18 UTC
Created attachment 138289 [details] [review]
Migrate anjuta vala plugin wizard from libglade to GtkBuiler
Comment 29 Sébastien Granjoux 2009-07-12 18:54:35 UTC
Thanks for your patches. I have committed all of them with a few fixes. You need to use the .wiz file to copy the .ui file instead of the .glade file.
Comment 30 Johannes Schmid 2009-07-12 20:38:31 UTC
Just as addition, I think we should remove all Gnome* project wizard templates as they are completely obsolete. There are no (real) gnome libraries anymore and instead people should general purpose libraries.
Comment 31 Massimo Cora' 2009-07-12 22:43:40 UTC
(In reply to comment #30)
> Just as addition, I think we should remove all Gnome* project wizard templates
> as they are completely obsolete. There are no (real) gnome libraries anymore
> and instead people should general purpose libraries.
> 

I agree.
Comment 32 Sébastien Granjoux 2009-07-26 14:51:43 UTC
I think it's already done.

The gnome project template has been removed quite some time ago.

The gnome-applet project is, I think, still useful and doesn't use gnome library.

I have committed a patch two weeks ago to use GtkBuilder instead of glade in gtk projects.