1 | //␊ |
2 | // About.mm␊ |
3 | // ChameleonPrefPane␊ |
4 | //␊ |
5 | // Created by Rekursor on 1/27/10.␊ |
6 | //␊ |
7 | ␊ |
8 | #import "AboutController.h"␊ |
9 | ␊ |
10 | ␊ |
11 | @implementation AboutController␊ |
12 | - (id) init␊ |
13 | {␊ |
14 | ␉self = [super init];␊ |
15 | ␊ |
16 | ␉bundle = [NSBundle bundleForClass:[self class]];␊ |
17 | sCredits = [bundle pathForResource: @"CREDITS" ofType: nil ];␊ |
18 | ␉return self;␊ |
19 | }␊ |
20 | ␊ |
21 | - (IBAction)onAbout: (id)sender␊ |
22 | {␊ |
23 | ␉[mAboutDlg makeKeyAndOrderFront: sender];␊ |
24 | }␊ |
25 | ␊ |
26 | - (NSString *)bundleVersionNumber {␊ |
27 | ␉NSString * sVer = [[bundle infoDictionary] valueForKey:@"CFBundleVersion"];␊ |
28 | NSString* revFile = [bundle pathForResource: @"version" ofType: nil ];␊ |
29 | ␉NSString* rev = [NSString stringWithContentsOfFile:revFile encoding:NSUTF8StringEncoding error:nil] ;␊ |
30 | ␉␊ |
31 | ␉NSString * info = [[[NSString alloc] initWithFormat:@"Version %@ - %@", sVer, rev ] autorelease];␊ |
32 | ␉return info;␊ |
33 | }␊ |
34 | ␊ |
35 | - (NSString *)credits␊ |
36 | {␊ |
37 | ␉NSString* s = [[[NSString alloc] ␊ |
38 | ␉␉␉␉ initWithContentsOfFile:sCredits encoding: NSASCIIStringEncoding error: nil] autorelease];␊ |
39 | ␉return s ? s : @"";␊ |
40 | }␊ |
41 | ␊ |
42 | @end␊ |
43 | ␊ |
44 | |