• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOpenPanel & NSFileTypeForHFSTypeCode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOpenPanel & NSFileTypeForHFSTypeCode


  • Subject: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • From: Corbin Dunn <email@hidden>
  • Date: Wed, 10 Oct 2007 16:08:15 -0700


On Oct 10, 2007, at 1:52 PM, John Stiles wrote:

Yes. You will want to implement:

- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename;

and return "NO" for non-volumes (you have to determine that by whatever logic you want). This disables everything else.

You also probably want to preseed the directory to root with: setDirectory:@"/Volumes", and/or call beginForDirectory:@"/Volumes" -- unfortunately, /Volumes is slightly different than the 'computer' node.

Will this technique show the boot volume (rooted at /)?

It should -- all volumes should be there. Granted, nothing would stop the user from changing directories; they could use "cmd-shift-g" and goto another folder. There is a slight bug on Tiger that the "Open" button will still be enabled in that case (that bug will be fixed for Leopard). To handle that, you can do one final validation on the "selected folder" in panel:isValidFilename:.


-corbin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSOpenPanel & NSFileTypeForHFSTypeCode (From: Chris Heimark <email@hidden>)
 >Re: NSOpenPanel & NSFileTypeForHFSTypeCode (From: Corbin Dunn <email@hidden>)
 >Re: NSOpenPanel & NSFileTypeForHFSTypeCode (From: John Stiles <email@hidden>)

  • Prev by Date: Re: NSDocument, setFileURL:
  • Next by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Previous by thread: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Next by thread: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Index(es):
    • Date
    • Thread