Introduced KVO compliance for group and entry manipulation

Converted outline view to use NSTreeController
This commit is contained in:
michael starke
2013-06-08 01:34:03 +02:00
parent ba924701b0
commit 929871e682
13 changed files with 183 additions and 26 deletions

View File

@@ -141,6 +141,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[self.entryTable setDelegate:self];
[self.entryTable setDoubleAction:@selector(_columnDoubleClick:)];
[self.entryTable setTarget:self];
[self.entryTable setFloatsGroupRows:NO];
[self _setupEntryMenu];
NSTableColumn *parentColumn = [self.entryTable tableColumns][0];
@@ -216,6 +217,9 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
return view;
}
- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
NSLog(@"didAddRowViewForRow: %ld color:%@ isFloating:%i", (long)row, rowView.backgroundColor, rowView.isFloating);
}
- (void)tableViewSelectionDidChange:(NSNotification *)notification {
if([self.entryTable selectedRow] < 0) {
@@ -469,12 +473,14 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
if(!_activeGroup) {
return; // Entries are not allowed in root group
}
MPDocument *document = [[NSDocumentController sharedDocumentController] currentDocument];
[document createEntry:_activeGroup];
}
- (void)deleteEntry:(id)sender {
// TODO:
KdbEntry *entry =[self _clickedOrSelectedEntry];
[entry.parent removeEntryUndoable:entry];
}
- (void)_toggleFilterSpace:(id)sender {