-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
AdvancedPrefController.m
61 lines (47 loc) · 1.49 KB
/
AdvancedPrefController.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
54
55
56
57
58
59
60
61
//
// AdvancedPrefController.m
// Hachidori
//
// Created by Tail Red on 3/21/15.
//
//
#import "AdvancedPrefController.h"
@interface AdvancedPrefController ()
@end
@implementation AdvancedPrefController
- (instancetype)init {
return [super initWithNibName:@"AdvancedPrefController" bundle:nil];
}
- (void)loadView {
[super loadView];
}
#pragma mark -
#pragma mark MASPreferencesViewController
- (NSString *)viewIdentifier {
return @"AdvancedPreferences";
}
- (NSImage *)toolbarItemImage {
if (@available(macOS 11.0, *)) {
return [NSImage imageWithSystemSymbolName:@"gearshape.2" accessibilityDescription:nil];
} else {
// Fallback on earlier versions
return [NSImage imageNamed:NSImageNameAdvanced];
}
}
- (NSString *)toolbarItemLabel {
return NSLocalizedString(@"Advanced", @"Toolbar item name for the Advanced preference pane");
}
- (IBAction)getHelp:(id)sender {
//Show Help
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://help.malupdaterosx.moe/hachidori/advanced-options/"]];
}
- (void)controlTextDidChange:(NSNotification *)notification {
NSTextField * textfield = notification.object;
if ([textfield.identifier isEqualToString:@"kodiaddress"]) {
[NSNotificationCenter.defaultCenter postNotificationName:@"KodiAddressChanged" object:textfield.stringValue];
}
}
- (IBAction)setKodiReach:(id)sender {
[NSNotificationCenter.defaultCenter postNotificationName:@"KodiToggled" object:nil];
}
@end