diff options
| author | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-06-08 09:27:25 +0000 |
|---|---|---|
| committer | SND\edgbla_cp <SND\edgbla_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-06-08 09:27:25 +0000 |
| commit | 5f868fa161d5827e45a060a0b17b44a997625315 (patch) | |
| tree | 1694ae3dfcb0189abdf098edbf6dae0bf2a18e4d /macosx/PcsxrPluginDocument.m | |
| parent | c7eb23ccf1813fb4ca47c309c40baff308151237 (diff) | |
| download | pcsxr-5f868fa161d5827e45a060a0b17b44a997625315.tar.gz | |
Rebranding.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@67621 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrPluginDocument.m')
| -rw-r--r-- | macosx/PcsxrPluginDocument.m | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/macosx/PcsxrPluginDocument.m b/macosx/PcsxrPluginDocument.m new file mode 100644 index 00000000..3d19f491 --- /dev/null +++ b/macosx/PcsxrPluginDocument.m @@ -0,0 +1,95 @@ +// +// PcsxrPluginDocument.m +// Pcsxr +// +// Created by Gil Pedersen on Thu Jul 01 2004. +// Copyright (c) 2004 __MyCompanyName__. All rights reserved. +// + +#import "PcsxrPluginDocument.h" + + +@implementation PcsxrPluginDocument + +- (BOOL)showAddPluginSheet:(NSWindow *)window forName:(NSString *)name +// User has asked to see the custom display. Display it. +{ + if (!addPluginSheet) + [NSBundle loadNibNamed:@"AddPluginSheet" owner:self]; + + [pluginName setObjectValue:name]; + + [NSApp beginSheet:addPluginSheet + modalForWindow:window + modalDelegate:nil + didEndSelector:nil + contextInfo:nil]; + [NSApp runModalForWindow:addPluginSheet]; + // Sheet is up here. + [NSApp endSheet:addPluginSheet]; + [addPluginSheet orderOut:self]; + + return moveOK; +} + +- (IBAction)closeAddPluginSheet:(id)sender +{ + if ([[sender keyEquivalent] isEqualToString:@"\r"]) { + moveOK = YES; + } else { + moveOK = NO; + } + [NSApp stopModal]; +} + +- (BOOL)loadDataRepresentation:(NSData *)docData ofType:(NSString *)docType +{ + //NSLog(@"loadDataRepresentation"); + return NO; +} + +- (BOOL)loadFileWrapperRepresentation:(NSFileWrapper *)wrapper ofType:(NSString *)docType +{ + if ([self showAddPluginSheet:nil forName:[wrapper filename]]) { + NSString *dst = [NSString stringWithFormat:@"%@/%@", + [[NSBundle mainBundle] builtInPlugInsPath], + [wrapper filename]]; + + if ([wrapper writeToFile:dst atomically:NO updateFilenames:NO]) { + [[NSWorkspace sharedWorkspace] noteFileSystemChanged:[[NSBundle mainBundle] builtInPlugInsPath]]; + NSRunInformationalAlertPanel(NSLocalizedString(@"Installation Succesfull", nil), + NSLocalizedString(@"The installation of the specified plugin was succesfull. In order to use it, please restart the application.", nil), + nil, nil, nil); + } else { + NSRunAlertPanel(NSLocalizedString(@"Installation Failed!", nil), + NSLocalizedString(@"The installation of the specified plugin failed. Please try again, or make a manual install.", nil), + nil, nil, nil); + } + } + + // Tell the NSDocument that we can't handle the file, since we are already done with it + return NO; +} + +- (id)openDocumentWithContentsOfFile:(NSString *)fileName display:(BOOL)flag +{ + + return nil; +} + +- (NSString *)windowNibName { + // Implement this to return a nib to load OR implement -makeWindowControllers to manually create your controllers. + return @"PcsxrPluginDocument"; +} + +- (NSData *)dataRepresentationOfType:(NSString *)type { + // Implement to provide a persistent data representation of your document OR remove this and implement the file-wrapper or file path based save methods. + return nil; +} +/* +- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type { + // Implement to load a persistent data representation of your document OR remove this and implement the file-wrapper or file path based load methods. + return YES; +}*/ + +@end |
