Qball's Weblog

Moving GMPC from libglade to GtkBuilder

Tags gmpc 

Everything in gmpc has been moved to GtkBuilder a long time ago, however it was not possible (yet) to move the main window to GtkBuilder. (the conversion script/glade either screwed up or said it could not be done).

Now that I bumped the min.  required gtk version to 2.16, I could finally do the move.

But how to do this?  I saw 2 methods (not wanting to rewrite everything):

  1. Let Glade convert it.
  2. use the gtk-builder-convert script.

So first I tried the gtk-builder-convert script, this nicely transformed the file, but broke just about everything in gmpc.  Because I did not have a lot of time figuring out why it broke I opted for method 2 (wrong move).

Glade managed to convert it all rather nicely and beside some missing icons in the menu’s, everything worked as it should.

But I wanted more, I wanted the menu’s to have easy editable accelerators. After some puzzling the way  to get this, that with the can-change-accel option you can edit the menu entries, I found out the best step was to move to UIManager and GtkActions.  Wait this is exactly what gtk-builder-convert did.   (D’Oh in a homer-simpsonny voice).

So UIManager it is, how todo this.  This is the point where I started getting utter fails in glade-3. I installed the latest stable, git checkout, but no luck.  I could not see how to add an UIManager, and it crashed more often then a windows 98 machine after 5 years of public internet service.

So I wound up writing GtkActionGroups, and the menu by hand. Lukely this is recenably doable process. But glade will destroy my ui file now. So all future editing will have to be done by hand.

The positive side is (compart to convert it), I nicely made different Actiongroups depending on the action. So all MPD actions are grouped, View action, etc.

WHY, just WHY is glade so crappy, this must be one of the single most important things for a toolkit, a good UI dev tool.  QT has this right qtcreator works fine, not perfect, but does not crash hang or leave lot of stuff out,  Apple has this straight, even microsoft. Hell even borland crappy thing works better then this.

please fix this..