提交 43434343 编写于 作者: S Shawn O. Pearce

git-gui: Automatically toggle the relevant radio buttons.

When the user selects a starting revision from one of our offered popup
lists (local branches or tracking branches) or enters in an expression
in the expression input field we should automatically activate the
corresponding radio button for them.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 b36ffe80
......@@ -1768,16 +1768,26 @@ proc do_create_branch_action {w} {
}
}
proc radio_selector {varname value args} {
upvar #0 $varname var
set var $value
}
trace add variable create_branch_head write \
[list radio_selector create_branch_revtype head]
trace add variable create_branch_trackinghead write \
[list radio_selector create_branch_revtype tracking]
trace add variable delete_branch_head write \
[list radio_selector delete_branch_checktype head]
trace add variable delete_branch_trackinghead write \
[list radio_selector delete_branch_checktype tracking]
proc do_create_branch {} {
global all_heads current_branch repo_config
global create_branch_checkout create_branch_revtype
global create_branch_head create_branch_trackinghead
set create_branch_checkout 1
set create_branch_revtype head
set create_branch_head $current_branch
set create_branch_trackinghead {}
set w .branch_editor
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
......@@ -1863,6 +1873,8 @@ proc do_create_branch {} {
bind $w.from.exp_t <Shift-Key-Tab> {focus [tk_focusPrev %W];break}
bind $w.from.exp_t <Key-Tab> {focus [tk_focusNext %W];break}
bind $w.from.exp_t <Key-Return> "do_create_branch_action $w;break"
bind $w.from.exp_t <Key-space> break
bind $w.from.exp_t <Key> {set create_branch_revtype expression}
grid columnconfigure $w.from 1 -weight 1
pack $w.from -anchor nw -fill x -pady 5 -padx 5
......@@ -1876,6 +1888,10 @@ proc do_create_branch {} {
pack $w.postActions.checkout -anchor nw
pack $w.postActions -anchor nw -fill x -pady 5 -padx 5
set create_branch_checkout 1
set create_branch_head $current_branch
set create_branch_revtype head
bind $w <Visibility> "grab $w; focus $w.desc.name_t"
bind $w <Key-Escape> "destroy $w"
bind $w <Key-Return> "do_create_branch_action $w;break"
......@@ -1978,10 +1994,6 @@ proc do_delete_branch {} {
global all_heads tracking_branches current_branch
global delete_branch_checktype delete_branch_head delete_branch_trackinghead
set delete_branch_checktype head
set delete_branch_head $current_branch
set delete_branch_trackinghead {}
set w .branch_editor
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
......@@ -2049,6 +2061,9 @@ proc do_delete_branch {} {
grid columnconfigure $w.validate 1 -weight 1
pack $w.validate -anchor nw -fill x -pady 5 -padx 5
set delete_branch_head $current_branch
set delete_branch_checktype head
bind $w <Visibility> "grab $w; focus $w"
bind $w <Key-Escape> "destroy $w"
wm title $w "[appname] ([reponame]): Delete Branch"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册