forked from jgallen23/MilkMaid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreferencesWindowController.m
53 lines (44 loc) · 1.45 KB
/
PreferencesWindowController.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// PreferencesWindowController.m
// MilkMaid
//
// Created by Gregamel on 3/10/10.
// Copyright 2010 JGA. All rights reserved.
//
#import "PreferencesWindowController.h"
@implementation PreferencesWindowController
-(void)awakeFromNib {
changed = NO;
[menuBarIconButton setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"menuicon"]];
[dockIconButton setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"dockicon"]];
[tagsInDropDownButton setState:[[NSUserDefaults standardUserDefaults] boolForKey:@"tagsInDropDown"]];
[self.window orderFrontRegardless];
}
-(void)menuBarClicked:(id)sender {
if ([sender state] == NSOnState) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"menuicon"];
} else {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"menuicon"];
}
changed = YES;
}
-(void)dockIconClicked:(id)sender {
if ([sender state] == NSOnState) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"dockicon"];
} else {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"dockicon"];
}
}
-(void)tagsInDropDownClicked:(id)sender {
if ([sender state] == NSOnState) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"tagsInDropDown"];
} else {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"tagsInDropDown"];
}
}
-(void)windowWillClose:(NSNotification *)notification {
if (changed)
[[[NSApplication sharedApplication] delegate] updateMenuIcon];
[self release];
}
@end