diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-13 11:04:58 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-13 11:04:58 -0800 |
commit | 41e2edf41a6d501f1b8beca7f1f0bcbe9296dcc2 (patch) | |
tree | 5a3e97b7c147242f3550a7318ec45480ecaa7480 /git-gui/lib/option.tcl | |
parent | 6bc4c72132adbdc06c428f86a96f27e4f8173b99 (diff) | |
parent | 95b002eeb38de89feb7f0cc1a55721b45fd3cf11 (diff) | |
download | git-41e2edf41a6d501f1b8beca7f1f0bcbe9296dcc2.tar.gz |
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
git-gui: Automatically spell check commit messages as the user types
git-gui: support Git Gui.app under OS X 10.5
git-gui: Update German translation.
git-gui: (i18n) Fix a bunch of still untranslated strings.
Diffstat (limited to 'git-gui/lib/option.tcl')
-rw-r--r-- | git-gui/lib/option.tcl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl index f812e5e89a..3bfa2edf1a 100644 --- a/git-gui/lib/option.tcl +++ b/git-gui/lib/option.tcl @@ -5,6 +5,7 @@ proc save_config {} { global default_config font_descs global repo_config global_config global repo_config_new global_config_new + global ui_comm_spell foreach option $font_descs { set name [lindex $option 0] @@ -52,11 +53,23 @@ proc save_config {} { set repo_config($name) $value } } + + if {[info exists repo_config(gui.spellingdictionary)]} { + set value $repo_config(gui.spellingdictionary) + if {$value eq {none}} { + if {[info exists ui_comm_spell]} { + $ui_comm_spell stop + } + } elseif {[info exists ui_comm_spell]} { + $ui_comm_spell lang $value + } + } } proc do_options {} { global repo_config global_config font_descs global repo_config_new global_config_new + global ui_comm_spell array unset repo_config_new array unset global_config_new @@ -159,6 +172,34 @@ proc do_options {} { } } + set all_dicts [linsert \ + [spellcheck::available_langs] \ + 0 \ + none] + incr optid + foreach f {repo global} { + if {![info exists ${f}_config_new(gui.spellingdictionary)]} { + if {[info exists ui_comm_spell]} { + set value [$ui_comm_spell lang] + } else { + set value none + } + set ${f}_config_new(gui.spellingdictionary) $value + } + + frame $w.$f.$optid + label $w.$f.$optid.l -text [mc "Spelling Dictionary:"] + eval tk_optionMenu $w.$f.$optid.v \ + ${f}_config_new(gui.spellingdictionary) \ + $all_dicts + pack $w.$f.$optid.l -side left -anchor w -fill x + pack $w.$f.$optid.v -side left -anchor w \ + -fill x -expand 1 \ + -padx 5 + pack $w.$f.$optid -side top -anchor w -fill x + } + unset all_dicts + set all_fonts [lsort [font families]] foreach option $font_descs { set name [lindex $option 0] |