Add item to NSSavePanel sidebar

2008-06-19 Thread Fedor Larin
Hi,

 

I need to allow user to save some data to a file or a recordable cd ( dvd ),
using NSSavePanel. Is it possible to programmatically add an icon
representing recordable media to NSSavePanel's sidebar?  Writing will be
performed on-fly, so standard way used in Finder with 'untitled cd' icon and
'burn' button is unsuitable.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Add item to NSSavePanel sidebar

2008-06-19 Thread Omar Qazi


On Jun 19, 2008, at 7:57 AM, Fedor Larin wrote:


I need to allow user to save some data to a file or a recordable cd  
( dvd ),

using NSSavePanel. Is it possible to programmatically add an icon
representing recordable media to NSSavePanel's sidebar?  Writing  
will be
performed on-fly, so standard way used in Finder with 'untitled cd'  
icon and

'burn' button is unsuitable.



Fedor:

The finder has to save the sidebar state to disk somewhere. I image  
that it would be possible to read that file and change the place where  
it mentions all the items in the sidebar to include your directory. If  
I had to guess I would probably say that sidebar data is stored in ~/ 
Library/Preferenced/com.apple.finder.plist. If this is true, you can  
read all of the data into a NSDictionary, which will make the file  
very easy to edit make it very easy to edit.


You also might need to restart finder after you make the change using  
something like killall finder.


Omar Qazi
Hello, Galaxy!
1.310.294.1593



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Add item to NSSavePanel sidebar

2008-06-19 Thread Jens Alfke


On 19 Jun '08, at 6:22 PM, Omar Qazi wrote:

The finder has to save the sidebar state to disk somewhere. I image  
that it would be possible to read that file and change the place  
where it mentions all the items in the sidebar to include your  
directory.


The Open/Save panels are not part of the Finder; they're just drawn  
that way. They're really part of the AppKit framework. I agree there's  
probably a shared plist somewhere that describes the configuration of  
the sidebar, but (a) messing with this without the user's consent  
would be a bad idea, and (b) there's no way to get NSSavePanel in your  
own process to notice the file's changed, since you don't want to kill  
yourself...


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Add item to NSSavePanel sidebar

2008-06-19 Thread Omar Qazi


On Jun 19, 2008, at 6:36 PM, Jens Alfke wrote:



(b) there's no way to get NSSavePanel in your own process to notice  
the file's changed, since you don't want to kill yourself...


Good point.

Omar Qazi
Hello, Galaxy!
1.310.294.1593



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]