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 "$title: 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 "$title: 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
} {
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]
81 -text {You must correct the above errors before committing.
} \
85 scrollbar $w.m.sby
-command [list $w.m.t yview
]
86 pack $w.m.l1
-side top
-fill x
87 pack $w.m.l2
-side bottom
-fill x
88 pack $w.m.sby
-side right
-fill y
89 pack $w.m.t
-side left
-fill both
-expand 1
90 pack $w.m
-side top
-fill both
-expand 1 -padx 5 -pady 10
92 $w.m.t insert
1.0 $msg
93 $w.m.t conf
-state disabled
95 button $w.ok
-text OK
\
98 pack $w.ok
-side bottom
-anchor e
-pady 10 -padx 10
100 bind $w <Visibility
> "grab $w; focus $w"
101 bind $w <Key-Return
> "destroy $w"
102 wm title
$w "[appname] ([reponame]): error"