GNOME Bugzilla – Bug 450635
Convert to GtkBuilder
Last modified: 2007-07-05 23:27:38 UTC
Once the GtkBuilder API's had its little bugs worked out and it's been in trunk a few weeks to stabilise, it might be nice for us to convert to using it instead of Glade, and then drop our Glade dependency.
If we're going to up the reqs for GTK+, we'll want to use the new volume button everywhere as well (removing the current hacks for the 2 different types of volume widgets).
Created attachment 90642 [details] [review] Use GtkVolumeButton instead of BaconVolume
(In reply to comment #2) > Created an attachment (id=90642) [edit] > Use GtkVolumeButton instead of BaconVolume It should be possible to share the GtkAdjustment between the 2 volume widgets/buttons (ie. use a GTK+ volume button in the fullscreen widget as well), so we can remove the volume lock.
Created attachment 90654 [details] [review] Updated patch (Use GtkVolumeButton instead of BaconVolume) Changes to the previous patch: Share the GtkAdjustment Remove vol_lock and the second value_changed handler Remove not used "fs" data
I've started work on this, but if we're going to do it properly, we'll need the API from bug #447969, so I'm adding it as a dependency.
(In reply to comment #5) > I've started work on this, but if we're going to do it properly, we'll need the > API from bug #447969, so I'm adding it as a dependency. > It's not a requirement though, it's perfectly possible to create a GtkBuilder interface in the current way. Don't let that bug block your work! You can copy the code to totem in worst case, it's only using public APIs.
After talking to Bastien, he's decided we're going to put everything possible into the GtkBuilder XML files, i.e. signals, objects such as TreeView models, and GtkDialog windows and buttons (which we previously did in C).
Created attachment 90789 [details] [review] Move to GtkBuilder This is the first draft of the patch, and it includes Jan's patch for the volume widget. There are still a few problems/things to do: - The "stock-tool-brightness-contrast-22.png" image on the Preferences dialog no longer shows up. I've tried everything I can to get it to appear, but no luck. We may want to move to using a proper stock icon instead of the one in /data. - I'm sure there are signals and GObjects I've missed, but since this is a first draft, I think that's OK, and they can be caught in later patches (once this one's been applied). - As discussed with Bastien, I haven't been able to move dialogs such as TotemOpenLocation completely into the XML, so we're still reparenting the vbox from the XML to the dialog GObject. I can't see much of a way round this at the moment, but there's still room for experimentation (and if this can be done, lots of stuff can be cleaned up). - There's still cleanup to do once bug #447969 lands, using the API it'll introduce. Sorry for the massive patch, but most of it's just repetitive stuff.
Jan, I committed a slightly modified version of your patch, which uses a GtkVolumeButton in fullscreen as well, removing quite a bit of code in the process. Thinking about it, it's probably a good idea to make the seek bars use the same GtkAdjustment as well, that would remove quite a few hacks (bug 451912). Philip, your patch didn't apply cleanly against the current SVN, could you re-diff? 2007-06-28 Bastien Nocera <hadess@hadess.net> * browser-plugin/totem-plugin-viewer.c: (cb_vol), (totem_embedded_construct), (totem_volume_create): * configure.in: * data/totem.glade: * src/Makefile.am: * src/bacon-volume.c: * src/bacon-volume.h: * src/totem-private.h: * src/totem.c: (totem_action_set_mrl_with_warning), (update_volume_sliders), (volume_button_value_changed), (popup_hide), (totem_callback_connect), (totem_volume_create), (main): Remove the BaconVolume widget, and use the GtkVolumeButton in the new GTK+ instead, use the scale button in fullscreen mode as well, make both volume buttons share the same GtkAdjustment, modified version of patch from Jan Arne Petersen <jpetersen@jpetersen.org> (Helps: #450635)
Created attachment 90882 [details] [review] Move to GtkBuilder (updated) This one's updated to apply cleanly against SVN HEAD, and all the points from comment #8 still apply. It took far too long to merge this in with Bastien's fullscreen stuff. :-P
Created attachment 91240 [details] [review] Move to GtkBuilder (updated again) Updated again to apply cleanly to HEAD.
Didn't want to haggle too much, so committed this. The skipto dialog doesn't update the label anymore though, so that'll need to be fixed. 2007-07-05 Bastien Nocera <hadess@hadess.net> * Load of files: Patch from Philip Withnall <pwithnall@svn.gnome.org> to use GtkBuilder instead of libglade (Closes: #450635) 2007-07-06 Bastien Nocera <hadess@hadess.net> * POTFILES.in: skip_to.glade was renamed to skipto.ui 2007-07-05 Bastien Nocera <hadess@hadess.net> * POTFILES.in: * POTFILES.skip: Updated for GtkBuilder migration