+ global all_heads current_branch
+ global delete_branch_checkhead delete_branch_head
+
+ set delete_branch_checkhead 1
+ set delete_branch_head $current_branch
+
+ set w .branch_editor
+ toplevel $w
+ wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
+
+ label $w.header -text {Delete Local Branch} \
+ -font font_uibold
+ pack $w.header -side top -fill x
+
+ frame $w.buttons
+ button $w.buttons.create -text Delete \
+ -font font_ui \
+ -command [list do_delete_branch_action $w]
+ pack $w.buttons.create -side right
+ button $w.buttons.cancel -text {Cancel} \
+ -font font_ui \
+ -command [list destroy $w]
+ pack $w.buttons.cancel -side right -padx 5
+ pack $w.buttons -side bottom -fill x -pady 10 -padx 10
+
+ labelframe $w.list \
+ -text {Local Branches} \
+ -font font_ui
+ listbox $w.list.l \
+ -height 10 \
+ -width 50 \
+ -selectmode extended \
+ -font font_ui
+ foreach h $all_heads {
+ if {$h ne $current_branch} {
+ $w.list.l insert end $h
+ }
+ }
+ pack $w.list.l -fill both -pady 5 -padx 5
+ pack $w.list -fill both -pady 5 -padx 5
+
+ labelframe $w.validate \
+ -text {Only Delete If} \
+ -font font_ui
+ frame $w.validate.head
+ checkbutton $w.validate.head.r \
+ -text {Already Merged Into Local Branch:} \
+ -variable delete_branch_checkhead \
+ -font font_ui
+ eval tk_optionMenu $w.validate.head.m delete_branch_head $all_heads
+ pack $w.validate.head.r -side left
+ pack $w.validate.head.m -side left
+ pack $w.validate.head -padx 5 -fill x -expand 1
+ pack $w.validate -anchor nw -fill x -pady 5 -padx 5
+
+ bind $w <Visibility> "grab $w; focus $w"
+ bind $w <Key-Escape> "destroy $w"
+ wm title $w "[appname] ([reponame]): Delete Branch"
+ tkwait window $w