mirror of
https://github.com/nickshanks/ResKnife.git
synced 2025-01-02 13:30:55 +00:00
Removed extraneous NSPanel subclass ‘InfoWindow’. The Info Window still exists, it's just a normal NSPanel now.
This commit is contained in:
parent
667ed16d05
commit
316e5e45cc
@ -1,6 +0,0 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface InfoWindow : NSPanel
|
||||
{
|
||||
}
|
||||
@end
|
@ -1,15 +0,0 @@
|
||||
#import "InfoWindow.h"
|
||||
|
||||
@implementation InfoWindow
|
||||
|
||||
- (BOOL)canBecomeKeyWindow
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeMainWindow
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
@ -22,6 +22,9 @@
|
||||
{
|
||||
[super windowDidLoad];
|
||||
|
||||
// set window to only accept key when editing text boxes
|
||||
[(NSPanel *)[self window] setBecomesKeyOnlyIfNeeded:YES];
|
||||
|
||||
// retain views for swapping in and out
|
||||
[documentView retain];
|
||||
[documentView removeFromSuperview];
|
||||
|
@ -57,6 +57,17 @@
|
||||
[dataSource setResources:resources];
|
||||
}
|
||||
|
||||
- (void)printShowingPrintPanel:(BOOL)flag
|
||||
{
|
||||
NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:[[outlineView window] contentView]];
|
||||
[printOperation runOperationModalForWindow:[outlineView window] delegate:self didRunSelector:@selector(printOperationDidRun:success:contextInfo:) contextInfo:nil];
|
||||
}
|
||||
|
||||
- (void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo
|
||||
{
|
||||
if( !success ) NSLog( @"Printing Failed!" );
|
||||
}
|
||||
|
||||
- (BOOL)keepBackupFile
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"PreserveBackups"];
|
||||
@ -64,12 +75,22 @@
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item
|
||||
{
|
||||
int selectedRows = [outlineView numberOfSelectedRows];
|
||||
Resource *resource = (Resource *) [outlineView itemAtRow:[outlineView selectedRow]];
|
||||
|
||||
// file menu
|
||||
if( [item action] == @selector(saveDocument:) ) return [self isDocumentEdited];
|
||||
else if( [item action] == @selector(openResource:) ) return ([outlineView numberOfSelectedRows] == 1)? YES:NO;
|
||||
else if( [item action] == @selector(openResourceAsHex:) ) return [outlineView numberOfSelectedRows]? YES:NO;
|
||||
else if( [item action] == @selector(playSound:) ) return [[resource type] isEqualToString:@"snd "];
|
||||
else if( [item action] == @selector(revertResourceToSaved:) ) return [resource isDirty];
|
||||
|
||||
// edit menu
|
||||
else if( [item action] == @selector(clear:) ) return selectedRows > 0;
|
||||
else if( [item action] == @selector(selectAll:) ) return [outlineView numberOfRows] > 0;
|
||||
else if( [item action] == @selector(deselectAll:) ) return selectedRows > 0;
|
||||
|
||||
// resource menu
|
||||
else if( [item action] == @selector(openResource:) ) return selectedRows == 1;
|
||||
else if( [item action] == @selector(openResourceAsHex:) ) return selectedRows > 0;
|
||||
else if( [item action] == @selector(playSound:) ) return selectedRows == 1 && [[resource type] isEqualToString:@"snd "];
|
||||
else if( [item action] == @selector(revertResourceToSaved:) ) return selectedRows == 1 && [resource isDirty];
|
||||
else return [super validateMenuItem:item];
|
||||
}
|
||||
|
||||
|
4
Cocoa/English.lproj/Application.nib/info.nib
generated
4
Cocoa/English.lproj/Application.nib/info.nib
generated
@ -11,6 +11,10 @@
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5P48</string>
|
||||
</dict>
|
||||
|
BIN
Cocoa/English.lproj/Application.nib/objects.nib
generated
BIN
Cocoa/English.lproj/Application.nib/objects.nib
generated
Binary file not shown.
1
Cocoa/English.lproj/InfoWindow.nib/classes.nib
generated
1
Cocoa/English.lproj/InfoWindow.nib/classes.nib
generated
@ -1,7 +1,6 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{CLASS = InfoWindow; LANGUAGE = ObjC; SUPERCLASS = NSPanel; },
|
||||
{
|
||||
ACTIONS = {attributesChanged = id; };
|
||||
CLASS = InfoWindowController;
|
||||
|
BIN
Cocoa/English.lproj/InfoWindow.nib/objects.nib
generated
BIN
Cocoa/English.lproj/InfoWindow.nib/objects.nib
generated
Binary file not shown.
@ -493,7 +493,6 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F5B5884F0156D40B01000001,
|
||||
F5B588510156D40B01000001,
|
||||
F5B588520156D40B01000001,
|
||||
F5B588530156D40B01000001,
|
||||
F5B588540156D40B01000001,
|
||||
@ -542,7 +541,6 @@
|
||||
F5B588660156D40B01000001,
|
||||
F5B588670156D40B01000001,
|
||||
F5B588680156D40B01000001,
|
||||
F5B588690156D40B01000001,
|
||||
F5B5886A0156D40B01000001,
|
||||
F5B5886B0156D40B01000001,
|
||||
F5B5886C0156D40B01000001,
|
||||
@ -926,12 +924,6 @@
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F5B588510156D40B01000001 = {
|
||||
fileRef = F5B588230156D40B01000001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F5B588520156D40B01000001 = {
|
||||
fileRef = F5B588250156D40B01000001;
|
||||
isa = PBXBuildFile;
|
||||
@ -1064,12 +1056,6 @@
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F5B588690156D40B01000001 = {
|
||||
fileRef = F5B588240156D40B01000001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F5B5886A0156D40B01000001 = {
|
||||
fileRef = F5B588260156D40B01000001;
|
||||
isa = PBXBuildFile;
|
||||
|
Loading…
Reference in New Issue
Block a user