1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 16:52:59 +01:00
git/git-gui/lib/error.tcl
Junio C Hamano b8de7f764e Merge branch 'master' of git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui: (50 commits)
  git-gui: Minor refactoring of merge command line in merge support
  git-gui: Use more modern looking icons in the tree browser
  git-gui: Don't offer to stage hunks from untracked files
  git-gui: Make sure remotes are loaded when picking revisions
  git-gui: Use progress bar while resetting/aborting files
  git-gui: Honor core.excludesfile when listing extra files
  git-gui: Unify wording to say "to stage" instead of "to add"
  git-gui: Don't kill modified commit message buffer with merge templates
  git-gui: Remove usernames from absolute SSH urls during merging
  git-gui: Format tracking branch merges as though they were pulls
  git-gui: Cleanup bindings within merge dialog
  git-gui: Replace merge dialog with our revision picker widget
  git-gui: Show ref last update times in revision chooser tooltips
  git-gui: Display commit/tag/remote info in tooltip of revision picker
  git-gui: Save remote urls obtained from config/remotes setup
  git-gui: Avoid unnecessary symbolic-ref call during checkout
  git-gui: Refactor current branch menu items to make i18n easier
  git-gui: Refactor diff popup into a procedure to ease i18n work
  git-gui: Paper bag fix quitting crash after commit
  git-gui: Clarify meaning of add tracked menu option
  ...
2007-07-29 22:53:33 -07:00

104 lines
2.1 KiB
Tcl

# git-gui branch (create/delete) support
# Copyright (C) 2006, 2007 Shawn Pearce
proc error_popup {msg} {
set title [appname]
if {[reponame] ne {}} {
append title " ([reponame])"
}
set cmd [list tk_messageBox \
-icon error \
-type ok \
-title "$title: error" \
-message $msg]
if {[winfo ismapped .]} {
lappend cmd -parent .
}
eval $cmd
}
proc warn_popup {msg} {
set title [appname]
if {[reponame] ne {}} {
append title " ([reponame])"
}
set cmd [list tk_messageBox \
-icon warning \
-type ok \
-title "$title: warning" \
-message $msg]
if {[winfo ismapped .]} {
lappend cmd -parent .
}
eval $cmd
}
proc info_popup {msg {parent .}} {
set title [appname]
if {[reponame] ne {}} {
append title " ([reponame])"
}
tk_messageBox \
-parent $parent \
-icon info \
-type ok \
-title $title \
-message $msg
}
proc ask_popup {msg} {
set title [appname]
if {[reponame] ne {}} {
append title " ([reponame])"
}
set cmd [list tk_messageBox \
-icon question \
-type yesno \
-title $title \
-message $msg]
if {[winfo ismapped .]} {
lappend cmd -parent .
}
eval $cmd
}
proc hook_failed_popup {hook msg} {
set w .hookfail
toplevel $w
frame $w.m
label $w.m.l1 -text "$hook hook failed:" \
-anchor w \
-justify left \
-font font_uibold
text $w.m.t \
-background white -borderwidth 1 \
-relief sunken \
-width 80 -height 10 \
-font font_diff \
-yscrollcommand [list $w.m.sby set]
label $w.m.l2 \
-text {You must correct the above errors before committing.} \
-anchor w \
-justify left \
-font font_uibold
scrollbar $w.m.sby -command [list $w.m.t yview]
pack $w.m.l1 -side top -fill x
pack $w.m.l2 -side bottom -fill x
pack $w.m.sby -side right -fill y
pack $w.m.t -side left -fill both -expand 1
pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
$w.m.t insert 1.0 $msg
$w.m.t conf -state disabled
button $w.ok -text OK \
-width 15 \
-command "destroy $w"
pack $w.ok -side bottom -anchor e -pady 10 -padx 10
bind $w <Visibility> "grab $w; focus $w"
bind $w <Key-Return> "destroy $w"
wm title $w "[appname] ([reponame]): error"
tkwait window $w
}