Skip to content

Commit 225a649

Browse files
committed
Merge branch 'git-gui-askyesno'
These changes are necessary to support better Git for Windows' new auto-update feature. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents d064b7d + 8b10c79 commit 225a649

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

git-gui/git-gui--askyesno

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ if {$use_ttk} {
1212
set NS ttk
1313
}
1414

15+
set title "Question?"
1516
if {$argc < 1} {
1617
puts stderr "Usage: $argv0 <question>"
1718
exit 1
1819
} else {
20+
if {$argc > 2 && [lindex $argv 0] == "--title"} {
21+
set title [lindex $argv 1]
22+
set argv [lreplace $argv 0 1]
23+
}
1924
set prompt [join $argv " "]
2025
}
2126

2227
${NS}::frame .t
23-
${NS}::label .t.m -text $prompt -justify center -width 40
24-
.t.m configure -wraplength 400
28+
${NS}::label .t.m -text $prompt -justify center -width 400px
29+
.t.m configure -wraplength 400px
2530
pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1
2631
pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1
2732

@@ -47,5 +52,17 @@ proc yes {} {
4752
exit 0
4853
}
4954

50-
wm title . "Question?"
55+
if {$::tcl_platform(platform) eq {windows}} {
56+
set icopath [file dirname [file normalize $argv0]]
57+
if {[file tail $icopath] eq {git-core}} {
58+
set icopath [file dirname $icopath]
59+
}
60+
set icopath [file dirname $icopath]
61+
set icopath [file join $icopath share git git-for-windows.ico]
62+
if {[file exists $icopath]} {
63+
wm iconbitmap . -default $icopath
64+
}
65+
}
66+
67+
wm title . $title
5168
tk::PlaceWindow .

0 commit comments

Comments
 (0)