summaryrefslogtreecommitdiffstats
path: root/library/tkfbox.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-10-24 19:36:08 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-10-24 19:36:08 (GMT)
commit112ebcbc5cd80b9a40494e9733b8c89559d25969 (patch)
tree53d88728b4e76bfba87436db447585566b576a24 /library/tkfbox.tcl
parent309c83889bb8812f0501ac4c7349aef9adf44771 (diff)
parent11fa39bc28e728fe9bfbf4a0ef4b24025c323c4d (diff)
downloadtk-112ebcbc5cd80b9a40494e9733b8c89559d25969.zip
tk-112ebcbc5cd80b9a40494e9733b8c89559d25969.tar.gz
tk-112ebcbc5cd80b9a40494e9733b8c89559d25969.tar.bz2
Merge TIP 382 implementation to trunk. Still need Carbon migration & Cocoa.
Diffstat (limited to 'library/tkfbox.tcl')
-rw-r--r--library/tkfbox.tcl8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index 4cdcaf3..6354300 100644
--- a/library/tkfbox.tcl
+++ b/library/tkfbox.tcl
@@ -266,6 +266,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)]} {
@@ -1121,7 +1127,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]]