GNOME Bugzilla – Bug 484142
Show menu item descriptions in status bar
Last modified: 2009-07-26 22:27:09 UTC
The GtkActions defined in totem.ui have tooltips defined, which however are shown nowhere in the UI. That makes them unnecessary work for the translators. So either they should be removed, or (preferably) they should be shown in the statusbar while the corresponding menu item is selected (like done in many other programmes, e.g. epiphany, evolution, etc.).
Created attachment 122288 [details] [review] show menu help in statusbar Here's a patch, based on Epiphany's solution for this. It's more code than there because we can't use the "connect-proxy" signal because when we have the GtkUIManager, the actions and proxies have already been connected, because the GUI is created by GtkBuilder. So we have to manually iterate over all actions, get all proxies and then connect the "selected" and "deselected" signals. Please comment :).
(In reply to comment #1) > Created an attachment (id=122288) [edit] > show menu help in statusbar > > Here's a patch, based on Epiphany's solution for this. It's more code than > there because we can't use the "connect-proxy" signal because when we have the > GtkUIManager, the actions and proxies have already been connected, because the > GUI is created by GtkBuilder. So we have to manually iterate over all actions, > get all proxies and then connect the "selected" and "deselected" signals. Hmm. If there's no way to do this with gtkbuilder, I'd consider that a bug. Can't you connect the conntect-proxy signal handler with gtkbuilder too, like the action callbacks already are? + id = gtk_statusbar_get_context_id (gstatusbar, HELP_CONTEXT) I think we can just do this once in totem_statusbar_init and store it in the statusbar struct.
(In reply to comment #2) > Hmm. If there's no way to do this with gtkbuilder, I'd consider that a bug. > Can't you connect the conntect-proxy signal handler with gtkbuilder too, like > the action callbacks already are? I tried that, i.e. adding the following as a child tag to <object class="GtkUIManager" id="totem-ui-manager">: <signal name="connect-proxy" handler="manager_connect_proxy_cb"/> But the callback was only called for actions in the skip-action-group, I don't know why exactly. I think the problem is that at the time when we call "gtk_builder_connect_signals" in totem-interface.c, the actions and widgets have already been added and connected by "gtk_builder_add_from_file". I'll have a look at the source of GtkBuilder to see if this is true and if something could be done about it. > + id = gtk_statusbar_get_context_id (gstatusbar, HELP_CONTEXT) > > I think we can just do this once in totem_statusbar_init and store it in the > statusbar struct. I did it this way because the rest of the statusbar code also did it like that. But we can change the rest of the code in a separate patch.
Robin, could you make a test case for that problem and file a GTK+ bug? We should be able to use the .ui file to use the connect-proxy signal, and it would certainly be cleaner than the current option.
Yes, I'll do that as soon as I have time.
Ok, filed bug #574001 against Gtk+.
Committed with some minor modifications to remove use of deprecated GTK+ symbols. This bug can be closed now, and the code can be modified once bug #574001 is fixed. There's a comment about it in the source code. commit 6fdfd1ca71ee5d0c82ba1915df981fd26b0a7b7f Author: Robin Stocker <robin@nibor.org> Date: Sun Jul 26 20:08:47 2009 +0100 Bug 484142 – Show menu item descriptions in status bar src/totem-menu.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ src/totem-statusbar.c | 23 ++++++++++++++++++++ src/totem-statusbar.h | 3 ++ 3 files changed, 81 insertions(+), 0 deletions(-)
Thanks Philip!