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 return [tk_messageBox \
62 proc hook_failed_popup
{hook msg
} {
67 label $w.m.l1
-text "$hook hook failed:" \
72 -background white
-borderwidth 1 \
74 -width 80 -height 10 \
76 -yscrollcommand [list $w.m.sby
set]
78 -text {You must correct the above errors before committing.
} \
82 scrollbar $w.m.sby
-command [list $w.m.t yview
]
83 pack $w.m.l1
-side top
-fill x
84 pack $w.m.l2
-side bottom
-fill x
85 pack $w.m.sby
-side right
-fill y
86 pack $w.m.t
-side left
-fill both
-expand 1
87 pack $w.m
-side top
-fill both
-expand 1 -padx 5 -pady 10
89 $w.m.t insert
1.0 $msg
90 $w.m.t conf
-state disabled
92 button $w.ok
-text OK
\
95 pack $w.ok
-side bottom
-anchor e
-pady 10 -padx 10
97 bind $w <Visibility
> "grab $w; focus $w"
98 bind $w <Key-Return
> "destroy $w"
99 wm title
$w "[appname] ([reponame]): error"