-
Notifications
You must be signed in to change notification settings - Fork 3
/
AppController.m
38 lines (29 loc) · 1007 Bytes
/
AppController.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
#import "AppController.h"
@implementation AppController
- (void)dealloc
{
[prefs release];
[super dealloc];
}
- (IBAction)showPrefs:(id)sender
{
if (!prefs) {
// Determine path to the sample preference panes
NSString *pathToPanes = [[NSString stringWithFormat:@"%@/Contents/Preference Panes/", [[NSBundle mainBundle] bundlePath]]
stringByStandardizingPath];
prefs = [[SS_PrefsController alloc] initWithPanesSearchPath:pathToPanes];
// Set which panes are included, and their order.
[prefs setPanesOrder:[NSArray arrayWithObjects:@"General", @"Updates", @"A Non-Existent Preference Pane", nil]];
}
// Show the preferences window.
[prefs showPreferencesWindow];
}
- (NSString *)state
{
NSNumber *state = [[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:@"someOption"];
if(state) {
return ([state intValue] == NSOnState) ? @"checked" : @"unchecked";
}
return nil;
}
@end