diff --git a/Cocoa/Classes/InfoWindow.m b/Cocoa/Classes/InfoWindow.m index 934295b..4481346 100644 --- a/Cocoa/Classes/InfoWindow.m +++ b/Cocoa/Classes/InfoWindow.m @@ -2,11 +2,6 @@ @implementation InfoWindow -- (BOOL)canBecomeKeyWindow -{ - return NO; -} - - (BOOL)canBecomeMainWindow { return NO; diff --git a/Cocoa/Classes/InfoWindowController.m b/Cocoa/Classes/InfoWindowController.m index 091f8cc..b7011ed 100644 --- a/Cocoa/Classes/InfoWindowController.m +++ b/Cocoa/Classes/InfoWindowController.m @@ -53,7 +53,7 @@ { [[self window] setTitle:@"Document Info"]; [placeholderView setContentView:documentView]; - [nameView setStringValue:[currentDocument fileName]? [currentDocument fileName]:[currentDocument displayName]]; + [nameView setStringValue:[currentDocument fileName]? [[currentDocument fileName] lastPathComponent]:[currentDocument displayName]]; } } diff --git a/Cocoa/Classes/ResourceDocument.m b/Cocoa/Classes/ResourceDocument.m index a2ddb3a..14d136d 100644 --- a/Cocoa/Classes/ResourceDocument.m +++ b/Cocoa/Classes/ResourceDocument.m @@ -3,6 +3,8 @@ #import "ResourceNameCell.h" #import "CreateResourceSheetController.h" +#import "ResKnifePluginProtocol.h" + @implementation ResourceDocument - (id)init @@ -267,30 +269,25 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh { [[dataSource createResourceSheetController] showCreateResourceSheet:self]; } - +/* - (IBAction)openResource:(id)sender { if( NO ); else [self openResourceAsHex:sender]; } - +*/ - (IBAction)openResourceAsHex:(id)sender { - // bug: only opens the hex editor! -// NSBundle *hexEditor = [NSBundle bundleWithIdentifier:@"com.nickshanks.resknife.hexadecimal"]; -// NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]]; - NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Hexadecimal Editor.bundle"]]; -// [hexEditor load]; - + NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]]; Resource *resource = [outlineView itemAtRow:[outlineView selectedRow]]; - // bug: I alloc a plug instance here, but have no idea where it gets dealloc'd - [[[hexEditor principalClass] alloc] initWithResource:resource]; + // bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self dealloc] when it's last window is closed? + [(id )[[hexEditor principalClass] alloc] initWithResource:resource]; } - +/* - (IBAction)playSound:(id)sender { } - +*/ /* FILE HANDLING */ #pragma mark - diff --git a/ResKnife.pbproj/project.pbxproj b/ResKnife.pbproj/project.pbxproj index d2d7891..d4de1bd 100644 --- a/ResKnife.pbproj/project.pbxproj +++ b/ResKnife.pbproj/project.pbxproj @@ -29,12 +29,6 @@ settings = { }; }; - F5502C3401C5588601C57124 = { - fileRef = F57CEE0D0189C95101A8010B; - isa = PBXBuildFile; - settings = { - }; - }; F5502C4001C579FF01C57124 = { isa = PBXFileReference; name = ResKnifePluginProtocol.h; @@ -146,6 +140,22 @@ settings = { }; }; + F577A9060212B69C01A80001 = { + fileRef = F57CEE0D0189C95101A8010B; + isa = PBXBuildFile; + settings = { + }; + }; + F577A90702131AB001A80001 = { + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + F577A9060212B69C01A80001, + ); + isa = PBXCopyFilesBuildPhase; + name = "Copy Files"; + }; F57CEE0B0189C95101A8010B = { children = ( F5502C4001C579FF01C57124, @@ -159,7 +169,7 @@ }; F57CEE0D0189C95101A8010B = { isa = PBXBundleReference; - path = "Hexadecimal Editor.bundle"; + path = "Hexadecimal Editor.plugin"; refType = 3; }; F57CEE0E0189C95101A8010B = { @@ -177,7 +187,7 @@ PRODUCT_NAME = "Hexadecimal Editor"; SECTORDER_FLAGS = ""; WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = bundle; + WRAPPER_EXTENSION = plugin; }; dependencies = ( ); @@ -322,6 +332,7 @@ buildPhases = ( F5B588140156D30301000001, F5B588150156D30301000001, + F577A90702131AB001A80001, F5B588160156D30301000001, F5B588170156D30301000001, F5B588180156D30301000001, @@ -385,6 +396,24 @@ CFBundleTypeRole Editor + NSDocumentClass + ResourceDocument + + + CFBundleTypeExtensions + + * + + CFBundleTypeName + NSFilenamesPboardType + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Editor + NSDocumentClass + ResourceDocument CFBundleExecutable @@ -452,7 +481,6 @@ F5B588630156D40B01000001, F5B588640156D40B01000001, F5730B940159528A01000001, - F5502C3401C5588601C57124, F577A8F50211D05E01A80001, F577A8F90211DC1E01A80001, F577A8FD0211E4D401A80001,