]> Dogcows Code - chaz/thecheat/blob - HelpController.m
update contact information and project URL
[chaz/thecheat] / HelpController.m
1
2 /*
3 * The Cheat - The legendary universal game trainer for Mac OS X.
4 * http://www.brokenzipper.com/trac/wiki/TheCheat
5 *
6 * Copyright (c) 2003-2011, Charles McGarvey et al.
7 *
8 * Distributable under the terms and conditions of the 2-clause BSD
9 * license; see the file COPYING for the legal text of the license.
10 */
11
12 #import "HelpController.h"
13
14
15 @implementation HelpController
16
17
18 - (id)init
19 {
20 return [super initWithWindowNibName:@"Help"];
21 }
22
23 - (void)windowDidLoad
24 {
25 NSString *filepath = [[NSBundle mainBundle] pathForResource:@"Help" ofType:@"html"];
26 NSURL *url;
27 NSURLRequest *request;
28
29 if ( !filepath ) {
30 return;
31 }
32
33 url = [NSURL fileURLWithPath:filepath];
34 request = [NSURLRequest requestWithURL:url];
35
36 [[webView mainFrame] loadRequest:request];
37 [helpWindow center];
38 }
39
40
41 - (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
42 {
43 NSURL *url = [request URL];
44
45 // open "http" and "mailto" links in a real browser or email client
46 if ( [[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"mailto"] ) {
47 [[NSWorkspace sharedWorkspace] openURL:url];
48 [listener ignore];
49 }
50 [listener use];
51 }
52
53
54 @end
This page took 0.029986 seconds and 4 git commands to generate.