+proc do_options {} {
+ global appname gitdir
+ global repo_config global_config
+ global repo_config_new global_config_new
+
+ load_config
+ array unset repo_config_new
+ array unset global_config_new
+ foreach name [array names repo_config] {
+ set repo_config_new($name) $repo_config($name)
+ }
+ foreach name [array names global_config] {
+ set global_config_new($name) $global_config($name)
+ }
+
+ set w .options_editor
+ toplevel $w
+
+ label $w.header -text "$appname Options" \
+ -font font_uibold
+ pack $w.header -side top -fill x
+
+ frame $w.buttons
+ button $w.buttons.save -text Save \
+ -font font_ui \
+ -command "save_config; destroy $w"
+ pack $w.buttons.save -side right
+ button $w.buttons.cancel -text {Cancel} \
+ -font font_ui \
+ -command "destroy $w"
+ pack $w.buttons.cancel -side right
+ pack $w.buttons -side bottom -anchor e -pady 10 -padx 10
+
+ labelframe $w.repo -text {This Repository} \
+ -relief raised -borderwidth 2
+ labelframe $w.global -text {Global (All Repositories)} \
+ -relief raised -borderwidth 2
+ pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5
+ pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5
+
+ foreach option {
+ {trustmtime {Trust File Modification Timestamps}}
+ } {
+ set name [lindex $option 0]
+ set text [lindex $option 1]
+ foreach f {repo global} {
+ checkbutton $w.$f.$name -text $text \
+ -variable ${f}_config_new(gui.$name) \
+ -onvalue true \
+ -offvalue false \
+ -font font_ui
+ pack $w.$f.$name -side top -anchor w
+ }
+ }
+
+ bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Key-Escape> "destroy $w"
+ wm title $w "$appname ([lindex [file split \
+ [file normalize [file dirname $gitdir]]] \
+ end]): Options"
+ tkwait window $w
+}
+