|
From: creedon <icr...@us...> - 2005-10-07 04:07:50
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7109 Modified Files: filedialog.c shellfile.c fileverbs.c Log Message: cranked version so scripts can make check against version and decide to run or not mac, corrected bug in the way the recently changed get file dialogs were behaving in v10.1a4 and the commercial Suite replacement, one couldn't select an application see http://sourceforge.net/tracker/index.php?func=detail&aid=1315418&group_id=120666&atid=687798 Index: shellfile.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/shellfile.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shellfile.c 16 Sep 2005 01:55:50 -0000 1.6 --- shellfile.c 7 Oct 2005 04:07:42 -0000 1.7 *************** *** 321,325 **** getstringlist (defaultlistnumber, nonstartupfileprompt, bs); ! if (!sfdialog (sfgetfileverb, bs, ptypes, &fspec)) return (false); --- 321,325 ---- getstringlist (defaultlistnumber, nonstartupfileprompt, bs); ! if (!sfdialog (sfgetfileverb, bs, ptypes, &fspec, 'LAND')) /* 2005-10-06 creedon - added 'LAND' */ return (false); *************** *** 635,639 **** } ! fl = sfdialog (sfputfileverb, nil, &filetypes, &fs); } --- 635,639 ---- } ! fl = sfdialog (sfputfileverb, nil, &filetypes, &fs, 'LAND'); /* 2005-10-06 creedon - added 'LAND' */ } *************** *** 761,765 **** filetypes.types [0] = config.filetype; ! if (!sfdialog (sfputfileverb, nil, &filetypes, &fspec)) /*user canceled*/ return (false); } --- 761,765 ---- filetypes.types [0] = config.filetype; ! if (!sfdialog (sfputfileverb, nil, &filetypes, &fspec, 'LAND')) /* 2005-10-06 creedon - added 'LAND' */ /*user canceled*/ return (false); } Index: fileverbs.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/fileverbs.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fileverbs.c 16 Sep 2005 01:55:50 -0000 1.6 --- fileverbs.c 7 Oct 2005 04:07:42 -0000 1.7 *************** *** 709,723 **** /* ! put up one of the "standard file" dialogs. if sfverb is sfputfileverb we use the ! "put" dialog, otherwise the "get" dialog. ! we take at least one parameter -- the name of a variable to receive the full ! path specified by the user. if it's the getfile dialog, we take a second parameter -- it indicates the type of the file. ! 12/27/91 dmb: in all cases, check the current value of the filename variable, ! and pass it on to sf dialog so it can potentially set default directory. */ --- 709,722 ---- /* ! put up one of the "standard file" dialogs. if sfverb is sfputfileverb we use the "put" dialog, otherwise the "get" dialog. ! we take at least one parameter -- the name of a variable to receive the full path specified by the user. if it's the getfile dialog, we take a second parameter -- it indicates the type of the file. ! 2005-10-06 creedon: added creator parameter ! ! 12/27/91 dmb: in all cases, check the current value of the filename variable, and pass it on to sf dialog so it can potentially set default directory. */ *************** *** 730,734 **** hdlhashtable htable; boolean fl; ! OSType ostype; bigstring bsext; hdlhashnode hnode; --- 729,733 ---- hdlhashtable htable; boolean fl; ! OSType ostype, oscreator = kNavGenericSignature; bigstring bsext; hdlhashnode hnode; *************** *** 743,752 **** return (false); ! if (sfverb == sfgetfileverb) { /*get an extra parameter for getfile dialog, indicating filetype*/ flnextparamislast = true; ! if (!gettypelistvalue (hparam1, 3, &filetypes, &typelist)) return (false); } --- 742,763 ---- return (false); ! if (sfverb == sfgetfileverb) { /* get extra parameters for get file dialog, indicating file type(s) and file creator */ + short ctconsumed = 3; + short ctpositional = 3; + tyvaluerecord val; + + if (!gettypelistvalue (hparam1, 3, &filetypes, &typelist)) + return (false); + flnextparamislast = true; ! setostypevalue (oscreator, &val); ! ! if (!getoptionalparamvalue (hparam1, &ctconsumed, &ctpositional, "\x07""creator", &val)) return (false); + + oscreator = val.data.ostypevalue; + } *************** *** 756,760 **** if (idstringvalue (htable, bsvarname, bsfname)) filecheckdefaultpath (bsfname); - */ --- 767,770 ---- *************** *** 785,789 **** setbooleanvalue (false, vreturned); ! if (!sfdialog (sfverb, bsprompt, typelist, &fs)) /*user hit cancel*/ return (true); --- 795,799 ---- setbooleanvalue (false, vreturned); ! if (!sfdialog (sfverb, bsprompt, typelist, &fs, oscreator)) /*user hit cancel*/ return (true); Index: filedialog.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/filedialog.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** filedialog.c 29 Sep 2005 21:36:29 -0000 1.6 --- filedialog.c 7 Oct 2005 04:07:42 -0000 1.7 *************** *** 451,455 **** ! boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec) { /* --- 451,455 ---- ! boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec, OSType filecreator) { /* *************** *** 459,494 **** as a bonus, we return the full path for the selected file in the path string. ! 8/1/90 dmb: if filetype is zero, show all files by passing zero to SFGetFile ! 11/16/90 dmb: replace flput boolean with sfverb enum. added code for folder ! and disk selection dialogs ! 4/16/91 dmb: replaced filetype parameter with pointer to type list. callers ! can pass nil when irrelevant, or when all types are to be shown. ! 12/27/91 dmb: if the default fname includes a colon, attempt to set default ! directory, and remove folder specification from dialog default ! 2/10/92 dmb: added call to new shellactivate; standard file breaks when brought ! up in the background. ! 9/15/92 dmb: when picking a folder, grab path from sfstring instead of reply ! record. 12/18/92 dmb: call shellwritescrap ! 6/11/93 dmb: recoded to System 7 Standard File ! 2.1b1 dmb: set sfdata.sfname to an impossible value to ensure button update ! 2.1b2 dmb: updated interface to be filespec-based. for putfile, the name in the ! filespec is the default name. for all verbs, a non-empty filespec seeds the dialog ! 4.1b13 dmb: un-commented out the shellwritescrap and shellactive calls. ! I don't know how they got commented; I must have been experimenting with ! something. ! //Code change by Timothy Paustian Tuesday, June 20, 2000 8:50:41 PM ! //I am going to hack the heck out of this routine. See what you think */ --- 459,497 ---- as a bonus, we return the full path for the selected file in the path string. ! 2005-10-06 creedon: added filecreator parameter, used for get file dialog ! 2005-09-21 creedon: changed from TimsGetFile to getafile ! Tuesday, June 20, 2000 8:50:41 PM Timothy Paustian: I am going to hack the heck out of this routine. See what you think ! 4.1b13 dmb: un-commented out the shellwritescrap and shellactive calls. ! I don't know how they got commented; I must have been experimenting with ! something. ! 2.1b2 dmb: updated interface to be filespec-based. for putfile, the name in the ! filespec is the default name. for all verbs, a non-empty filespec seeds the dialog ! 2.1b1 dmb: set sfdata.sfname to an impossible value to ensure button update ! ! 6/11/93 dmb: recoded to System 7 Standard File 12/18/92 dmb: call shellwritescrap ! 9/15/92 dmb: when picking a folder, grab path from sfstring instead of reply ! record. ! 2/10/92 dmb: added call to new shellactivate; standard file breaks when brought ! up in the background. ! 12/27/91 dmb: if the default fname includes a colon, attempt to set default ! directory, and remove folder specification from dialog default ! 4/16/91 dmb: replaced filetype parameter with pointer to type list. callers ! can pass nil when irrelevant, or when all types are to be shown. ! 11/16/90 dmb: replace flput boolean with sfverb enum. added code for folder ! and disk selection dialogs ! ! 8/1/90 dmb: if filetype is zero, show all files by passing zero to SFGetFile */ *************** *** 558,562 **** case sfgetfileverb: if(gCanUseNavServ) ! anErr = getafile (bsprompt, filetypes, &sfdata.sfreply); /* 2005-09-21 creedon - changed from TimsGetFile to getafile*/ #if !TARGET_API_MAC_CARBON else --- 561,565 ---- case sfgetfileverb: if(gCanUseNavServ) ! anErr = getafile (bsprompt, filetypes, &sfdata.sfreply, filecreator); #if !TARGET_API_MAC_CARBON else *************** *** 650,659 **** ! boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec) { /* ! 5.0.1 dmb: make sure default file and directory are valid, or we'll fail (silently) ! 5.0.2b4 dmb: fixed bug in above change that would generate an error for empty paths */ --- 653,666 ---- ! boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec, OSType filecreator) { ! ! #pragma unused (filecreator) /* ! 2005-10-06 creedon: added filecreator, unused on Windows ! 5.0.2b4 dmb: fixed bug in above change that would generate an error for empty paths + + 5.0.1 dmb: make sure default file and directory are valid, or we'll fail (silently) */ *************** *** 1054,1060 **** ! OSErr getafile (bigstring prompt, ptrsftypelist filetypes, StandardFileReply * outReply) { ! /* 2005-09-21 creedon: created, cribbed from TimsGetFile */ NavDialogCreationOptions dialogOptions; --- 1061,1071 ---- ! OSErr getafile (bigstring prompt, ptrsftypelist filetypes, StandardFileReply * outReply, OSType filecreator) { ! /* ! 2005-10-06 creedon: added filecreator parameter ! ! 2005-09-21 creedon: created, cribbed from TimsGetFile ! */ NavDialogCreationOptions dialogOptions; *************** *** 1091,1104 **** newhandle (hSize, (Handle*) &typeList); typesP = (NavTypeListPtr) *((Handle) typeList); - OSType creator = 'LAND'; - - if (filetypes->cttypes <= 1) - creator = kNavGenericSignature; ! typesP->componentSignature = creator; typesP->reserved = 0; typesP->osTypeCount = filetypes->cttypes; ! BlockMoveData(&(filetypes->types), typesP->osType, (Size) (sizeof(OSType) * filetypes->cttypes)); } --- 1102,1111 ---- newhandle (hSize, (Handle*) &typeList); typesP = (NavTypeListPtr) *((Handle) typeList); ! typesP->componentSignature = filecreator; typesP->reserved = 0; typesP->osTypeCount = filetypes->cttypes; ! BlockMoveData (&(filetypes->types), typesP->osType, (Size) (sizeof (OSType) * filetypes->cttypes)); } *************** *** 1115,1125 **** Size actualSize; FSSpec documentFSSpec; ! ! // Get a pointer to selected file ! anErr = AEGetNthPtr (&(reply.selection), 1, ! typeFSS, &theKeyword, ! &actualType, &documentFSSpec, ! sizeof (documentFSSpec), ! &actualSize); assert (actualType == typeFSS); --- 1122,1127 ---- Size actualSize; FSSpec documentFSSpec; ! ! anErr = AEGetNthPtr (&(reply.selection), 1, typeFSS, &theKeyword, &actualType, &documentFSSpec, sizeof (documentFSSpec), &actualSize); // get a pointer to selected file assert (actualType == typeFSS); |