summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-10-31 19:37:01 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-10-31 19:37:01 (GMT)
commit613cdc3f013a460948fdc0b87f067356d05b8aa8 (patch)
tree9ee5a0e6e1019258df7e9d66b7cd1c1011468ad3
parent1b7908df0ceb3fbe77a732b14ae7270e9f14d2d5 (diff)
parent6e979156d6fa9009b6b5cd3bce6904fcdbaf4fa2 (diff)
downloadtk-613cdc3f013a460948fdc0b87f067356d05b8aa8.zip
tk-613cdc3f013a460948fdc0b87f067356d05b8aa8.tar.gz
tk-613cdc3f013a460948fdc0b87f067356d05b8aa8.tar.bz2
merge to release
-rw-r--r--library/xmfbox.tcl6
-rw-r--r--tests/filebox.test2
2 files changed, 6 insertions, 2 deletions
diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl
index d511462..0cbf251 100644
--- a/library/xmfbox.tcl
+++ b/library/xmfbox.tcl
@@ -246,8 +246,12 @@ proc ::tk::MotifFDialog_Config {dataName type argList} {
if {$type eq "open"} {
lappend specs {-multiple "" "" "0"}
}
+ if {$type eq "save"} {
+ lappend specs {-confirmoverwrite "" "" "1"}
+ }
set data(-multiple) 0
+ set data(-confirmoverwrite) 1
# 2: default values depending on the type of the dialog
#
if {![info exists data(selectPath)]} {
@@ -847,7 +851,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} {
-message [mc {File "%1$s" does not exist.} $item]
return
}
- } elseif {$data(type) eq "save"} {
+ } elseif {$data(type) eq "save" && $data(-confirmoverwrite)} {
set message [format %s%s \
[mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \
[mc {Replace existing file?}]]
diff --git a/tests/filebox.test b/tests/filebox.test
index bbd468b..7b9fa2c 100644
--- a/tests/filebox.test
+++ b/tests/filebox.test
@@ -111,7 +111,7 @@ if {$tcl_platform(platform) == "unix"} {
}
set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
-set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable}
+set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -confirmoverwrite, -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable}
set tmpFile "filebox.tmp"
makeFile {