Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 0/6] Menu accelerators for Gitk

I finally got tired of pressing Alt and some letter to activate menus in Gitk. 
For example in "any" program you can press Alt-F to have the File menu drop 
down and then select the underscored character to select the wanted menu.

This series makes it possible. Friends of TCL may think my solution is too
hack-ish. It doesn't fix all warts but that is the subject of later patches
as it looks like it requires other patches.

Git gui has the same problem, but again, subject to another series.

-- robin

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 1/6] gitk: Add procedure to create accelerated menus

These are the undescores menu items that can be selected with the Alt+letter,
key combination on Windows and Linux or Command+letter on Macs.

Signed-off-by: Robin Rosenberg <robin.rosenberg <at> dewire.com>
---
 gitk |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/gitk b/gitk
index 2eaa2ae..050019c 100755
--- a/gitk
+++ b/gitk
@@ -1750,6 +1750,33 @@ proc setoptions {} {
     option add *Entry.font uifont startupFile
 }

+# Menu command wrapper. Intercepts any -label arguments, 
+# removes the & and adds the -underline argument necessary
+# to implement the menu accelerator.
+proc mcw {menubar args} {
+    set ai [lsearch $args "-label"]
+    if { $ai > 0 } {
+	set label [lindex $args [expr {$ai + 1}]]
+	foreach {l u} [::tk::UnderlineAmpersand $label] {
+	    lset args [expr {$ai + 1}] $l
+	}
+	lappend args -underline
+	lappend args $u
+    }
+    set cmd [ list $menubar ]
(Continue reading)

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 2/6] gitk: Change menus to use accelerated design

Signed-off-by: Robin Rosenberg <robin.rosenberg <at> dewire.com>
---
 gitk |   88 +++++++++++++++++++++++++++++++++---------------------------------
 1 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/gitk b/gitk
index 050019c..6298b0a 100755
--- a/gitk
+++ b/gitk
@@ -1795,31 +1795,31 @@ proc makewindow {} {
     global have_tk85

     menu .bar
-    .bar add cascade -label [mc "File"] -menu .bar.file
+    mcw .bar add cascade -label [mc "File"] -menu .bar.file
     menu .bar.file
-    .bar.file add command -label [mc "Update"] -command updatecommits
-    .bar.file add command -label [mc "Reload"] -command reloadcommits
-    .bar.file add command -label [mc "Reread references"] -command rereadrefs
-    .bar.file add command -label [mc "List references"] -command showrefs
-    .bar.file add command -label [mc "Quit"] -command doquit
+    mcw .bar.file add command -label [mc "Update"] -command updatecommits
+    mcw .bar.file add command -label [mc "Reload"] -command reloadcommits
+    mcw .bar.file add command -label [mc "Reread references"] -command rereadrefs
+    mcw .bar.file add command -label [mc "List references"] -command showrefs
+    mcw .bar.file add command -label [mc "Quit"] -command doquit
     menu .bar.edit
-    .bar add cascade -label [mc "Edit"] -menu .bar.edit
-    .bar.edit add command -label [mc "Preferences"] -command doprefs
+    mcw .bar add cascade -label [mc "Edit"] -menu .bar.edit
(Continue reading)

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 3/6] gitk: regenerated po files

We intend to change the source strings. This is a "null" update
using make update-po to make the real changes easier to see later on.

Signed-off-by: Robin Rosenberg <robin.rosenberg <at> dewire.com>
---
 po/de.po |  443 ++++++++++++++++++++++++++++---------------------------
 po/es.po |  500 +++++++++++++++++++++++++++++++++-----------------------------
 po/it.po |  489 +++++++++++++++++++++++++++++++++----------------------------
 po/sv.po |  431 +++++++++++++++++++++++++++--------------------------
 4 files changed, 978 insertions(+), 885 deletions(-)

diff --git a/po/de.po b/po/de.po
index 04ee570..af18389 100644
--- a/po/de.po
+++ b/po/de.po
 <at>  <at>  -7,7 +7,7  <at>  <at>  msgid ""
 msgstr ""
 "Project-Id-Version: git-gui\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-24 22:32+0200\n"
+"POT-Creation-Date: 2008-10-07 23:06+0200\n"
 "PO-Revision-Date: 2008-05-24 22:40+0200\n"
 "Last-Translator: Christian Stimming <stimming <at> tuhh.de>\n"
 "Language-Team: German\n"
 <at>  <at>  -15,17 +15,17  <at>  <at>  msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: gitk:102
+#: gitk:113
(Continue reading)

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 4/6] gitk: Add accelerator hints

Signed-off-by: Robin Rosenberg <robin.rosenberg <at> dewire.com>
---
 gitk |   66 +++++++++++++++++++++++++++++++++---------------------------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/gitk b/gitk
index 6298b0a..79de9a6 100755
--- a/gitk
+++ b/gitk
@@ -1795,31 +1795,31 @@ proc makewindow {} {
     global have_tk85

     menu .bar
-    mcw .bar add cascade -label [mc "File"] -menu .bar.file
+    mcw .bar add cascade -label [mc "&File"] -menu .bar.file
     menu .bar.file
-    mcw .bar.file add command -label [mc "Update"] -command updatecommits
-    mcw .bar.file add command -label [mc "Reload"] -command reloadcommits
-    mcw .bar.file add command -label [mc "Reread references"] -command rereadrefs
-    mcw .bar.file add command -label [mc "List references"] -command showrefs
-    mcw .bar.file add command -label [mc "Quit"] -command doquit
+    mcw .bar.file add command -label [mc "&Update"] -command updatecommits
+    mcw .bar.file add command -label [mc "&Reload"] -command reloadcommits
+    mcw .bar.file add command -label [mc "R&eread references"] -command rereadrefs
+    mcw .bar.file add command -label [mc "&List references"] -command showrefs
+    mcw .bar.file add command -label [mc "&Quit"] -command doquit
     menu .bar.edit
-    mcw .bar add cascade -label [mc "Edit"] -menu .bar.edit
-    mcw .bar.edit add command -label [mc "Preferences"] -command doprefs
+    mcw .bar add cascade -label [mc "&Edit"] -menu .bar.edit
(Continue reading)

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 5/6] gitk: regenerated po files

make update-po

Also unmade all new "fuzzy" tags

Signed-off-by: Robin Rosenberg <robin.rosenberg <at> dewire.com>
---
 po/de.po |   92 +++++++++++++++++++++++++++++++++++++------------------------
 po/es.po |   92 +++++++++++++++++++++++++++++++++++++------------------------
 po/it.po |   92 +++++++++++++++++++++++++++++++++++++------------------------
 po/sv.po |   92 +++++++++++++++++++++++++++++++++++++------------------------
 4 files changed, 224 insertions(+), 144 deletions(-)

diff --git a/po/de.po b/po/de.po
index af18389..aea76a7 100644
--- a/po/de.po
+++ b/po/de.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: git-gui\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-10-07 23:06+0200\n"
+"POT-Creation-Date: 2008-10-07 23:08+0200\n"
 "PO-Revision-Date: 2008-05-24 22:40+0200\n"
 "Last-Translator: Christian Stimming <stimming <at> tuhh.de>\n"
 "Language-Team: German\n"
@@ -67,67 +67,67 @@ msgid "Cancel"
 msgstr "Abbrechen"

 #: gitk:1798
-msgid "File"
(Continue reading)

Robin Rosenberg | 7 Oct 23:56

[Gitk PATCH 6/6] gitk: Add menu accelerators for Swedish translation

---
 po/sv.po |   60 ++++++++++++++++++++++++++++++------------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/po/sv.po b/po/sv.po
index c1c3ed2..af3da51 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -69,67 +69,67 @@ msgstr "Avbryt"

 #: gitk:1798
 msgid "&File"
-msgstr "Arkiv"
+msgstr "&Arkiv"

 #: gitk:1800
 msgid "&Update"
-msgstr "Uppdatera"
+msgstr "&Uppdatera"

 #: gitk:1801
 msgid "&Reload"
-msgstr "Ladda om"
+msgstr "&Ladda om"

 #: gitk:1802
 msgid "R&eread references"
-msgstr "Läs om referenser"
+msgstr "L&äs om referenser"

(Continue reading)


Gmane