X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=gitk;h=101cf9bd9ff8c3b8180ab50e6ceb4655576f9fbf;hb=ad0e0b0a31c4e7a7a893ea68fd4ee92aebb79988;hp=74278568ec2be18bf5c08830b6e273e0229da475;hpb=8974c6f93e62cd4b6ffe93562a6569b8920a89a3;p=git.git diff --git a/gitk b/gitk index 74278568..101cf9bd 100755 --- a/gitk +++ b/gitk @@ -357,21 +357,21 @@ proc readrefs {} { close $refd } -proc show_error {w msg} { +proc show_error {w top msg} { message $w.m -text $msg -justify center -aspect 400 pack $w.m -side top -fill x -padx 20 -pady 20 - button $w.ok -text OK -command "destroy $w" + button $w.ok -text OK -command "destroy $top" pack $w.ok -side bottom -fill x - bind $w "grab $w; focus $w" - bind $w "destroy $w" - tkwait window $w + bind $top "grab $top; focus $top" + bind $top "destroy $top" + tkwait window $top } proc error_popup msg { set w .error toplevel $w wm transient $w . - show_error $w $msg + show_error $w $w $msg } proc makewindow {} { @@ -4917,7 +4917,7 @@ foreach arg $argv { # check that we can find a .git directory somewhere... set gitdir [gitdir] if {![file isdirectory $gitdir]} { - show_error . "Cannot find the git directory \"$gitdir\"." + show_error {} . "Cannot find the git directory \"$gitdir\"." exit 1 } @@ -4937,9 +4937,9 @@ if {$i >= 0} { # so look for "fatal:". set i [string first "fatal:" $err] if {$i > 0} { - set err [string range [expr {$i + 6}] end] + set err [string range $err [expr {$i + 6}] end] } - show_error . "Bad arguments to gitk:\n$err" + show_error {} . "Bad arguments to gitk:\n$err" exit 1 } }