mirror of
https://github.com/git/git.git
synced 2024-12-01 05:54:16 +08:00
3eae308700
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJYCJqmAAoJEDn3Aot9nM55uKQP/11BTzhOr9K3SLzwCr01ylGP 94AOA511vx3fIX5aWQ29S96tGbluo73RdbVsWFKKJcKSErpFPscFEiRkyjeMXE2T yWWOPOg08tm28ppZNp0Kqjb8VykUUKuG6gVT59DNFUZUqHYQbiQy+t8nwT+Qow3U dvo6lksovfSaW2FORWIi5KF5gD4v2F9qsbFgr725a8UoBrOmF0SWaCG4/ZYj0WxF 0rq8LjpvmMuQqd06DAoGMIsHa71R61En2QWfJ4YoE5+QRq8wQl37FmX+ojiA1rzY CG/vJO2Tw4v54wHKK1TCXG7LR4JhTcQZOa6zd8HHsPRn+viGDCMVUG9uMewfxH+m F47EVMxiKf0subm3fUhycqkvso0r6mOAddhz47RKT7tqU4XOnhPyGw0x6m7evawg Sz2+fOK3wwX2Qec5o3vBZKaEcOftSrLuZmbi5/j43crvcf+OAs9s/jdq/Ulpkks2 JI2i0DLzHABTbDn6QsuysEZnituks8T8Fdm5NOldritgBNVY81ifatekFscxt6Ct OrT9eGJk6iZiX1RvS+R7wykKJCBkxiyHqM8vSj5tPWjApgtnopPMudzNX41geaL9 ADeb8LVMTTNL/md8KED0deypilcPNnPbW035rAbyCpAsKbtgO3zdfzdzxsQ+dIvc MQpCDP5QPPr3toRVdNmb =VyhL -----END PGP SIGNATURE----- Merge tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui git-gui 0.21.0 * tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui: (22 commits) git-gui: set version 0.21 git-gui: Mark 'All' in remote.tcl for translation git-gui i18n: Updated Bulgarian translation (565,0f,0u) git-gui: avoid persisting modified author identity git-gui: handle the encoding of Git's output correctly git-gui: unicode file name support on windows git-gui: Update Russian translation git-gui: maintain backwards compatibility for merge syntax git-gui i18n: mark string in lib/error.tcl for translation git-gui: fix incorrect use of Tcl append command git-gui i18n: mark "usage:" strings for translation git-gui i18n: internationalize use of colon punctuation git-gui: ensure the file in the diff pane is in the list of selected files git-gui: support for $FILENAMES in tool definitions git-gui: fix initial git gui message encoding git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut` git-gui: fix detection of Cygwin Amend tab ordering and text widget border and highlighting. Allow keyboard control to work in the staging widgets. ...
120 lines
2.5 KiB
Tcl
120 lines
2.5 KiB
Tcl
# git-gui branch (create/delete) support
|
|
# Copyright (C) 2006, 2007 Shawn Pearce
|
|
|
|
proc _error_parent {} {
|
|
set p [grab current .]
|
|
if {$p eq {}} {
|
|
return .
|
|
}
|
|
return $p
|
|
}
|
|
|
|
proc error_popup {msg} {
|
|
set title [appname]
|
|
if {[reponame] ne {}} {
|
|
append title " ([reponame])"
|
|
}
|
|
set cmd [list tk_messageBox \
|
|
-icon error \
|
|
-type ok \
|
|
-title [mc "%s: error" $title] \
|
|
-message $msg]
|
|
if {[winfo ismapped [_error_parent]]} {
|
|
lappend cmd -parent [_error_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 [mc "%s: warning" $title] \
|
|
-message $msg]
|
|
if {[winfo ismapped [_error_parent]]} {
|
|
lappend cmd -parent [_error_parent]
|
|
}
|
|
eval $cmd
|
|
}
|
|
|
|
proc info_popup {msg} {
|
|
set title [appname]
|
|
if {[reponame] ne {}} {
|
|
append title " ([reponame])"
|
|
}
|
|
tk_messageBox \
|
|
-parent [_error_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 [_error_parent]]} {
|
|
lappend cmd -parent [_error_parent]
|
|
}
|
|
eval $cmd
|
|
}
|
|
|
|
proc hook_failed_popup {hook msg {is_fatal 1}} {
|
|
global use_ttk NS
|
|
set w .hookfail
|
|
Dialog $w
|
|
wm withdraw $w
|
|
|
|
${NS}::frame $w.m
|
|
${NS}::label $w.m.l1 -text [mc "%s hook failed:" $hook] \
|
|
-anchor w \
|
|
-justify left \
|
|
-font font_uibold
|
|
text $w.m.t \
|
|
-background white \
|
|
-foreground black \
|
|
-borderwidth 1 \
|
|
-relief sunken \
|
|
-width 80 -height 10 \
|
|
-font font_diff \
|
|
-yscrollcommand [list $w.m.sby set]
|
|
${NS}::scrollbar $w.m.sby -command [list $w.m.t yview]
|
|
pack $w.m.l1 -side top -fill x
|
|
if {$is_fatal} {
|
|
${NS}::label $w.m.l2 \
|
|
-text [mc "You must correct the above errors before committing."] \
|
|
-anchor w \
|
|
-justify left \
|
|
-font font_uibold
|
|
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
|
|
|
|
${NS}::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 [mc "%s (%s): error" [appname] [reponame]]
|
|
wm deiconify $w
|
|
tkwait window $w
|
|
}
|