Skip to content
Permalink
Browse files

Merge branch 'git-gui-askyesno'

These changes are necessary to support better Git for Windows' new
auto-update feature.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Sep 20, 2017
2 parents 03faabc + 8fbe234 commit f2dea585d74c76ae9a1e05580b3df7817489cd02
Showing with 20 additions and 3 deletions.
  1. +20 −3 git-gui/git-gui--askyesno
@@ -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

@@ -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 f2dea58

Please sign in to comment.
You can’t perform that action at this time.