mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 01:02:24 +00:00
Only Enable password entry fields when option is checked
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
@property (weak) IBOutlet NSButton *togglePasswordButton;
|
@property (weak) IBOutlet NSButton *togglePasswordButton;
|
||||||
@property (weak) IBOutlet NSTextField *errorTextField;
|
@property (weak) IBOutlet NSTextField *errorTextField;
|
||||||
@property (weak) IBOutlet NSButton *changePasswordButton;
|
@property (weak) IBOutlet NSButton *changePasswordButton;
|
||||||
|
@property (weak) IBOutlet NSButton *hasPasswordSwitchButton;
|
||||||
@property (nonatomic,assign) BOOL allowsEmptyPasswordOrKey;
|
@property (nonatomic,assign) BOOL allowsEmptyPasswordOrKey;
|
||||||
|
|
||||||
@property (weak) id<MPPasswordEditWindowDelegate> delegate;
|
@property (weak) id<MPPasswordEditWindowDelegate> delegate;
|
||||||
|
|||||||
@@ -56,8 +56,10 @@
|
|||||||
|
|
||||||
NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName };
|
NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName };
|
||||||
[self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil];
|
[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.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 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.errorTextField bind:NSHiddenBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil];
|
||||||
[self.changePasswordButton bind:NSEnabledBinding 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];
|
[self.keyfilePathControl bind:NSValueBinding toObject:self withKeyPath:@"keyURL" options:nil];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<connections>
|
<connections>
|
||||||
<outlet property="changePasswordButton" destination="68" id="85"/>
|
<outlet property="changePasswordButton" destination="68" id="85"/>
|
||||||
<outlet property="errorTextField" destination="12" id="79"/>
|
<outlet property="errorTextField" destination="12" id="79"/>
|
||||||
|
<outlet property="hasPasswordSwitchButton" destination="yKc-I9-uzv" id="aUH-R4-WwP"/>
|
||||||
<outlet property="keyfilePathControl" destination="4" id="63"/>
|
<outlet property="keyfilePathControl" destination="4" id="63"/>
|
||||||
<outlet property="passwordRepeatTextField" destination="11" id="62"/>
|
<outlet property="passwordRepeatTextField" destination="11" id="62"/>
|
||||||
<outlet property="passwordTextField" destination="9" id="61"/>
|
<outlet property="passwordTextField" destination="9" id="61"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user