X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/968b842462aa5bd05397b9a4653fd06621a1fb77..aa27430a07025ca3541a6cec108253830e822920:/ITAboutWindowController.m diff --git a/ITAboutWindowController.m b/ITAboutWindowController.m new file mode 100644 index 0000000..cea9a78 --- /dev/null +++ b/ITAboutWindowController.m @@ -0,0 +1,48 @@ +#import "ITAboutWindowController.h" + +static ITAboutWindowController *_sharedController; + +@implementation ITAboutWindowController + ++ (ITAboutWindowController *)sharedController +{ + if (!_sharedController) { + _sharedController = [[ITAboutWindowController alloc] init]; + } + return _sharedController; +} + +- (id)init +{ + if ( (self = [super init]) ) { + [NSBundle loadNibNamed:@"ITAboutWindow" owner:self]; + } + return self; +} + +- (void)setupAboutWindow +{ + [_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/"]; + + [_copyright setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"NSHumanReadableCopyright" value:@"" table:@"InfoPlist"]]; +} + +- (void)showAboutWindow +{ + [self setupAboutWindow]; + + [_window center]; + [NSApp activateIgnoringOtherApps:YES]; + [_window orderFrontRegardless]; + [_window makeKeyWindow]; +} + +- (BOOL)isVisible +{ + return [_window isVisible]; +} + +@end \ No newline at end of file