GNOME Bugzilla – Bug 394153
Accelerator keys for files in Documents menu (0-9)
Last modified: 2015-01-02 10:07:09 UTC
The Documents menu gives you a list of files that you have open in the current window. The first ten have the tooltip alt-1 through alt-9 and alt-0; it also makes sense for these numerals to be used to select the documents in the menu. I checked out the CVS head and added the following code: diff -r1.47 gedit-window.c 1605a1606,1612 > /* Put a 0..9 as a shortcut key before the first ten items */ > if (i < 10) { > g_string_prepend( > name, > g_strdup_printf("_%d: ", ((i + 1) % 10)) > ); > } Unfortunately, my system (FC6) doesn't have the latest intltool, so I haven't bene able to finish running autogen.sh and compiling my copy of Gedit. Therefore I don't know if the above code works or not. Please be nice to me, this is my first ever patch to any GNOME program ever! Hope this helps, Paul
That patch in -u format: diff -u -r1.47 gedit-window.c --- gedit-window.c 10 Dec 2006 17:31:47 -0000 1.47 +++ gedit-window.c 9 Jan 2007 05:19:09 -0000 @@ -1603,6 +1603,13 @@ action_name = g_strdup_printf ("Tab_%d", i); tab_name = _gedit_tab_get_name (GEDIT_TAB (tab)); name = gedit_utils_escape_underscores (tab_name, -1); + /* Put a 0..9 as a shortcut key before the first ten items */ + if (i < 10) { + g_string_prepend( + name, + g_strdup_printf("_%d: ", ((i + 1) % 10)) + ); + } tip = get_menu_tip_for_tab (GEDIT_TAB (tab)); /* alt + 1, 2, 3... 0 to switch to the first ten tabs */ HTH, Paul
Thanks for the patch. I'm not sure adding a number before the first 10 documents in the Documents menu is a good idea since you will get something like: 1. Name 2. Name ... 0. Name Name Nanme And so the menu items will not be aligned. May be we could see if it possible to enable the 0-9 accellerator without showing it in the menu.
My thought for long menus was to then start from 'a' and work down. Anyone with more than 36 documents open in the one window has problems that this patch can't address :-) However, that idea broke the similarity between pressing <ALT>-D 1 and <ALT>-1 to get document number 1. This was what I was really after. IMO there's no point in enabling the accelerator without showing the user that that's what they can press.
What's your opinion on this in the light of the latest gEdit changes? gEdit doesn't have a documents menu anymore, but rather a search for the recent files, which I find a lot more powerful than having simple shortcuts for the first 10 documents. Maybe it's time to mark this as obsolete.