summaryrefslogtreecommitdiff
path: root/lib/option.tcl
diff options
context:
space:
mode:
authorLibravatar Alexander Gavrilov <angavrilov@gmail.com>2008-09-18 01:07:33 +0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-24 12:48:32 -0700
commit50102c5687db83db48b9705e07de16d07cef7cd9 (patch)
treeca4df0223f7020a302680c22c6efdb48830a6d7b /lib/option.tcl
parentgit-gui: Cleanup handling of the default encoding. (diff)
downloadtgif-50102c5687db83db48b9705e07de16d07cef7cd9.tar.xz
git-gui: Add a menu of available encodings.
To make encoding selection easier, add a menu that lists available encodings to the Options window. Menu structure is borrowed from Firefox. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/option.tcl')
-rw-r--r--lib/option.tcl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/option.tcl b/lib/option.tcl
index 40af44e3bf..c80c939878 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -152,7 +152,7 @@ proc do_options {} {
{i-1..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"}}
- {t gui.encoding {mc "Default File Contents Encoding"}}
+ {c gui.encoding {mc "Default File Contents Encoding"}}
} {
set type [lindex $option 0]
set name [lindex $option 1]
@@ -182,6 +182,7 @@ proc do_options {} {
pack $w.$f.$optid.v -side right -anchor e -padx 5
pack $w.$f.$optid -side top -anchor w -fill x
}
+ c -
t {
frame $w.$f.$optid
label $w.$f.$optid.l -text "$text:"
@@ -194,6 +195,16 @@ proc do_options {} {
pack $w.$f.$optid.v -side left -anchor w \
-fill x -expand 1 \
-padx 5
+ if {$type eq {c}} {
+ menu $w.$f.$optid.m
+ build_encoding_menu $w.$f.$optid.m \
+ [list set ${f}_config_new($name)] 1
+ button $w.$f.$optid.b \
+ -text [mc "Change"] \
+ -command [list popup_btn_menu \
+ $w.$f.$optid.m $w.$f.$optid.b]
+ pack $w.$f.$optid.b -side left -anchor w
+ }
pack $w.$f.$optid -side top -anchor w -fill x
}
}