diff options
author | dgp <dgp@users.sourceforge.net> | 2011-10-24 19:13:06 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-10-24 19:13:06 (GMT) |
commit | bb5cf6ea1f9419bc18120ac76132162637a2941f (patch) | |
tree | 60ca719972f2b0a192c74284ab2f242fc3acc665 /library | |
parent | 01c75a2daa79c567fcf465599497d37cf16451ae (diff) | |
parent | 4136000e1510b2c72b2e60eaef06bf08c6c6c7e5 (diff) | |
download | tk-bb5cf6ea1f9419bc18120ac76132162637a2941f.zip tk-bb5cf6ea1f9419bc18120ac76132162637a2941f.tar.gz tk-bb5cf6ea1f9419bc18120ac76132162637a2941f.tar.bz2 |
Implementation of TIP #382.
Diffstat (limited to 'library')
-rw-r--r-- | library/tkfbox.tcl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 4ccf3d7..78112e1 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -983,6 +983,12 @@ proc ::tk::dialog::file::Config {dataName type argList} { lappend specs {-multiple "" "" "0"} } + # The "-confirmoverwrite" option is only for the "save" file dialog. + # + if {$type eq "save"} { + lappend specs {-confirmoverwrite "" "" "1"} + } + # 2: default values depending on the type of the dialog # if {![info exists data(selectPath)]} { @@ -1859,7 +1865,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { set Priv(selectFile) $data(selectFile) set Priv(selectPath) $data(selectPath) - if {($data(type) eq "save") && [file exists $selectFilePath]} { + if {($data(type) eq "save") && $data(-confirmoverwrite) && [file exists $selectFilePath]} { set reply [tk_messageBox -icon warning -type yesno -parent $w \ -message [mc "File \"%1\$s\" already exists.\nDo you want\ to overwrite it?" $selectFilePath]] |