Remove warning when loading images in delegate

This commit is contained in:
Gregory John Casamento 2023-07-03 13:10:07 -04:00
parent c02fbdcbe8
commit c25ebdd4eb
3 changed files with 27 additions and 13 deletions

View file

@ -55,20 +55,23 @@
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
NSNotificationCenter *ndc = [NSDistributedNotificationCenter defaultCenter];
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
NSString *path;
NSConnection *conn = [NSConnection defaultConnection];
NSString *path = nil;
path = [bundle pathForImageResource: @"GormLinkImage"];
linkImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormSourceTag"];
sourceImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTargetTag"];
targetImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"Gorm"];
gormImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTesting"];
testingImage = [[NSImage alloc] initWithContentsOfFile: path];
if ([self isInTool] == NO)
{
path = [bundle pathForImageResource: @"GormLinkImage"];
linkImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormSourceTag"];
sourceImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTargetTag"];
targetImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"Gorm"];
gormImage = [[NSImage alloc] initWithContentsOfFile: path];
path = [bundle pathForImageResource: @"GormTesting"];
testingImage = [[NSImage alloc] initWithContentsOfFile: path];
}
// regular notifications...
[nc addObserver: self
selector: @selector(handleNotification:)
@ -144,7 +147,10 @@
}
// Gorm specific methods...
- (BOOL) isInTool
{
return NO;
}
- (id<IBDocuments>) activeDocument
{

View file

@ -52,6 +52,9 @@
- (GormClassManager*) classManager;
- (NSMenu*) classMenu;
// Check if we are in the app or the tool
- (BOOL) isInTool;
@end
#endif

View file

@ -30,6 +30,11 @@
// AppDelegate...
@implementation AppDelegate
- (BOOL) isInTool
{
return YES;
}
- (NSDictionary *) parseArguments
{
GormDocumentController *dc = [GormDocumentController sharedDocumentController];