mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 08:12:28 +00:00
using properties and NSStringFromSelector
This commit is contained in:
@@ -54,11 +54,11 @@
|
||||
- (void)didLoadView {
|
||||
[self.keyPathControl setDelegate:self.pathControlDelegate];
|
||||
[self.errorImageView setImage:[NSImage imageNamed:NSImageNameCaution]];
|
||||
[self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
[self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
[self.enablePasswordCheckBox bind:NSValueBinding toObject:self withKeyPath:@"enablePassword" options:nil];
|
||||
[self.togglePasswordButton bind:NSEnabledBinding toObject:self withKeyPath:@"enablePassword" options:nil];
|
||||
[self.passwordTextField bind:NSEnabledBinding toObject:self withKeyPath:@"enablePassword" options:nil];
|
||||
[self.passwordTextField bind:NSStringFromSelector(@selector(showPassword)) toObject:self withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil];
|
||||
[self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(showPassword)) options:nil];
|
||||
[self.enablePasswordCheckBox bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(enablePassword)) options:nil];
|
||||
[self.togglePasswordButton bind:NSEnabledBinding toObject:self withKeyPath:NSStringFromSelector(@selector(enablePassword)) options:nil];
|
||||
[self.passwordTextField bind:NSEnabledBinding toObject:self withKeyPath:NSStringFromSelector(@selector(enablePassword)) options:nil];
|
||||
[self _reset];
|
||||
}
|
||||
|
||||
@@ -80,13 +80,14 @@
|
||||
}
|
||||
}
|
||||
NSString *placeHolderString = _enablePassword ? NSLocalizedString(@"PASSWORD_INPUT_ENTER_PASSWORD", "") : NSLocalizedString(@"PASSWORD_INPUT_NO_PASSWORD", "");
|
||||
[[self.passwordTextField cell] setPlaceholderString:placeHolderString];
|
||||
[self.passwordTextField.cell setPlaceholderString:placeHolderString];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Private
|
||||
- (IBAction)_decrypt:(id)sender {
|
||||
/* reset show password */
|
||||
MPDocument *document = self.windowController.document;
|
||||
if(document) {
|
||||
NSError *error = nil;
|
||||
|
||||
Reference in New Issue
Block a user