Files
MacPass/MacPass/MPIntegrationSettingsController.m
michael starke 273b77572b Moving away from custom "didLoadView" initialisations.
Added DDHotKeyTextField to settings to be able to customise global auto type hotkey. (still disabled for now)
2014-03-23 21:07:16 +01:00

49 lines
1.6 KiB
Objective-C

//
// MPServerSettingsController.m
// MacPass
//
// Created by Michael Starke on 17.06.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPIntegrationSettingsController.h"
#import "MPSettingsHelper.h"
#import "MPIconHelper.h"
@interface MPIntegrationSettingsController ()
@end
@implementation MPIntegrationSettingsController
- (NSString *)identifier {
return @"Integration";
}
- (NSImage *)image {
return [NSImage imageNamed:NSImageNameComputer];
}
- (NSString *)label {
return NSLocalizedString(@"INTEGRATION_SETTINGS", "");
}
- (id)init {
self = [super initWithNibName:@"IntegrationSettings" bundle:nil];
return self;
}
- (void)awakeFromNib {
NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
NSString *serverKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableHttpServer];
NSString *globalAutotypeKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableGlobalAutotype];
NSString *quicklookKeyPath = [MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyEnableQuicklookPreview];
[self.enableServerCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:serverKeyPath options:nil];
[self.enableServerCheckbutton setEnabled:NO];
[self.enableGlobalAutotypeCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:globalAutotypeKeyPath options:nil];
[self.enableQuicklookCheckbutton bind:NSValueBinding toObject:defaultsController withKeyPath:quicklookKeyPath options:nil];
}
@end