git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[GITK PATCH] Add menu accelerators

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Oct 19, 2008, 21:19 UTC
Message-ID
<200810192319.46974.robin.rosenberg@dewire.com>
In-Reply-To
<18681.53866.855255.688290@cargo.ozlabs.ibm.com>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
lördagen den 18 oktober 2008 14.11.22 skrev Paul Mackerras:
> Have a look at what I just pushed out.  It adds infrastructure to let
> us use "&" in menu items to specify an alt+letter accelerator, but in
> a different way to your patches.  If you'd like to redo your patch to
> add "&" to the menu items, that would be good.

Looks fine. Seems to work too. Then we want to do the same thing with buttons. Btw, is it only for me that the "popup menu key" does not work for in gitk?

This patch does not include re-generated po's, nor the updated swedish translation.
-- robin
 gitk |   72 +++++++++++++++++++++++++++++++++---------------------------------
 1 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/gitk b/gitk
index 3678de1..e65c0ce 100755
--- a/gitk
+++ b/gitk
@@ -1817,26 +1817,26 @@ proc makewindow {} {
     # The "mc" arguments here are purely so that xgettext
     # sees the following string as needing to be translated
     makemenu .bar {
-	{mc "File" cascade {
-	    {mc "Update" command updatecommits -accelerator F5}
-	    {mc "Reload" command reloadcommits}
-	    {mc "Reread references" command rereadrefs}
-	    {mc "List references" command showrefs}
-	    {mc "Quit" command doquit}
+	{mc "&File" cascade {
+	    {mc "&Update" command updatecommits -accelerator F5}
+	    {mc "&Reload" command reloadcommits}
+	    {mc "R&eread references" command rereadrefs}
+	    {mc "&List references" command showrefs}
+	    {mc "&Quit" command doquit}
 	}}
-	{mc "Edit" cascade {
-	    {mc "Preferences" command doprefs}
+	{mc "&Edit" cascade {
+	    {mc "&Preferences" command doprefs}
 	}}
-	{mc "View" cascade {
-	    {mc "New view..." command {newview 0}}
-	    {mc "Edit view..." command editview -state disabled}
-	    {mc "Delete view" command delview -state disabled}
+	{mc "&View" cascade {
+	    {mc "&New view..." command {newview 0}}
+	    {mc "&Edit view..." command editview -state disabled}
+	    {mc "&Delete view" command delview -state disabled}
 	    {xx "" separator}
-	    {mc "All files" radiobutton {selectedview 0} -command {showview 0}}
+	    {mc "&All files" radiobutton {selectedview 0} -command {showview 0}}
 	}}
-	{mc "Help" cascade {
-	    {mc "About gitk" command about}
-	    {mc "Key bindings" command keys}
+	{mc "&Help" cascade {
+	    {mc "&About gitk" command about}
+	    {mc "&Key bindings" command keys}
 	}}
     }
     . configure -menu .bar
@@ -2220,39 +2220,39 @@ proc makewindow {} {
 
     set rowctxmenu .rowctxmenu
     makemenu $rowctxmenu {
-	{mc "Diff this -> selected" command {diffvssel 0}}
-	{mc "Diff selected -> this" command {diffvssel 1}}
-	{mc "Make patch" command mkpatch}
-	{mc "Create tag" command mktag}
-	{mc "Write commit to file" command writecommit}
-	{mc "Create new branch" command mkbranch}
-	{mc "Cherry-pick this commit" command cherrypick}
-	{mc "Reset HEAD branch to here" command resethead}
+	{mc "Diff &this -> selected" command {diffvssel 0}}
+	{mc "Diff &selected -> this" command {diffvssel 1}}
+	{mc "Make &patch" command mkpatch}
+	{mc "Create ta&g" command mktag}
+	{mc "&Write commit to file" command writecommit}
+	{mc "Create new &branch" command mkbranch}
+	{mc "&Cherry-pick this commit" command cherrypick}
+	{mc "&Reset HEAD branch to here" command resethead}
     }
     $rowctxmenu configure -tearoff 0
 
     set fakerowmenu .fakerowmenu
     makemenu $fakerowmenu {
-	{mc "Diff this -> selected" command {diffvssel 0}}
-	{mc "Diff selected -> this" command {diffvssel 1}}
-	{mc "Make patch" command mkpatch}
+	{mc "Diff &this -> selected" command {diffvssel 0}}
+	{mc "Diff &selected -> this" command {diffvssel 1}}
+	{mc "Make &patch" command mkpatch}
     }
     $fakerowmenu configure -tearoff 0
 
     set headctxmenu .headctxmenu
     makemenu $headctxmenu {
-	{mc "Check out this branch" command cobranch}
-	{mc "Remove this branch" command rmbranch}
+	{mc "&Check out this branch" command cobranch}
+	{mc "&Remove this branch" command rmbranch}
     }
     $headctxmenu configure -tearoff 0
 
     global flist_menu
     set flist_menu .flistctxmenu
     makemenu $flist_menu {
-	{mc "Highlight this too" command {flist_hl 0}}
-	{mc "Highlight this only" command {flist_hl 1}}
-	{mc "External diff" command {external_diff}}
-	{mc "Blame parent commit" command {external_blame 1}}
+	{mc "Highlight this &too" command {flist_hl 0}}
+	{mc "Highlight this &only" command {flist_hl 1}}
+	{mc "E&xternal diff" command {external_diff}}
+	{mc "&Blame parent commit" command {external_blame 1}}
     }
     $flist_menu configure -tearoff 0
 }
@@ -7361,9 +7361,9 @@ proc rowmenu {x y id} {
     } else {
 	set menu $fakerowmenu
     }
-    $menu entryconfigure [mca "Diff this -> selected"] -state $state
-    $menu entryconfigure [mca "Diff selected -> this"] -state $state
-    $menu entryconfigure [mca "Make patch"] -state $state
+    $menu entryconfigure [mca "Diff &this -> selected"] -state $state
+    $menu entryconfigure [mca "Diff &selected -> this"] -state $state
+    $menu entryconfigure [mca "Make &patch"] -state $state
     tk_popup $menu $x $y
 }
 
-- 
1.6.0.2.308.gef4a
Previous: Paul MackerrasNext: Robin Rosenberg
Message 13 of 15 in “[Gitk Patch 0/6]”
  1. 0/6 Robin Rosenberg, Oct 9, 2008
  2. 1/6 gitk: Add procedure to create accelerated menusRobin Rosenberg, Oct 9, 2008
  3. 2/6 gitk: Change menus to use accelerated designRobin Rosenberg, Oct 9, 2008
  4. 3/6 gitk: regenerated po filesRobin Rosenberg, Oct 9, 2008
  5. 4/6 gitk: Add accelerator hintsRobin Rosenberg, Oct 9, 2008
  6. 5/6 gitk: regenerated po filesRobin Rosenberg, Oct 9, 2008
  7. 6/6 gitk: Add menu accelerators for Swedish translationRobin Rosenberg, Oct 9, 2008
  8. Paul MackerrasOct 11, 2008
  9. Robin RosenbergOct 11, 2008
  10. Paul MackerrasOct 11, 2008
  11. Robin RosenbergOct 11, 2008
  12. Paul MackerrasOct 18, 2008
  13. Add menu acceleratorsRobin Rosenberg, Oct 19, 2008
  14. Add menu acceleratorsRobin Rosenberg, Oct 19, 2008
  15. Paul MackerrasOct 20, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.