Started Move to KeePassKit - Project compiles but does NOT work properly

Removed MiniKeePass Categories.
Moved Random streams form MiniKeePass to KeePassKit
Changed MacPass to use KeePassKit
This commit is contained in:
michael starke
2013-09-01 02:16:27 +02:00
parent 319d165141
commit 5e4254b45f
70 changed files with 498 additions and 2521 deletions

View File

@@ -10,28 +10,31 @@
#import "MPDocument.h"
#import "MPCustomFieldTableCellView.h"
#import "Kdb4Node.h"
#import "StringField+Undo.h"
#import "KPKEntry.h"
#import "KPKAttribute.h"
@implementation MPCustomFieldTableViewDelegate
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
MPDocument *document = [[[tableView window] windowController] document];
if(![document.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
return nil;
}
Kdb4Entry *entry = (Kdb4Entry *)document.selectedEntry;
KPKEntry *entry = document.selectedEntry;
MPCustomFieldTableCellView *view = [tableView makeViewWithIdentifier:@"SelectedCell" owner:tableView];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_customFieldFrameChanged:) name:NSViewFrameDidChangeNotification object:view];
if([document.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
StringField *stringField = entry.stringFields[row];
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:)];
[view.removeButton setTag:row];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(_customFieldFrameChanged:)
name:NSViewFrameDidChangeNotification
object:view];
NSAssert([entry.customAttributes count] > row, @"Count of custom attributes must match row");
KPKAttribute *attribute = entry.customAttributes[row];
NSDictionary *validateOptions = @{ NSValidatesImmediatelyBindingOption: @YES };
[view.labelTextField bind:NSValueBinding toObject:attribute withKeyPath:@"key" options:validateOptions];
[view.valueTextField bind:NSValueBinding toObject:attribute withKeyPath:@"value" options:nil];
[view.removeButton setTarget:self.viewController];
[view.removeButton setAction:@selector(removeCustomField:)];
[view.removeButton setTag:row];
return view;
}