Skip to content

Commit

Permalink
Merge branch 'git-gui-askyesno'
Browse files Browse the repository at this point in the history
These changes are necessary to support better Git for Windows' new
auto-update feature.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Jan 7, 2025
2 parents 4065da8 + 1ee5d70 commit d40c45a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions git-gui/git-gui--askyesno
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ if {$use_ttk} {
set NS ttk
}

set title "Question?"
if {$argc < 1} {
puts stderr "Usage: $argv0 <question>"
exit 1
} else {
if {$argc > 2 && [lindex $argv 0] == "--title"} {
set title [lindex $argv 1]
set argv [lreplace $argv 0 1]
}
set prompt [join $argv " "]
}

${NS}::frame .t
${NS}::label .t.m -text $prompt -justify center -width 40
.t.m configure -wraplength 400
${NS}::label .t.m -text $prompt -justify center -width 400px
.t.m configure -wraplength 400px
pack .t.m -side top -fill x -padx 20 -pady 20 -expand 1
pack .t -side top -fill x -ipadx 20 -ipady 20 -expand 1

Expand All @@ -47,5 +52,17 @@ proc yes {} {
exit 0
}

wm title . "Question?"
if {$::tcl_platform(platform) eq {windows}} {
set icopath [file dirname [file normalize $argv0]]
if {[file tail $icopath] eq {git-core}} {
set icopath [file dirname $icopath]
}
set icopath [file dirname $icopath]
set icopath [file join $icopath share git git-for-windows.ico]
if {[file exists $icopath]} {
wm iconbitmap . -default $icopath
}
}

wm title . $title
tk::PlaceWindow .

0 comments on commit d40c45a

Please sign in to comment.