Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 74 lines (58 sloc) 2.06 kb
dc5be1c0 »
2009-07-04 Initial check-in.
1 //
2 // UKDocumentationController.m
3 // Shovel
4 //
5 // Created by Uli Kusterer on 04.10.04.
720b0e7b »
2010-03-04 Added licensing information to the source files.
6 // Copyright 2004 Uli Kusterer.
7 //
8 // This software is provided 'as-is', without any express or implied
9 // warranty. In no event will the authors be held liable for any damages
10 // arising from the use of this software.
11 //
12 // Permission is granted to anyone to use this software for any purpose,
13 // including commercial applications, and to alter it and redistribute it
14 // freely, subject to the following restrictions:
15 //
16 // 1. The origin of this software must not be misrepresented; you must not
17 // claim that you wrote the original software. If you use this software
18 // in a product, an acknowledgment in the product documentation would be
19 // appreciated but is not required.
20 //
21 // 2. Altered source versions must be plainly marked as such, and must not be
22 // misrepresented as being the original software.
23 //
24 // 3. This notice may not be removed or altered from any source
25 // distribution.
dc5be1c0 »
2009-07-04 Initial check-in.
26 //
27
28 #import "UKDocumentationController.h"
29
30
31 @implementation UKDocumentationController
32
33 -(void) showReadme: (id)sender
34 {
35 [self showHelpBookAnchor: @"readme"];
36 }
37
38
39 -(void) showReleaseNotes: (id)sender
40 {
41 [self showHelpBookAnchor: @"release_notes"];
42 }
43
44
45 -(void) showFAQ: (id)sender
46 {
47 [self showHelpBookAnchor: @"faq"];
48 }
49
50
51 // Main bottleneck for all of our menu item actions:
52 -(void) showHelpBookAnchor: (NSString*)str
53 {
54 NSDictionary* infod = nil;
55 NSBundle* mainb = [NSBundle mainBundle];
56
57 if( [mainb respondsToSelector: @selector(localizedInfoDictionary)] )
58 infod = [mainb localizedInfoDictionary];
59 else
60 infod = [mainb infoDictionary];
61
62 NSString* helpBookName = [infod objectForKey: @"CFBundleHelpBookName"];
63 if( helpBookName == nil )
64 helpBookName = [[mainb infoDictionary] objectForKey: @"CFBundleHelpBookName"];
65 if( [[NSHelpManager sharedHelpManager] respondsToSelector: @selector(openHelpAnchor:inBook:)] )
66 [[NSHelpManager sharedHelpManager] openHelpAnchor: str inBook: helpBookName];
67 else
68 [NSApp showHelp: self];
69 }
70
71
72
73 @end
Something went wrong with that request. Please try again.