mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 13:49:22 +00:00
Newly created Groups now get shown by expanding theri parent node after creation. Selection not working for now
This commit is contained in:
@@ -159,7 +159,18 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
|
||||
# pragma mark MPDocument Notifications
|
||||
- (void)_didAddGroup:(NSNotification *)notification {
|
||||
//TODO: find group to expand!
|
||||
NSDictionary *userInfo = [notification userInfo];
|
||||
KPKGroup *group = userInfo[MPDocumentGroupKey];
|
||||
NSIndexPath *groupIndexPath = [group indexPath];
|
||||
NSTreeNode *groupNode = [[self.treeController arrangedObjects] descendantNodeAtIndexPath:groupIndexPath];
|
||||
[self.outlineView expandItem:groupNode.parentNode];
|
||||
/* TODO: Select created Group
|
||||
NSUInteger row = 0;
|
||||
for(NSUInteger index = 0; index < [groupIndexPath length]; index++ ) {
|
||||
row += [groupIndexPath indexAtPosition:index];
|
||||
}
|
||||
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
|
||||
*/
|
||||
}
|
||||
|
||||
- (id)itemUnderMouse {
|
||||
@@ -242,6 +253,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
|
||||
id representedObject = [item representedObject];
|
||||
if([representedObject isKindOfClass:[KPKGroup class]]) {
|
||||
KPKGroup *group = (KPKGroup *)representedObject;
|
||||
NSLog(@"IndexPath for %@: %@ vs. %@", group.name, [item indexPath], [group indexPath]);
|
||||
group.isExpanded = YES;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user