Only Enable password entry fields when option is checked

This commit is contained in:
Andrew Schleifer
2013-11-23 16:24:27 -06:00
parent e38be4e147
commit 4f0fc87037
3 changed files with 4 additions and 0 deletions

View File

@@ -56,8 +56,10 @@
NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName };
[self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil];
[self.passwordTextField bind:NSEnabledBinding toObject:self.hasPasswordSwitchButton withKeyPath:@"cell.state" options:nil];
[self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil];
[self.passwordRepeatTextField bind:NSEnabledBinding toObject:self withKeyPath:@"showPassword" options:negateOption];
[self.passwordRepeatTextField bind:NSEnabledBinding toObject:self.hasPasswordSwitchButton withKeyPath:@"cell.state" options:nil];
[self.errorTextField bind:NSHiddenBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
[self.changePasswordButton bind:NSEnabledBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
[self.keyfilePathControl bind:NSValueBinding toObject:self withKeyPath:@"keyURL" options:nil];