|
From: <cre...@us...> - 2006-08-27 02:19:45
|
Revision: 1486 Author: creecode Date: 2006-08-26 19:19:41 -0700 (Sat, 26 Aug 2006) ViewCVS: http://svn.sourceforge.net/frontierkernel/?rev=1486&view=rev Log Message: ----------- in shell(new/open)file functions on Mac, set the proxy icon to LAND/TABL in function shellsaveas on Mac, add object type extension to file name in function shellnew on Mac, add ".root" extension to file name Modified Paths: -------------- Frontier/branches/FSRef_Migration/Common/source/shellfile.c Modified: Frontier/branches/FSRef_Migration/Common/source/shellfile.c =================================================================== --- Frontier/branches/FSRef_Migration/Common/source/shellfile.c 2006-08-25 23:39:13 UTC (rev 1485) +++ Frontier/branches/FSRef_Migration/Common/source/shellfile.c 2006-08-27 02:19:41 UTC (rev 1486) @@ -120,8 +120,10 @@ // // open the specified file in a new window. // - // 2006-06-23 creedon: for Mac, FSRef-ized + // 2006-08-26 creedon: for Mac, FSRef-ized // + // for Mac, set the proxy icon to LAND/TABL + // // 6.0a11 dmb: fixed wnew handling for already-open windows // // 3.0.2 dmb: if asked to open a file that's already open in a root window, just bring it to the front and return true @@ -225,6 +227,12 @@ if (!newfilewindow (fs, fnum, rnum, flhidden, &w)) goto error; + #ifdef MACVERSION + + SetWindowProxyCreatorAndType ( w, 'LAND', 'TABL', kOnSystemDisk ); + + #endif + if (wnew != nil) *wnew = w; @@ -603,8 +611,10 @@ // // if bspath is nil, use standard file to determine the new file location // - // 2006-06-23 creedon: for Mac FSRef-ized + // 2006-08-26 creedon: for Mac, FSRef-ized // + // for Mac, add object type extension to file name + // // 5.0d8 dmb: pass file type to sfdialog for Win // // 1991-12-12 dmb: make sure we don't use a full path as the default file name @@ -619,10 +629,10 @@ tyfilespec fs; tysftypelist filetypes; - if (!shellpushrootglobals (wsave)) /*save as only operates on root windows*/ + if (!shellpushrootglobals (wsave)) // save as only operates on root windows return (false); - w = shellwindow; /*move into register*/ + w = shellwindow; // move into register if (fspec != nil) { @@ -632,21 +642,42 @@ } else { - if (!windowgetfspec (w, &fs)) { + if ( ! windowgetfspec ( w, &fs ) ) { - bigstring bs; + bigstring bsname; - getfsfile ( &fs, bs ); + getdefaultfilename ( bsname ); - getdefaultfilename ( bs ); + #ifdef MACVERSION + bigstring bs; + + pushchar ( '.', bsname ); + + ostypetostring ( config.filetype, bs ); + + alllower ( bs ); + + pushstring ( bs, bsname ); + + fs.path = CFStringCreateWithPascalString ( kCFAllocatorDefault, bsname, + kCFStringEncodingMacRoman ); + + #endif + + #ifdef WIN95VERSION + + copystring ( bsname, fsname ( &fs ) ); + + #endif + } filetypes.cttypes = 1; filetypes.types [0] = config.filetype; - if (flrunnable) { //special case for desktop scripts. + if (flrunnable) { // special case for desktop scripts. bigstring bsfile, bssuffix; getfsfile (&fs, bsfile); @@ -663,7 +694,7 @@ filetypes.types [0] = type_desktopscript; } - fl = sfdialog (sfputfileverb, nil, &filetypes, &fs, 'LAND'); /* 2005-10-06 creedon - added 'LAND' */ + fl = sfdialog (sfputfileverb, nil, &filetypes, &fs, 'LAND'); // 2005-10-06 creedon - added 'LAND' } if (fl) { @@ -683,7 +714,8 @@ shellpopglobals (); return (fl); - } /*shellsaveas*/ + + } // shellsaveas boolean shellnewfile (ptrfilespec fspec, boolean flhidden, WindowPtr *wnew) { @@ -729,6 +761,12 @@ w = *wnew; + #ifdef MACVERSION + + SetWindowProxyCreatorAndType ( w, 'LAND', 'TABL', kOnSystemDisk ); + + #endif + shellpushglobals (w); (**shellwindowinfo).flneversaved = (boolean) config.flcreateonnew; @@ -772,8 +810,10 @@ // // new front end to shellnewfile, isolates user interface // - // 2006-06-23 creedon: for Mac, FSRef-ized + // 2006-08-26 creedon: for Mac, FSRef-ized // + // for Mac, add ".root" to bsname + // // 2005-10-06 creedon - added 'LAND' to sfdialog call // // 5.0d8 dmb: pass file type to sfdialog for Win @@ -783,16 +823,28 @@ tyfilespec fspec; tysftypelist filetypes; WindowPtr w; - bigstring bs; + bigstring bsname; shellgetconfig (iddefaultconfig, &lconfig); clearbytes (&fspec, sizeof (fspec)); - getfsfile ( &fspec, bs ); + getuntitledfilename ( bsname ); - getuntitledfilename ( bs ); + #ifdef MACVERSION + pushstring ( "\x05"".root", bsname ); + + fspec.path = CFStringCreateWithPascalString ( kCFAllocatorDefault, bsname, kCFStringEncodingMacRoman ); + + #endif + + #ifdef WIN95VERSION + + copystring ( bsname, fsname ( &fspec ) ); + + #endif + if (lconfig.flcreateonnew) { filetypes.cttypes = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |