]> asedeno.scripts.mit.edu Git - git.git/blobdiff - lib/option.tcl
git-gui: add a part about format strings in po/README
[git.git] / lib / option.tcl
index de6bd90edc150f878dd2e78a6279bc0679de71f7..ffb3f00ff0a992254804cc047b5a63ce82aa5bd9 100644 (file)
@@ -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
@@ -78,10 +91,6 @@ proc do_options {} {
        toplevel $w
        wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
 
-       label $w.header -text [mc "Options"] \
-               -font font_uibold
-       pack $w.header -side top -fill x
-
        frame $w.buttons
        button $w.buttons.restore -text [mc "Restore Defaults"] \
                -default normal \
@@ -114,7 +123,10 @@ proc do_options {} {
                {b gui.trustmtime  {mc "Trust File Modification Timestamps"}}
                {b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
                {b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
+               {b gui.fastcopyblame {mc "Blame Copy Only On Changed Files"}}
+               {i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
                {i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+               {i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
                {t gui.newbranchtemplate {mc "New Branch Name Template"}}
                } {
                set type [lindex $option 0]
@@ -163,6 +175,32 @@ 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 right -anchor e -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]
@@ -199,7 +237,13 @@ proc do_options {} {
        bind $w <Visibility> "grab $w; focus $w.buttons.save"
        bind $w <Key-Escape> "destroy $w"
        bind $w <Key-Return> [list do_save_config $w]
-       wm title $w [append "[appname] ([reponame]): " [mc "Options"]]
+
+       if {[is_MacOSX]} {
+               set t [mc "Preferences"]
+       } else {
+               set t [mc "Options"]
+       }
+       wm title $w "[appname] ([reponame]): $t"
        tkwait window $w
 }