Custom fields now correctly are hidden/displayed when protected attribute is set

This commit is contained in:
michael starke
2017-11-03 14:12:14 +01:00
parent 4a1b7972b2
commit 96179556dc
3 changed files with 8 additions and 3 deletions

View File

@@ -1,3 +1,3 @@
github "sparkle-project/Sparkle" ~> 1.18.1 github "sparkle-project/Sparkle" ~> 1.18.1
github "mstarke/KeePassKit" ~> 1.4.1 github "MacPass/KeePassKit" ~> 1.5
github "mstarke/HNHUi" ~> 1.4.1 github "mstarke/HNHUi" ~> 1.4.1

View File

@@ -1,3 +1,3 @@
github "MacPass/KeePassKit" "1.5"
github "mstarke/HNHUi" "1.4.1" github "mstarke/HNHUi" "1.4.1"
github "mstarke/KeePassKit" "1.4.1"
github "sparkle-project/Sparkle" "1.18.1" github "sparkle-project/Sparkle" "1.18.1"

View File

@@ -23,7 +23,7 @@
#import "MPCustomFieldTableViewDelegate.h" #import "MPCustomFieldTableViewDelegate.h"
#import "MPCustomFieldTableCellView.h" #import "MPCustomFieldTableCellView.h"
#import "MPEntryInspectorViewController.h" #import "MPEntryInspectorViewController.h"
#import "HNHUi/HNHUi.h"
#import "KeePassKit/KeePassKit.h" #import "KeePassKit/KeePassKit.h"
@implementation MPCustomFieldTableViewDelegate @implementation MPCustomFieldTableViewDelegate
@@ -44,6 +44,11 @@
withKeyPath:@"objectValue.isProtected" withKeyPath:@"objectValue.isProtected"
options:nil]; options:nil];
[view.valueTextField bind:NSStringFromSelector(@selector(showPassword))
toObject:view
withKeyPath:@"objectValue.isProtected"
options:@{NSValueTransformerNameBindingOption: NSNegateBooleanTransformerName}];
for(NSControl *control in @[view.labelTextField, view.valueTextField, view.removeButton, view.protectedButton ]) { for(NSControl *control in @[view.labelTextField, view.valueTextField, view.removeButton, view.protectedButton ]) {
[control bind:NSEnabledBinding [control bind:NSEnabledBinding