Newly created groups should now be selected

Added lock on sleep
Lock on idle still missing
Fixed some issues with clipboard clearing
Fixed preferences bindings errors
This commit is contained in:
michael starke
2013-06-21 18:29:24 +02:00
parent 15bae7c944
commit 1c91b1a9a1
16 changed files with 126 additions and 39 deletions

View File

@@ -58,7 +58,7 @@
[_datasource release];
[_outlineDelegate release];
[_menu release];
[super dealloc];
}
@@ -86,6 +86,26 @@
[_outlineView expandItem:node expandChildren:NO];
}
- (void)setupNotifications:(MPDocumentWindowController *)windowController {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didCreateGroup:) name:MPDocumentDidAddGroupNotification object:[windowController document]];
}
- (void)_didCreateGroup:(NSNotification *)notification {
NSInteger selectedRow = [_outlineView selectedRow];
NSIndexSet *indexSet;
if( selectedRow == -1) {
MPDocument *document = [[self windowController] document];
indexSet = [NSIndexSet indexSetWithIndex:[document.root.groups count]];
//TODO: Find out why selection is not set (treeUpdate?)
}
else {
id item = [_outlineView itemAtRow:selectedRow];
[_outlineView expandItem:item];
indexSet = [NSIndexSet indexSetWithIndex:selectedRow + 1];
}
[_outlineView selectRowIndexes:indexSet byExtendingSelection:NO];
}
- (NSMenu *)_contextMenu {
NSMenu *menu = [[NSMenu alloc] init];
NSArray *items = [MPContextMenuHelper contextMenuItemsWithItems:MPContextMenuMinimal];
@@ -127,7 +147,7 @@
- (void)deleteEntry:(id)sender {
KdbGroup *group = [self _clickedOrSelectedGroup];
if(group && group.parent) {
[group.parent removeGroupUndoable:group];
[group.parent removeGroupUndoable:group];
}
}