forked from kalleboo/PingMenu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PreferencesWindowController.m
47 lines (36 loc) · 1018 Bytes
/
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
//
// PreferencesWindowController.m
// PingMenu
//
// Created by Gaurav Chandrashekar on 1/10/14.
//
//
#import "PreferencesWindowController.h"
#import "PingMenuAppDelegate.h"
@interface PreferencesWindowController ()
@end
@implementation PreferencesWindowController
- (id)initWithWindow:(NSWindow *)window
{
self = [super initWithWindow:window];
if (self) {
// Initialization code here.
}
return self;
}
- (void)windowDidLoad
{
[super windowDidLoad];
PingMenuAppDelegate *AppDelegate = (PingMenuAppDelegate *)[[NSApplication sharedApplication] delegate];
self.domain.stringValue = AppDelegate.pingHost;
[self.window setDefaultButtonCell:self.saveButton.cell];
}
- (IBAction)cancelButtonPressed:(id)sender {
[self close];
}
- (IBAction)saveButtonPressed:(id)sender {
PingMenuAppDelegate *AppDelegate = (PingMenuAppDelegate *)[[NSApplication sharedApplication] delegate];
AppDelegate.pingHost = self.domain.stringValue;
[self close];
}
@end