1 # git-gui branch (create/delete) support
2 # Copyright (C) 2006, 2007 Shawn Pearce
4 proc error_popup {msg} {
6 if {[reponame] ne {}} {
7 append title " ([reponame])"
9 set cmd [list tk_messageBox \
12 -title [append "$title: " [mc "error"]] \
14 if {[winfo ismapped .]} {
20 proc warn_popup {msg} {
22 if {[reponame] ne {}} {
23 append title " ([reponame])"
25 set cmd [list tk_messageBox \
28 -title [append "$title: " [mc "warning"]] \
30 if {[winfo ismapped .]} {
36 proc info_popup {msg {parent .}} {
38 if {[reponame] ne {}} {
39 append title " ([reponame])"
49 proc ask_popup {msg} {
51 if {[reponame] ne {}} {
52 append title " ([reponame])"
54 set cmd [list tk_messageBox \
59 if {[winfo ismapped .]} {
65 proc hook_failed_popup {hook msg {is_fatal 1}} {
70 label $w.m.l1 -text "$hook hook failed:" \
75 -background white -borderwidth 1 \
77 -width 80 -height 10 \
79 -yscrollcommand [list $w.m.sby set]
80 scrollbar $w.m.sby -command [list $w.m.t yview]
81 pack $w.m.l1 -side top -fill x
84 -text [mc "You must correct the above errors before committing."] \
88 pack $w.m.l2 -side bottom -fill x
90 pack $w.m.sby -side right -fill y
91 pack $w.m.t -side left -fill both -expand 1
92 pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
94 $w.m.t insert 1.0 $msg
95 $w.m.t conf -state disabled
97 button $w.ok -text OK \
100 pack $w.ok -side bottom -anchor e -pady 10 -padx 10
102 bind $w <Visibility> "grab $w; focus $w"
103 bind $w <Key-Return> "destroy $w"
104 wm title $w [strcat "[appname] ([reponame]): " [mc "error"]]