summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-10-04 17:53:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-10-04 17:53:34 (GMT)
commit7571c73ea570497dcb0c8900ba99fcef9f4cbbfe (patch)
tree5b4bc1f3f667dfcaf144b9a436b6a296ed6ede81 /library
parentc5559b85ac1478f163c844afcb1842e5ef906278 (diff)
downloadtk-7571c73ea570497dcb0c8900ba99fcef9f4cbbfe.zip
tk-7571c73ea570497dcb0c8900ba99fcef9f4cbbfe.tar.gz
tk-7571c73ea570497dcb0c8900ba99fcef9f4cbbfe.tar.bz2
Contributed implementation patch for TIP 382.
Diffstat (limited to 'library')
-rw-r--r--library/tkfbox.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index 4ccf3d7..ffffb3e 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 "-nocomplain" option is only available for the "save" file dialog.
+ #
+ if {$type eq "save"} {
+ lappend specs {-nocomplain "" "" "0"}
+ }
+
# 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(-nocomplain) && [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]]