2003-04-03 15:38:42 +00:00
|
|
|
#import "RKDocumentController.h"
|
|
|
|
#import "ApplicationDelegate.h"
|
2008-07-31 20:27:55 +00:00
|
|
|
#import "OpenPanelDelegate.h"
|
2003-04-03 15:38:42 +00:00
|
|
|
|
|
|
|
@implementation RKDocumentController
|
|
|
|
|
2012-07-04 22:13:25 +00:00
|
|
|
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions
|
2003-04-03 15:38:42 +00:00
|
|
|
{
|
2008-07-31 20:27:55 +00:00
|
|
|
// set-up open panel (this happens every time, but no harm done)
|
|
|
|
ApplicationDelegate *appDelegate = [NSApp delegate];
|
|
|
|
OpenPanelDelegate *openPanelDelegate = [appDelegate openPanelDelegate];
|
|
|
|
NSView *openPanelAccessoryView = [openPanelDelegate openPanelAccessoryView];
|
|
|
|
[openPanel setDelegate:openPanelDelegate];
|
|
|
|
[openPanel setAccessoryView:openPanelAccessoryView];
|
|
|
|
[openPanel setAllowsOtherFileTypes:YES];
|
|
|
|
[openPanel setTreatsFilePackagesAsDirectories:YES];
|
|
|
|
[openPanelAccessoryView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
|
|
|
|
|
|
|
// run panel
|
|
|
|
int button = [super runModalOpenPanel:openPanel forTypes:extensions];
|
|
|
|
if(button == NSOKButton)
|
|
|
|
[openPanelDelegate setReadOpenPanelForFork:YES];
|
|
|
|
return button;
|
2003-04-03 15:38:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|