@@ -1751,19 +1751,19 @@ proc show_error {w top msg} {
1751
1751
tkwait window $top
1752
1752
}
1753
1753
1754
- proc error_popup msg {
1754
+ proc error_popup { msg {owner .}} {
1755
1755
set w .error
1756
1756
toplevel $w
1757
- wm transient $w .
1757
+ wm transient $w $owner
1758
1758
show_error $w $w $msg
1759
1759
}
1760
1760
1761
- proc confirm_popup msg {
1761
+ proc confirm_popup { msg {owner .}} {
1762
1762
global confirm_ok
1763
1763
set confirm_ok 0
1764
1764
set w .confirm
1765
1765
toplevel $w
1766
- wm transient $w .
1766
+ wm transient $w $owner
1767
1767
message $w .m -text $msg -justify center -aspect 400
1768
1768
pack $w .m -side top -fill x -padx 20 -pady 20
1769
1769
button $w .ok -text [mc OK] -command " set confirm_ok 1; destroy $w "
@@ -2546,6 +2546,7 @@ proc about {} {
2546
2546
}
2547
2547
toplevel $w
2548
2548
wm title $w [mc " About gitk" ]
2549
+ wm transient $w .
2549
2550
message $w .m -text [mc "
2550
2551
Gitk - a commit viewer for git
2551
2552
@@ -2574,6 +2575,7 @@ proc keys {} {
2574
2575
}
2575
2576
toplevel $w
2576
2577
wm title $w [mc " Gitk key bindings" ]
2578
+ wm transient $w .
2577
2579
message $w .m -text "
2578
2580
[ mc " Gitk key bindings:" ]
2579
2581
@@ -3503,6 +3505,7 @@ proc vieweditor {top n title} {
3503
3505
3504
3506
toplevel $top
3505
3507
wm title $top $title
3508
+ wm transient $top .
3506
3509
label $top .nl -text [mc " Name" ]
3507
3510
entry $top .name -width 20 -textvariable newviewname($n )
3508
3511
grid $top .nl $top .name -sticky w -pady 5
@@ -3572,9 +3575,7 @@ proc newviewok {top n} {
3572
3575
if {[catch {
3573
3576
set newargs [shellsplit $newviewargs($n) ]
3574
3577
} err]} {
3575
- error_popup " [ mc " Error in commit selection arguments:" ] $err "
3576
- wm raise $top
3577
- focus $top
3578
+ error_popup " [ mc " Error in commit selection arguments:" ] $err " $top
3578
3579
return
3579
3580
}
3580
3581
set files {}
@@ -7770,6 +7771,7 @@ proc mkpatch {} {
7770
7771
set patchtop $top
7771
7772
catch {destroy $top }
7772
7773
toplevel $top
7774
+ wm transient $top .
7773
7775
label $top .title -text [mc " Generate patch" ]
7774
7776
grid $top .title - -pady 10
7775
7777
label $top .from -text [mc " From:" ]
@@ -7836,7 +7838,7 @@ proc mkpatchgo {} {
7836
7838
set cmd [lrange $cmd 1 end]
7837
7839
lappend cmd >$fname &
7838
7840
if {[catch {eval exec $cmd } err]} {
7839
- error_popup " [ mc " Error creating patch:" ] $err "
7841
+ error_popup " [ mc " Error creating patch:" ] $err " $patchtop
7840
7842
}
7841
7843
catch {destroy $patchtop }
7842
7844
unset patchtop
@@ -7856,6 +7858,7 @@ proc mktag {} {
7856
7858
set mktagtop $top
7857
7859
catch {destroy $top }
7858
7860
toplevel $top
7861
+ wm transient $top .
7859
7862
label $top .title -text [mc " Create tag" ]
7860
7863
grid $top .title - -pady 10
7861
7864
label $top .id -text [mc " ID:" ]
@@ -7888,18 +7891,18 @@ proc domktag {} {
7888
7891
set id [$mktagtop .sha1 get]
7889
7892
set tag [$mktagtop .tag get]
7890
7893
if {$tag == {}} {
7891
- error_popup [mc " No tag name specified" ]
7892
- return
7894
+ error_popup [mc " No tag name specified" ] $mktagtop
7895
+ return 0
7893
7896
}
7894
7897
if {[info exists tagids($tag )]} {
7895
- error_popup [mc " Tag \" %s\" already exists" $tag ]
7896
- return
7898
+ error_popup [mc " Tag \" %s\" already exists" $tag ] $mktagtop
7899
+ return 0
7897
7900
}
7898
7901
if {[catch {
7899
7902
exec git tag $tag $id
7900
7903
} err]} {
7901
- error_popup " [ mc " Error creating tag:" ] $err "
7902
- return
7904
+ error_popup " [ mc " Error creating tag:" ] $err " $mktagtop
7905
+ return 0
7903
7906
}
7904
7907
7905
7908
set tagids($tag ) $id
@@ -7908,6 +7911,7 @@ proc domktag {} {
7908
7911
addedtag $id
7909
7912
dispneartags 0
7910
7913
run refill_reflist
7914
+ return 1
7911
7915
}
7912
7916
7913
7917
proc redrawtags {id} {
@@ -7946,7 +7950,7 @@ proc mktagcan {} {
7946
7950
}
7947
7951
7948
7952
proc mktaggo {} {
7949
- domktag
7953
+ if {![ domktag]} return
7950
7954
mktagcan
7951
7955
}
7952
7956
@@ -7957,6 +7961,7 @@ proc writecommit {} {
7957
7961
set wrcomtop $top
7958
7962
catch {destroy $top }
7959
7963
toplevel $top
7964
+ wm transient $top .
7960
7965
label $top .title -text [mc " Write commit to file" ]
7961
7966
grid $top .title - -pady 10
7962
7967
label $top .id -text [mc " ID:" ]
@@ -7994,7 +7999,7 @@ proc wrcomgo {} {
7994
7999
set cmd " echo $id | [ $wrcomtop .cmd get] "
7995
8000
set fname [$wrcomtop .fname get]
7996
8001
if {[catch {exec sh -c $cmd >$fname &} err]} {
7997
- error_popup " [ mc " Error writing commit:" ] $err "
8002
+ error_popup " [ mc " Error writing commit:" ] $err " $wrcomtop
7998
8003
}
7999
8004
catch {destroy $wrcomtop }
8000
8005
unset wrcomtop
@@ -8013,6 +8018,7 @@ proc mkbranch {} {
8013
8018
set top .makebranch
8014
8019
catch {destroy $top }
8015
8020
toplevel $top
8021
+ wm transient $top .
8016
8022
label $top .title -text [mc " Create new branch" ]
8017
8023
grid $top .title - -pady 10
8018
8024
label $top .id -text [mc " ID:" ]
@@ -8044,12 +8050,12 @@ proc mkbrgo {top} {
8044
8050
set cmdargs {}
8045
8051
set old_id {}
8046
8052
if {$name eq {}} {
8047
- error_popup [mc " Please specify a name for the new branch" ]
8053
+ error_popup [mc " Please specify a name for the new branch" ] $top
8048
8054
return
8049
8055
}
8050
8056
if {[info exists headids($name )]} {
8051
8057
if {![confirm_popup [mc \
8052
- " Branch '%s' already exists. Overwrite?" $name ]]} {
8058
+ " Branch '%s' already exists. Overwrite?" $name ] $top ]} {
8053
8059
return
8054
8060
}
8055
8061
set old_id $headids($name)
@@ -8310,6 +8316,7 @@ proc showrefs {} {
8310
8316
}
8311
8317
toplevel $top
8312
8318
wm title $top [mc " Tags and heads: %s" [file tail [pwd ]]]
8319
+ wm transient $top .
8313
8320
text $top .list -background $bgcolor -foreground $fgcolor \
8314
8321
-selectbackground $selectbgcolor -font mainfont \
8315
8322
-xscrollcommand " $top .xsb set" -yscrollcommand " $top .ysb set" \
@@ -9637,6 +9644,7 @@ proc mkfontdisp {font top which} {
9637
9644
9638
9645
proc choosefont {font which} {
9639
9646
global fontparam fontlist fonttop fontattr
9647
+ global prefstop
9640
9648
9641
9649
set fontparam(which) $which
9642
9650
set fontparam(font) $font
@@ -9650,6 +9658,7 @@ proc choosefont {font which} {
9650
9658
font create sample
9651
9659
eval font config sample [font actual $font ]
9652
9660
toplevel $top
9661
+ wm transient $top $prefstop
9653
9662
wm title $top [mc " Gitk font chooser" ]
9654
9663
label $top .l -textvariable fontparam(which)
9655
9664
pack $top .l -side top
@@ -9766,6 +9775,7 @@ proc doprefs {} {
9766
9775
}
9767
9776
toplevel $top
9768
9777
wm title $top [mc " Gitk preferences" ]
9778
+ wm transient $top .
9769
9779
label $top .ldisp -text [mc " Commit list display options" ]
9770
9780
grid $top .ldisp - -sticky w -pady 10
9771
9781
label $top .spacer -text " "
0 commit comments