2006-09-04 18:06:23 +00:00
|
|
|
//
|
|
|
|
// FileDrawerPane.m
|
|
|
|
// Preferences
|
|
|
|
//
|
2006-09-04 18:46:18 +00:00
|
|
|
// Created by Vincent Spader on 9/4/06.
|
|
|
|
// Copyright 2006 Vincent Spader. All rights reserved.
|
2006-09-04 18:06:23 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "FileDrawerPane.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation FileDrawerPane
|
|
|
|
|
|
|
|
- (void)awakeFromNib
|
|
|
|
{
|
|
|
|
[self setName:@"File Drawer"];
|
|
|
|
[self setIcon:@"file_drawer"];
|
2006-09-17 18:11:29 +00:00
|
|
|
|
|
|
|
[rootPathTextView setStringValue:[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileDrawerRootPath"]];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (IBAction)openSheet:(id)sender
|
|
|
|
{
|
|
|
|
NSOpenPanel *p;
|
|
|
|
|
|
|
|
p = [NSOpenPanel openPanel];
|
|
|
|
|
|
|
|
[p setCanChooseDirectories:YES];
|
|
|
|
[p setCanChooseFiles:NO];
|
|
|
|
[p setAllowsMultipleSelection:NO];
|
|
|
|
|
|
|
|
[p beginSheetForDirectory:nil file:nil types:nil modalForWindow:[view window] modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
|
|
|
{
|
|
|
|
if (returnCode == NSOKButton)
|
|
|
|
{
|
|
|
|
[rootPathTextView setStringValue:[panel filename]];
|
|
|
|
[[NSUserDefaults standardUserDefaults] setObject:[panel filename] forKey:@"fileDrawerRootPath"];
|
|
|
|
}
|
2006-09-04 18:06:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|