-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITAboutWindowController.m
48 lines (37 loc) · 1.25 KB
/
ITAboutWindowController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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:[NSString stringWithFormat:@"%@ %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]];
[_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