Re: NSOpenPanel & NSFileTypeForHFSTypeCode
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