mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 22:42:18 +00:00
Added custom string field validation. Still needs testing for default keys
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_customFieldFrameChanged:) name:NSViewFrameDidChangeNotification object:view];
|
||||
if([self.viewController.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
|
||||
StringField *stringField = entry.stringFields[row];
|
||||
[view.labelTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldKeyUndoableKey options:nil];
|
||||
NSDictionary *validateOptions = @{ NSValidatesImmediatelyBindingOption: @YES };
|
||||
[view.labelTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldKeyUndoableKey options:validateOptions];
|
||||
[view.valueTextField bind:NSValueBinding toObject:stringField withKeyPath:MPStringFieldValueUndoableKey options:nil];
|
||||
[view.removeButton setTarget:self.viewController];
|
||||
[view.removeButton setAction:@selector(removeCustomField:)];
|
||||
|
||||
Reference in New Issue
Block a user