File: | vendorsrc/OmniGroup/OmniAppKit/OAController.m |
Location: | line 15, column 1 |
Description: | missing -dealloc |
1 | // Copyright 2004-2007 Omni Development, Inc. All rights reserved. |
2 | // |
3 | // This software may only be used and reproduced according to the |
4 | // terms in the file OmniSourceLicense.html, which should be |
5 | // distributed with this project and can also be found at |
6 | // <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>. |
7 | |
8 | #import "OAController.h" |
9 | |
10 | #import "OAAboutPanelController.h" |
11 | #import "OAInternetConfig.h" |
12 | |
13 | RCS_IDstatic __attribute__ ( ( used , section ( "__TEXT,rcsid" ) ) ) const char rcs_id [ ] = "$Header: svn+ssh://source.omnigroup.com/Source/svn/Omni/tags/OmniSourceRelease_2007-10-25/OmniGroup/Frameworks/OmniAppKit/OAController.m 93428 2007-10-25 16:36:11Z kc $" ;("$Header: svn+ssh://source.omnigroup.com/Source/svn/Omni/tags/OmniSourceRelease_2007-10-25/OmniGroup/Frameworks/OmniAppKit/OAController.m 93428 2007-10-25 16:36:11Z kc $") |
14 | |
Objective-C class 'OAController' lacks a 'dealloc' instance method | |
15 | @implementation OAController |
16 | |
17 | - (void)gotPostponedTerminateResult:(BOOL)isReadyToTerminate; |
18 | { |
19 | if (status == OFControllerPostponingTerminateStatus) |
20 | [NSApp replyToApplicationShouldTerminate:isReadyToTerminate]; |
21 | } |
22 | |
23 | #pragma mark - |
24 | #pragma mark API |
25 | |
26 | - (OAAboutPanelController *)aboutPanelController; |
27 | { |
28 | if (!aboutPanelController) { |
29 | Class class = Nil( ( void * ) 0 ); |
30 | NSString *className = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"OAAboutPanelControllerClass"]; |
31 | if (className) { |
32 | class = NSClassFromString(className); |
33 | if (!class) |
34 | NSLog(@"Unable to find class '%@'", className); |
35 | if (!OBClassIsSubclassOfClass(class, [OAAboutPanelController class])) |
36 | class = Nil( ( void * ) 0 ); |
37 | } |
38 | if (!class) |
39 | class = [OAAboutPanelController class]; |
40 | |
41 | aboutPanelController = [[class alloc] init]; |
42 | } |
43 | return aboutPanelController; |
44 | } |
45 | |
46 | - (void)getFeedbackAddress:(NSString **)feedbackAddress andSubject:(NSString **)subjectLine; |
47 | { |
48 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; |
49 | NSString *appName = [infoDictionary objectForKey:@"CFBundleName"]; |
50 | NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; |
51 | NSString *buildVersion = [infoDictionary objectForKey:@"CFBundleVersion"]; |
52 | NSString *buildRevision = [infoDictionary objectForKey:@"OABuildRevision"]; // For a possible svn revision if you aren't including that in CFBundleVersion |
53 | |
54 | if (![NSString isEmptyString:buildRevision]) |
55 | buildVersion = [NSString stringWithFormat:@"%@ r%@", buildVersion, buildRevision]; |
56 | |
57 | *feedbackAddress = [[NSUserDefaults standardUserDefaults] stringForKey:@"FeedbackAddress"]; |
58 | *subjectLine = [NSString stringWithFormat:@"%@ %@ (v%@) Feedback", appName, appVersion, buildVersion]; |
59 | } |
60 | |
61 | - (void)sendFeedbackEmailTo:(NSString *)feedbackAddress subject:(NSString *)subjectLine body:(NSString *)body; |
62 | { |
63 | // Application developers should enter the feedback address in their main bundle's info dictionary. |
64 | if (!feedbackAddress) { |
65 | NSRunAlertPanel(@"Unable to send feedback email.", @"No support email address configured in this applications.", @"Cancel", nil( ( void * ) 0 ), nil( ( void * ) 0 )); |
66 | } else { |
67 | OAInternetConfig *internetConfig = [[[OAInternetConfig alloc] init] autorelease]; |
68 | |
69 | NSError *error = nil( ( void * ) 0 ); |
70 | if (![internetConfig launchMailTo:feedbackAddress carbonCopy:nil( ( void * ) 0 ) subject:subjectLine body:body error:&error]) |
71 | [NSApp presentError:error]; |
72 | } |
73 | } |
74 | |
75 | - (void)sendFeedbackEmailWithBody:(NSString *)body; |
76 | { |
77 | NSString *feedbackAddress, *subjectLine; |
78 | [self getFeedbackAddress:&feedbackAddress andSubject:&subjectLine]; |
79 | [self sendFeedbackEmailTo:feedbackAddress subject:subjectLine body:body]; |
80 | } |
81 | |
82 | #pragma mark - |
83 | #pragma mark Actions |
84 | |
85 | - (IBActionvoid)showAboutPanel:(id)sender; |
86 | { |
87 | [[self aboutPanelController] showAboutPanel:sender]; |
88 | } |
89 | |
90 | - (IBActionvoid)hideAboutPanel:(id)sender; |
91 | { |
92 | [[self aboutPanelController] hideAboutPanel:sender]; |
93 | } |
94 | |
95 | - (IBActionvoid)sendFeedback:(id)sender; |
96 | { |
97 | [self sendFeedbackEmailWithBody:nil( ( void * ) 0 )]; |
98 | } |
99 | |
100 | @end |