gitk: Ensure tabstop setting gets restored by Cancel button
We weren't restoring the tabstop setting if the user pressed the Cancel button in the Edit/Preferences window. Also improved the label for the checkbox (made it "Tab spacing" rather than the laconic "tabstop") and moved it above the "Display nearby tags" checkbox. Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras committed
Oct 23, 2007 at 10:33 UTC
94503918e480123d0d4cf03b03153e4d83cdfd4e
1 file changed
+7
-7
gitk
+7
-7
@@ -7419,7 +7419,7 @@ proc doprefs {} {
7419
return
7420
}
7421
foreach v {maxwidth maxgraphpct diffopts showneartags showlocalchanges \
7422
- limitdiffs} {
7422
+ limitdiffs tabstop} {
7423
set oldprefs($v) [set $v]
7424
}
7425
toplevel $top
@@ -7449,14 +7449,14 @@ proc doprefs {} {
7449
-font optionfont
7450
entry $top.diffopt -width 20 -textvariable diffopts
7451
grid x $top.diffoptl $top.diffopt -sticky w
7452
+ label $top.tabstopl -text "Tab spacing" -font optionfont
7453
+ spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
7454
+ grid x $top.tabstopl $top.tabstop -sticky w
7455
frame $top.ntag
7456
label $top.ntag.l -text "Display nearby tags" -font optionfont
7457
checkbutton $top.ntag.b -variable showneartags
7458
pack $top.ntag.b $top.ntag.l -side left
7459
grid x $top.ntag -sticky w
7457
- label $top.tabstopl -text "tabstop" -font optionfont
7458
- spinbox $top.tabstop -from 1 -to 20 -width 4 -textvariable tabstop
7459
- grid x $top.tabstopl $top.tabstop -sticky w
7460
frame $top.ldiff
7461
label $top.ldiff.l -text "Limit diffs to listed paths" -font optionfont
7462
checkbutton $top.ldiff.b -variable limitdiffs
@@ -7547,11 +7547,11 @@ proc setfg {c} {
7547
}
7548
7549
proc prefscan {} {
7550
- global maxwidth maxgraphpct diffopts
7551
- global oldprefs prefstop showneartags showlocalchanges limitdiffs
7550
+ global oldprefs prefstop
7551
7552
foreach v {maxwidth maxgraphpct diffopts showneartags showlocalchanges \
7554
- limitdiffs} {
7553
+ limitdiffs tabstop} {
7554
+ global $v
7555
set $v $oldprefs($v)
7556
}
7557
catch {destroy $prefstop}