summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-10-24 20:19:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-10-24 20:19:53 (GMT)
commitc06f0fc17c7c109a25877cdbd0d274620bae5aa9 (patch)
tree21882a58c5fea65f78c0d68bc02f0796eb8a810a
parent2ad1d6bb19a2879aa59d1bde7ecc6a5737e593a8 (diff)
downloadtk-c06f0fc17c7c109a25877cdbd0d274620bae5aa9.zip
tk-c06f0fc17c7c109a25877cdbd0d274620bae5aa9.tar.gz
tk-c06f0fc17c7c109a25877cdbd0d274620bae5aa9.tar.bz2
TIP 382: Existence and argument validation for -confirmoverwrite on Cocoa.
Option is ignored for now.
-rw-r--r--macosx/tkMacOSXDialog.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index a5138ad..23b3de5 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -33,11 +33,13 @@ enum openOptions {
};
static const char *const saveOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-message", "-parent", "-title", "-typevariable", "-command", NULL
+ "-message", "-parent", "-title", "-typevariable", "-command",
+ "-confirmoverwrite", NULL
};
enum saveOptions {
SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE,
SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, SAVE_COMMAND,
+ SAVE_CONFIRMOW
};
static const char *const chooseOptionStrings[] = {
"-initialdir", "-message", "-mustexist", "-parent", "-title", "-command",
@@ -534,6 +536,7 @@ Tk_GetSaveFileObjCmd(
Tk_Window tkwin = clientData;
char *str;
int i, result = TCL_ERROR, haveParentOption = 0;
+ int confirmOverwrite = 1;
int index, len;
FileFilterList fl;
Tcl_Obj *cmdObj = NULL;
@@ -613,6 +616,12 @@ Tk_GetSaveFileObjCmd(
case SAVE_COMMAND:
cmdObj = objv[i+1];
break;
+ case SAVE_CONFIRMOW:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1],
+ &confirmOverwrite) != TCL_OK) {
+ goto end;
+ }
+ break;
}
}
if (fl.filters || defaultType) {