mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-06-03 01:29:40 +00:00
Add RKSupportResourceRegistry that opens a couple of files in
{/Library, ~/Library}/Application Support/ResKnife/Support Resources/ and ResKnife.app/Contents/Resources/Support Resources/
This commit is contained in:
parent
617581c42f
commit
6b3f27a7bf
|
@ -8,6 +8,8 @@
|
|||
#import "ResourceDataSource.h"
|
||||
|
||||
#import "ResknifePluginProtocol.h"
|
||||
#import "RKSupportResourceRegistry.h"
|
||||
|
||||
|
||||
@implementation ApplicationDelegate
|
||||
|
||||
|
@ -22,7 +24,8 @@
|
|||
{
|
||||
// instanciate my own subclass of NSDocumentController so I can override the open dialog
|
||||
RKDocumentController *docController = [[RKDocumentController alloc] init];
|
||||
#pragma unused( docController )
|
||||
|
||||
[RKSupportResourceRegistry scanForSupportResources: [NSDocumentController sharedDocumentController]];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
|
|
20
Cocoa/Classes/RKSupportResourceRegistry.h
Normal file
20
Cocoa/Classes/RKSupportResourceRegistry.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// RKSupportResourceRegistry.h
|
||||
// ResKnife
|
||||
//
|
||||
// Created by Uli Kusterer on Mon Aug 18 2003.
|
||||
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
|
||||
@interface RKSupportResourceRegistry : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+(void) scanForSupportResources: (NSDocumentController*)c;
|
||||
|
||||
|
||||
@end
|
45
Cocoa/Classes/RKSupportResourceRegistry.m
Normal file
45
Cocoa/Classes/RKSupportResourceRegistry.m
Normal file
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// RKSupportResourceRegistry.m
|
||||
// ResKnife
|
||||
//
|
||||
// Created by Uli Kusterer on Mon Aug 18 2003.
|
||||
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RKSupportResourceRegistry.h"
|
||||
|
||||
|
||||
@implementation RKSupportResourceRegistry
|
||||
|
||||
+(void) scanForSupportResources: (NSDocumentController*)c
|
||||
{
|
||||
// TODO: Instead of hard-coding sysPath we should use some FindFolder-like API!
|
||||
NSString *appSupport = @"Library/Application Support/ResKnife/Support Resources/";
|
||||
NSString *appPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Support Resources"];
|
||||
NSString *userPath = [NSHomeDirectory() stringByAppendingPathComponent:appSupport];
|
||||
NSString *sysPath = [@"/" stringByAppendingPathComponent:appSupport];
|
||||
NSArray *paths = [NSArray arrayWithObjects:appPath, userPath, sysPath, nil];
|
||||
NSEnumerator *pathEnum = [paths objectEnumerator];
|
||||
NSString *path;
|
||||
|
||||
while( path = [pathEnum nextObject] )
|
||||
{
|
||||
NSEnumerator *e = [[[NSFileManager defaultManager] directoryContentsAtPath:path] objectEnumerator];
|
||||
NSString *name;
|
||||
|
||||
NSLog(@"Looking for resources in %@", path);
|
||||
|
||||
while( name = [e nextObject] )
|
||||
{
|
||||
name = [path stringByAppendingPathComponent:name];
|
||||
NSLog(@"Examining %@", name);
|
||||
if( [[name pathExtension] isEqualToString:@"rsrc"] )
|
||||
{
|
||||
[c openDocumentWithContentsOfFile:name display:YES];
|
||||
//[[[[[c openDocumentWithContentsOfFile:name display:YES] windowControllers] objectAtIndex:0] window] orderOut: self];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
|
@ -673,6 +673,7 @@ static NSString *RKExportItemIdentifier = @"com.ulikusterer.resknife.toolbar.ex
|
|||
if( !fork ) DisposePtr( (Ptr) resourceForkName ); // only delete if we're not saving it to "fork" instance var.
|
||||
if( fileRefNum ) FSClose( fileRefNum );
|
||||
DisposePtr( (Ptr) fileRef );
|
||||
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
|
|
|
@ -839,6 +839,30 @@
|
|||
settings = {
|
||||
};
|
||||
};
|
||||
3D53A9FD04F171DC006651FA = {
|
||||
fileEncoding = 4;
|
||||
isa = PBXFileReference;
|
||||
path = RKSupportResourceRegistry.h;
|
||||
refType = 4;
|
||||
};
|
||||
3D53A9FE04F171DC006651FA = {
|
||||
fileEncoding = 4;
|
||||
isa = PBXFileReference;
|
||||
path = RKSupportResourceRegistry.m;
|
||||
refType = 4;
|
||||
};
|
||||
3D53A9FF04F171DC006651FA = {
|
||||
fileRef = 3D53A9FD04F171DC006651FA;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
3D53AA0004F171DC006651FA = {
|
||||
fileRef = 3D53A9FE04F171DC006651FA;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
//3D0
|
||||
//3D1
|
||||
//3D2
|
||||
|
@ -2823,6 +2847,7 @@
|
|||
F59481AF03D0776C01A8010A,
|
||||
F59481B303D077DC01A8010A,
|
||||
3D35755E04DAEB6200B8225B,
|
||||
3D53A9FF04F171DC006651FA,
|
||||
);
|
||||
isa = PBXHeadersBuildPhase;
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -2880,6 +2905,7 @@
|
|||
F59481B403D077DC01A8010A,
|
||||
3D35755B04DAEB4300B8225B,
|
||||
3D35755F04DAEB6200B8225B,
|
||||
3D53AA0004F171DC006651FA,
|
||||
);
|
||||
isa = PBXSourcesBuildPhase;
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -2940,6 +2966,8 @@
|
|||
F5B5882E0156D40B01000001,
|
||||
3D35755C04DAEB6200B8225B,
|
||||
3D35755D04DAEB6200B8225B,
|
||||
3D53A9FD04F171DC006651FA,
|
||||
3D53A9FE04F171DC006651FA,
|
||||
F5B5882F0156D40B01000001,
|
||||
F5B588300156D40B01000001,
|
||||
F5B588310156D40B01000001,
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
3DFEB4D504E67CC7009449E8 = {
|
||||
fileReference = F5B5881E0156D40B01000001;
|
||||
isa = PBXFileBreakpoint;
|
||||
lineNumber = 115;
|
||||
lineNumber = 118;
|
||||
state = 1;
|
||||
};
|
||||
F50DFE1E036C255E01A8010A = {
|
||||
|
@ -74,7 +74,7 @@
|
|||
activeExecutable = 3D97EA9B0476C2A600BE8AD5;
|
||||
activeTarget = F5B588130156D30301000001;
|
||||
addToTargets = (
|
||||
3D0B38BC04DEF48D005AED5E,
|
||||
F5B588130156D30301000001,
|
||||
);
|
||||
breakpoints = (
|
||||
3DFEB4D304E672EA009449E8,
|
||||
|
@ -85,7 +85,7 @@
|
|||
3D97EA9C0476C2A600BE8AD5,
|
||||
);
|
||||
perUserDictionary = {
|
||||
PBXPerProjectTemplateStateSaveDate = 82928627;
|
||||
PBXPerProjectTemplateStateSaveDate = 83076143;
|
||||
"PBXTemplateGeometry-F5314676015831810DCA290F" = {
|
||||
ContentSize = "{685, 434}";
|
||||
LeftSlideOut = {
|
||||
|
@ -342,132 +342,6 @@
|
|||
ToolbarVisible = YES;
|
||||
WindowLocation = "{371, 372}";
|
||||
};
|
||||
"PBXTemplateGeometry-F5CA7EC8015C06940DCA290F" = {
|
||||
ContentSize = "{705, 569}";
|
||||
LeftSlideOut = {
|
||||
Collapsed = NO;
|
||||
Frame = "{{0, 0}, {705, 569}}";
|
||||
Split0 = {
|
||||
Collapsed = NO;
|
||||
Frame = "{{0, 0}, {705, 569}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 0}, {705, 569}}";
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {484, 208}}";
|
||||
};
|
||||
Tab1 = {
|
||||
Debugger = {
|
||||
Collapsed = NO;
|
||||
Frame = "{{0, 0}, {522, 208}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 24}, {522, 184}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 0}, {254, 184}}";
|
||||
};
|
||||
Split1 = {
|
||||
DebugVariablesTableConfiguration = (
|
||||
Name,
|
||||
123,
|
||||
Value,
|
||||
85,
|
||||
Summary,
|
||||
62.123,
|
||||
);
|
||||
Frame = "{{263, 0}, {259, 184}}";
|
||||
};
|
||||
SplitCount = 2;
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {100, 50}}";
|
||||
};
|
||||
Tab1 = {
|
||||
Frame = "{{0, 0}, {100, 50}}";
|
||||
};
|
||||
TabCount = 2;
|
||||
TabsVisible = YES;
|
||||
};
|
||||
Frame = "{{0, 0}, {522, 208}}";
|
||||
LauncherConfigVersion = 7;
|
||||
};
|
||||
Tab2 = {
|
||||
Frame = "{{0, 0}, {807, 536}}";
|
||||
LauncherConfigVersion = 3;
|
||||
Runner = {
|
||||
Frame = "{{0, 0}, {807, 536}}";
|
||||
};
|
||||
};
|
||||
Tab3 = {
|
||||
BuildMessageFrame = "{{0, 0}, {614, 203}}";
|
||||
BuildTranscriptFrame = "{{0, 212}, {614, 85}}";
|
||||
BuildTranscriptFrameExpanded = YES;
|
||||
Frame = "{{0, 0}, {612, 295}}";
|
||||
};
|
||||
Tab4 = {
|
||||
Frame = "{{0, 0}, {612, 295}}";
|
||||
};
|
||||
TabCount = 5;
|
||||
TabsVisible = NO;
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {300, 533}}";
|
||||
GroupTreeTableConfiguration = (
|
||||
TargetStatusColumn,
|
||||
18,
|
||||
MainColumn,
|
||||
267,
|
||||
);
|
||||
};
|
||||
Tab1 = {
|
||||
ClassesFrame = "{{0, 0}, {280, 398}}";
|
||||
ClassesTreeTableConfiguration = (
|
||||
PBXBookColumnIdentifier,
|
||||
20,
|
||||
PBXClassColumnIdentifier,
|
||||
237,
|
||||
);
|
||||
Frame = "{{0, 0}, {278, 659}}";
|
||||
MembersFrame = "{{0, 407}, {280, 252}}";
|
||||
MembersTreeTableConfiguration = (
|
||||
PBXBookColumnIdentifier,
|
||||
20,
|
||||
PBXMethodColumnIdentifier,
|
||||
236,
|
||||
);
|
||||
};
|
||||
Tab2 = {
|
||||
Frame = "{{0, 0}, {200, 100}}";
|
||||
};
|
||||
Tab3 = {
|
||||
Frame = "{{0, 0}, {222, 536}}";
|
||||
TargetTableConfiguration = (
|
||||
ActiveObject,
|
||||
16,
|
||||
ObjectNames,
|
||||
202.296,
|
||||
);
|
||||
};
|
||||
Tab4 = {
|
||||
BreakpointsTreeTableConfiguration = (
|
||||
breakpointColumn,
|
||||
197,
|
||||
enabledColumn,
|
||||
31,
|
||||
);
|
||||
Frame = "{{0, 0}, {250, 528}}";
|
||||
};
|
||||
TabCount = 5;
|
||||
TabsVisible = NO;
|
||||
};
|
||||
NavBarShownByDefault = YES;
|
||||
StatusViewVisible = NO;
|
||||
Template = F5CA7EC8015C06940DCA290F;
|
||||
ToolbarVisible = YES;
|
||||
WindowLocation = "{233, 115}";
|
||||
};
|
||||
"PBXTemplateGeometry-F5CA7ECB015C094F0DCA290F" = {
|
||||
ContentSize = "{668, 621}";
|
||||
LeftSlideOut = {
|
||||
|
@ -594,6 +468,136 @@
|
|||
ToolbarVisible = NO;
|
||||
WindowLocation = "{334, 103}";
|
||||
};
|
||||
"PBXTemplateGeometry-F5CA7ECC015C09990DCA290F" = {
|
||||
ContentSize = "{773, 558}";
|
||||
LeftSlideOut = {
|
||||
Collapsed = NO;
|
||||
Frame = "{{0, 23}, {773, 535}}";
|
||||
Split0 = {
|
||||
ActiveTab = 0;
|
||||
ActiveTabName = PBXDebugSessionModule;
|
||||
Collapsed = NO;
|
||||
Frame = "{{24, 0}, {749, 535}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 214}, {749, 321}}";
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {749, 267}}";
|
||||
};
|
||||
Tab1 = {
|
||||
Debugger = {
|
||||
ActiveTab = 0;
|
||||
ActiveTabName = PBXDebugCLIModule;
|
||||
Collapsed = NO;
|
||||
Frame = "{{0, 0}, {749, 208}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 74}, {749, 134}}";
|
||||
Split0 = {
|
||||
Frame = "{{0, 0}, {367, 134}}";
|
||||
};
|
||||
Split1 = {
|
||||
DebugVariablesTableConfiguration = (
|
||||
Name,
|
||||
123,
|
||||
Value,
|
||||
85,
|
||||
Summary,
|
||||
139.123,
|
||||
);
|
||||
Frame = "{{376, 0}, {373, 134}}";
|
||||
};
|
||||
SplitCount = 2;
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {100, 50}}";
|
||||
};
|
||||
Tab1 = {
|
||||
Frame = "{{0, 0}, {749, 50}}";
|
||||
};
|
||||
TabCount = 2;
|
||||
TabsVisible = YES;
|
||||
};
|
||||
Frame = "{{0, 0}, {749, 208}}";
|
||||
LauncherConfigVersion = 7;
|
||||
};
|
||||
Tab2 = {
|
||||
Frame = "{{0, 0}, {664, 50}}";
|
||||
LauncherConfigVersion = 3;
|
||||
Runner = {
|
||||
Frame = "{{0, 0}, {664, 50}}";
|
||||
};
|
||||
};
|
||||
Tab3 = {
|
||||
BuildMessageFrame = "{{0, 0}, {614, 203}}";
|
||||
BuildTranscriptFrame = "{{0, 212}, {614, 85}}";
|
||||
BuildTranscriptFrameExpanded = YES;
|
||||
Frame = "{{0, 0}, {612, 295}}";
|
||||
};
|
||||
Tab4 = {
|
||||
Frame = "{{0, 0}, {612, 295}}";
|
||||
};
|
||||
TabCount = 5;
|
||||
TabsVisible = NO;
|
||||
};
|
||||
SplitCount = 1;
|
||||
Tab0 = {
|
||||
Frame = "{{0, 0}, {313, 531}}";
|
||||
GroupTreeTableConfiguration = (
|
||||
TargetStatusColumn,
|
||||
18,
|
||||
MainColumn,
|
||||
280,
|
||||
);
|
||||
};
|
||||
Tab1 = {
|
||||
ClassesFrame = "{{0, 0}, {280, 398}}";
|
||||
ClassesTreeTableConfiguration = (
|
||||
PBXBookColumnIdentifier,
|
||||
20,
|
||||
PBXClassColumnIdentifier,
|
||||
237,
|
||||
);
|
||||
Frame = "{{0, 0}, {278, 659}}";
|
||||
MembersFrame = "{{0, 407}, {280, 252}}";
|
||||
MembersTreeTableConfiguration = (
|
||||
PBXBookColumnIdentifier,
|
||||
20,
|
||||
PBXMethodColumnIdentifier,
|
||||
236,
|
||||
);
|
||||
};
|
||||
Tab2 = {
|
||||
Frame = "{{0, 0}, {200, 100}}";
|
||||
};
|
||||
Tab3 = {
|
||||
Frame = "{{0, 0}, {200, 557}}";
|
||||
TargetTableConfiguration = (
|
||||
ActiveObject,
|
||||
16,
|
||||
ObjectNames,
|
||||
202.296,
|
||||
);
|
||||
};
|
||||
Tab4 = {
|
||||
BreakpointsTreeTableConfiguration = (
|
||||
breakpointColumn,
|
||||
197,
|
||||
enabledColumn,
|
||||
31,
|
||||
);
|
||||
Frame = "{{0, 0}, {250, 100}}";
|
||||
};
|
||||
TabCount = 5;
|
||||
TabsVisible = YES;
|
||||
};
|
||||
NavBarShownByDefault = YES;
|
||||
StatusViewVisible = YES;
|
||||
Template = F5CA7ECC015C09990DCA290F;
|
||||
ToolbarVisible = YES;
|
||||
WindowLocation = "{204, 80}";
|
||||
};
|
||||
PBXWorkspaceContents = (
|
||||
{
|
||||
LeftSlideOut = {
|
||||
|
@ -764,7 +768,7 @@
|
|||
WindowLocation = "{143, 10}";
|
||||
},
|
||||
);
|
||||
PBXWorkspaceStateSaveDate = 82928627;
|
||||
PBXWorkspaceStateSaveDate = 83076143;
|
||||
};
|
||||
projectwideBuildSettings = {
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user