diff options
author | dgp <dgp@users.sourceforge.net> | 2011-10-24 20:19:53 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-10-24 20:19:53 (GMT) |
commit | 909bd1bfd3cc4e9417d6b88db188d45d333eb59c (patch) | |
tree | 21882a58c5fea65f78c0d68bc02f0796eb8a810a /macosx | |
parent | d8ed83fceaae08242beebd0afb2ac5c1bcad6f05 (diff) | |
download | tk-909bd1bfd3cc4e9417d6b88db188d45d333eb59c.zip tk-909bd1bfd3cc4e9417d6b88db188d45d333eb59c.tar.gz tk-909bd1bfd3cc4e9417d6b88db188d45d333eb59c.tar.bz2 |
TIP 382: Existence and argument validation for -confirmoverwrite on Cocoa.
Option is ignored for now.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 11 |
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) { |