moved overlay display to MPPasteboardController

content copied in text fields now gets purged if clear-clipboard is set to true
This commit is contained in:
michael starke
2017-10-26 18:30:56 +02:00
parent 37fc5241ce
commit 509d0c84b2
14 changed files with 208 additions and 154 deletions

View File

@@ -33,19 +33,23 @@
[view.labelTextField bind:NSValueBinding
toObject:view
withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(key))]
withKeyPath:@"objectValue.key"
options:@{ NSValidatesImmediatelyBindingOption: @YES }];
[view.valueTextField bind:NSValueBinding
toObject:view
withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(value))]
withKeyPath:@"objectValue.value"
options:nil];
// TODO: Move to public KeePassKit API!
for(NSControl *control in @[view.labelTextField, view.valueTextField, view.removeButton ]) {
[view.protectedButton bind:NSValueBinding
toObject:view
withKeyPath:@"objectValue.isProtected"
options:nil];
for(NSControl *control in @[view.labelTextField, view.valueTextField, view.removeButton, view.protectedButton ]) {
[control bind:NSEnabledBinding
toObject:view
withKeyPath:[NSString stringWithFormat:@"%@.%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(entry)), NSStringFromSelector(@selector(isHistory))]
options:@{NSConditionallySetsEditableBindingOption: @NO, NSValueTransformerNameBindingOption: NSNegateBooleanTransformerName}];
withKeyPath:@"objectValue.isEditable"
options:@{NSConditionallySetsEditableBindingOption: @NO }];
}
view.removeButton.target = self.viewController;