X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/bbfa6efd3166fc3d4202de03f817cc46efe08967..d4f63699c141b36ccd7daff2d910e836af76dcfa:/ITAboutBox.m diff --git a/ITAboutBox.m b/ITAboutBox.m new file mode 100644 index 0000000..276fd7d --- /dev/null +++ b/ITAboutBox.m @@ -0,0 +1,57 @@ +// +// ITAboutBox.m +// ITKit +// +// Created by Kent Sutherland on 8/4/05. +// Copyright 2005 __MyCompanyName__. All rights reserved. +// + +#import "ITAboutBox.h" +#import "ITURLTextField.h" + +static ITAboutBox *_sharedController; + +@implementation ITAboutBox + ++ (ITAboutBox *)sharedController +{ + if (!_sharedController) { + _sharedController = [[ITAboutBox alloc] init]; + } + return _sharedController; +} + +- (id)init +{ + if ( (self = [super init]) ) { + [NSBundle loadNibNamed:@"AboutBox" owner:self]; + } + return self; +} + +- (void)setupAboutBox +{ + [_appIcon setImage:[[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"]]] autorelease]]; + + [_appName setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"CFBundleShortVersionString" value:@"" table:@"InfoPlist"]]; + [_companySite setStringValue:@"http://www.ithinksw.com/"]; + [_companySite setURL:[NSURL URLWithString:@"http://www.ithinksw.com/"]]; + [_copyright setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"NSHumanReadableCopyright" value:@"" table:@"InfoPlist"]]; +} + +- (void)showAboutBox +{ + [self setupAboutBox]; + + [_window center]; + [NSApp activateIgnoringOtherApps:YES]; + [_window orderFrontRegardless]; + [_window makeKeyWindow]; +} + +- (BOOL)isVisible +{ + return [_window isVisible]; +} + +@end