Not worrying about that stupid clicky URL text field for now.
[ITKit.git] / ITAboutBox.m
1 //
2 //  ITAboutBox.m
3 //  ITKit
4 //
5 //  Created by Kent Sutherland on 8/4/05.
6 //  Copyright 2005 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "ITAboutBox.h"
10
11 static ITAboutBox *_sharedController;
12
13 @implementation ITAboutBox
14
15 + (ITAboutBox *)sharedController
16 {
17         if (!_sharedController) {
18                 _sharedController = [[ITAboutBox alloc] init];
19         }
20         return _sharedController;
21 }
22
23 - (id)init
24 {
25         if ( (self = [super init]) ) {
26                 [NSBundle loadNibNamed:@"AboutBox" owner:self];
27         }
28         return self;
29 }
30
31 - (void)setupAboutBox
32 {
33         [_appIcon setImage:[[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"]]] autorelease]];
34         
35         [_appName setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"CFBundleShortVersionString" value:@"" table:@"InfoPlist"]];
36         [_companySite setStringValue:@"http://www.ithinksw.com/"];
37         
38         [_copyright setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"NSHumanReadableCopyright" value:@"" table:@"InfoPlist"]];
39 }
40
41 - (void)showAboutBox
42 {
43         [self setupAboutBox];
44         
45         [_window center];
46         [NSApp activateIgnoringOtherApps:YES];
47     [_window orderFrontRegardless];
48     [_window makeKeyWindow];
49 }
50
51 - (BOOL)isVisible
52 {
53         return [_window isVisible];
54 }
55
56 @end