Added a new about box class. Added a text field that will eventually be clickable...
[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 #import "ITURLTextField.h"
11
12 static ITAboutBox *_sharedController;
13
14 @implementation ITAboutBox
15
16 + (ITAboutBox *)sharedController
17 {
18         if (!_sharedController) {
19                 _sharedController = [[ITAboutBox alloc] init];
20         }
21         return _sharedController;
22 }
23
24 - (id)init
25 {
26         if ( (self = [super init]) ) {
27                 [NSBundle loadNibNamed:@"AboutBox" owner:self];
28         }
29         return self;
30 }
31
32 - (void)setupAboutBox
33 {
34         [_appIcon setImage:[[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIconFile"]]] autorelease]];
35         
36         [_appName setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"CFBundleShortVersionString" value:@"" table:@"InfoPlist"]];
37         [_companySite setStringValue:@"http://www.ithinksw.com/"];
38         [_companySite setURL:[NSURL URLWithString:@"http://www.ithinksw.com/"]];
39         [_copyright setStringValue:[[NSBundle mainBundle] localizedStringForKey:@"NSHumanReadableCopyright" value:@"" table:@"InfoPlist"]];
40 }
41
42 - (void)showAboutBox
43 {
44         [self setupAboutBox];
45         
46         [_window center];
47         [NSApp activateIgnoringOtherApps:YES];
48     [_window orderFrontRegardless];
49     [_window makeKeyWindow];
50 }
51
52 - (BOOL)isVisible
53 {
54         return [_window isVisible];
55 }
56
57 @end