Fixed InfoWindow editing bug, moved plug-in editors to the PlugIns folder instead of the Resources folder.

This commit is contained in:
Nicholas Shanks 2002-02-07 20:33:31 +00:00
parent f62010339d
commit 5404d78e13
4 changed files with 47 additions and 27 deletions

View File

@ -2,11 +2,6 @@
@implementation InfoWindow @implementation InfoWindow
- (BOOL)canBecomeKeyWindow
{
return NO;
}
- (BOOL)canBecomeMainWindow - (BOOL)canBecomeMainWindow
{ {
return NO; return NO;

View File

@ -53,7 +53,7 @@
{ {
[[self window] setTitle:@"Document Info"]; [[self window] setTitle:@"Document Info"];
[placeholderView setContentView:documentView]; [placeholderView setContentView:documentView];
[nameView setStringValue:[currentDocument fileName]? [currentDocument fileName]:[currentDocument displayName]]; [nameView setStringValue:[currentDocument fileName]? [[currentDocument fileName] lastPathComponent]:[currentDocument displayName]];
} }
} }

View File

@ -3,6 +3,8 @@
#import "ResourceNameCell.h" #import "ResourceNameCell.h"
#import "CreateResourceSheetController.h" #import "CreateResourceSheetController.h"
#import "ResKnifePluginProtocol.h"
@implementation ResourceDocument @implementation ResourceDocument
- (id)init - (id)init
@ -267,30 +269,25 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
{ {
[[dataSource createResourceSheetController] showCreateResourceSheet:self]; [[dataSource createResourceSheetController] showCreateResourceSheet:self];
} }
/*
- (IBAction)openResource:(id)sender - (IBAction)openResource:(id)sender
{ {
if( NO ); if( NO );
else [self openResourceAsHex:sender]; else [self openResourceAsHex:sender];
} }
*/
- (IBAction)openResourceAsHex:(id)sender - (IBAction)openResourceAsHex:(id)sender
{ {
// bug: only opens the hex editor! NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
// 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];
Resource *resource = [outlineView itemAtRow:[outlineView selectedRow]]; Resource *resource = [outlineView itemAtRow:[outlineView selectedRow]];
// bug: I alloc a plug instance here, but have no idea where it gets dealloc'd // 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?
[[[hexEditor principalClass] alloc] initWithResource:resource]; [(id <ResKnifePluginProtocol>)[[hexEditor principalClass] alloc] initWithResource:resource];
} }
/*
- (IBAction)playSound:(id)sender - (IBAction)playSound:(id)sender
{ {
} }
*/
/* FILE HANDLING */ /* FILE HANDLING */
#pragma mark - #pragma mark -

View File

@ -29,12 +29,6 @@
settings = { settings = {
}; };
}; };
F5502C3401C5588601C57124 = {
fileRef = F57CEE0D0189C95101A8010B;
isa = PBXBuildFile;
settings = {
};
};
F5502C4001C579FF01C57124 = { F5502C4001C579FF01C57124 = {
isa = PBXFileReference; isa = PBXFileReference;
name = ResKnifePluginProtocol.h; name = ResKnifePluginProtocol.h;
@ -146,6 +140,22 @@
settings = { settings = {
}; };
}; };
F577A9060212B69C01A80001 = {
fileRef = F57CEE0D0189C95101A8010B;
isa = PBXBuildFile;
settings = {
};
};
F577A90702131AB001A80001 = {
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
F577A9060212B69C01A80001,
);
isa = PBXCopyFilesBuildPhase;
name = "Copy Files";
};
F57CEE0B0189C95101A8010B = { F57CEE0B0189C95101A8010B = {
children = ( children = (
F5502C4001C579FF01C57124, F5502C4001C579FF01C57124,
@ -159,7 +169,7 @@
}; };
F57CEE0D0189C95101A8010B = { F57CEE0D0189C95101A8010B = {
isa = PBXBundleReference; isa = PBXBundleReference;
path = "Hexadecimal Editor.bundle"; path = "Hexadecimal Editor.plugin";
refType = 3; refType = 3;
}; };
F57CEE0E0189C95101A8010B = { F57CEE0E0189C95101A8010B = {
@ -177,7 +187,7 @@
PRODUCT_NAME = "Hexadecimal Editor"; PRODUCT_NAME = "Hexadecimal Editor";
SECTORDER_FLAGS = ""; SECTORDER_FLAGS = "";
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
WRAPPER_EXTENSION = bundle; WRAPPER_EXTENSION = plugin;
}; };
dependencies = ( dependencies = (
); );
@ -322,6 +332,7 @@
buildPhases = ( buildPhases = (
F5B588140156D30301000001, F5B588140156D30301000001,
F5B588150156D30301000001, F5B588150156D30301000001,
F577A90702131AB001A80001,
F5B588160156D30301000001, F5B588160156D30301000001,
F5B588170156D30301000001, F5B588170156D30301000001,
F5B588180156D30301000001, F5B588180156D30301000001,
@ -385,6 +396,24 @@
</array> </array>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>NSDocumentClass</key>
<string>ResourceDocument</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSFilenamesPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>ResourceDocument</string>
</dict> </dict>
</array> </array>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
@ -452,7 +481,6 @@
F5B588630156D40B01000001, F5B588630156D40B01000001,
F5B588640156D40B01000001, F5B588640156D40B01000001,
F5730B940159528A01000001, F5730B940159528A01000001,
F5502C3401C5588601C57124,
F577A8F50211D05E01A80001, F577A8F50211D05E01A80001,
F577A8F90211DC1E01A80001, F577A8F90211DC1E01A80001,
F577A8FD0211E4D401A80001, F577A8FD0211E4D401A80001,