208 |
CHECK_LIVE_FRAME (frame); |
CHECK_LIVE_FRAME (frame); |
209 |
f = XFRAME (frame); |
f = XFRAME (frame); |
210 |
if (! FRAME_MAC_P (f)) |
if (! FRAME_MAC_P (f)) |
211 |
error ("non-mac frame used"); |
error ("Non-Mac frame used"); |
212 |
return f; |
return f; |
213 |
} |
} |
214 |
|
|
4241 |
NavTypeListHandle fileTypes = NULL; |
NavTypeListHandle fileTypes = NULL; |
4242 |
NavUserAction userAction; |
NavUserAction userAction; |
4243 |
CFStringRef message=NULL, saveName = NULL; |
CFStringRef message=NULL, saveName = NULL; |
4244 |
|
|
4245 |
BLOCK_INPUT; |
BLOCK_INPUT; |
4246 |
/* No need for a callback function because we are modal */ |
/* No need for a callback function because we are modal */ |
4247 |
NavGetDefaultDialogCreationOptions(&options); |
NavGetDefaultDialogCreationOptions(&options); |
4265 |
if (!NILP (only_dir_p)) |
if (!NILP (only_dir_p)) |
4266 |
status = NavCreateChooseFolderDialog(&options, mac_nav_event_callbackUPP, |
status = NavCreateChooseFolderDialog(&options, mac_nav_event_callbackUPP, |
4267 |
NULL, NULL, &dialogRef); |
NULL, NULL, &dialogRef); |
4268 |
else if (NILP (mustmatch)) |
else if (NILP (mustmatch)) |
4269 |
{ |
{ |
4270 |
/* This is a save dialog */ |
/* This is a save dialog */ |
4271 |
options.optionFlags |= kNavDontConfirmReplacement; |
options.optionFlags |= kNavDontConfirmReplacement; |
4272 |
options.actionButtonLabel = CFSTR ("Ok"); |
options.actionButtonLabel = CFSTR ("Ok"); |
4283 |
options.saveFileName = saveName; |
options.saveFileName = saveName; |
4284 |
options.optionFlags |= kNavSelectDefaultLocation; |
options.optionFlags |= kNavSelectDefaultLocation; |
4285 |
} |
} |
4286 |
status = NavCreatePutFileDialog(&options, |
status = NavCreatePutFileDialog(&options, |
4287 |
'TEXT', kNavGenericSignature, |
'TEXT', kNavGenericSignature, |
4288 |
mac_nav_event_callbackUPP, NULL, |
mac_nav_event_callbackUPP, NULL, |
4289 |
&dialogRef); |
&dialogRef); |
4295 |
mac_nav_event_callbackUPP, NULL, |
mac_nav_event_callbackUPP, NULL, |
4296 |
NULL, NULL, &dialogRef); |
NULL, NULL, &dialogRef); |
4297 |
} |
} |
4298 |
|
|
4299 |
/* Set the default location and continue*/ |
/* Set the default location and continue*/ |
4300 |
if (status == noErr) |
if (status == noErr) |
4301 |
{ |
{ |
4307 |
FSSpec defLoc; |
FSSpec defLoc; |
4308 |
status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (dir)), &defLoc); |
status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (dir)), &defLoc); |
4309 |
#endif |
#endif |
4310 |
if (status == noErr) |
if (status == noErr) |
4311 |
{ |
{ |
4312 |
#ifdef MAC_OSX |
#ifdef MAC_OSX |
4313 |
AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); |
AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); |
4359 |
int len = strlen(filename); |
int len = strlen(filename); |
4360 |
if (len && filename[len-1] != '/') |
if (len && filename[len-1] != '/') |
4361 |
filename[len++] = '/'; |
filename[len++] = '/'; |
4362 |
CFStringGetCString(reply.saveFileName, filename+len, |
CFStringGetCString(reply.saveFileName, filename+len, |
4363 |
sizeof (filename) - len, |
sizeof (filename) - len, |
4364 |
#if MAC_OSX |
#if MAC_OSX |
4365 |
kCFStringEncodingUTF8 |
kCFStringEncodingUTF8 |
4387 |
} |
} |
4388 |
|
|
4389 |
UNGCPRO; |
UNGCPRO; |
4390 |
|
|
4391 |
/* Make "Cancel" equivalent to C-g. */ |
/* Make "Cancel" equivalent to C-g. */ |
4392 |
if (NILP (file)) |
if (NILP (file)) |
4393 |
Fsignal (Qquit, Qnil); |
Fsignal (Qquit, Qnil); |
4394 |
|
|
4395 |
return unbind_to (count, file); |
return unbind_to (count, file); |
4396 |
} |
} |
4397 |
|
|