undo commit of being unable to unselect all files, since it was way too expensive on torrents with many files and might actually be desirable in some situations

This commit is contained in:
Mitchell Livingston 2007-01-18 06:27:34 +00:00
parent 263bf6934d
commit 4bffa20e5c
1 changed files with 2 additions and 20 deletions

View File

@ -55,7 +55,6 @@
- (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item; - (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item;
- (NSMutableDictionary *) resetFileCheckStateForItemParent: (NSMutableDictionary *) originalChild; - (NSMutableDictionary *) resetFileCheckStateForItemParent: (NSMutableDictionary *) originalChild;
- (BOOL) otherFilesWithCheckEnabled: (NSMutableDictionary *) item;
@end @end
@ -694,7 +693,7 @@
[self setFileCheckState: state forItem: item]; [self setFileCheckState: state forItem: item];
NSMutableDictionary * topItem = [self resetFileCheckStateForItemParent: item]; NSMutableDictionary * topItem = [self resetFileCheckStateForItemParent: item];
[fFileOutline reloadData]; [fFileOutline reloadItem: topItem reloadChildren: YES];
} }
- (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item - (void) setFileCheckState: (int) state forItem: (NSMutableDictionary *) item
@ -760,28 +759,11 @@
else if ([[tableColumn identifier] isEqualToString: @"Check"]) else if ([[tableColumn identifier] isEqualToString: @"Check"])
{ {
//always enable if mixed or off because clicking will turn on //always enable if mixed or off because clicking will turn on
[cell setEnabled: /*[cell intValue] != NSOnState || [self otherFilesWithCheckEnabled: item]*/ NO]; [cell setEnabled: NO];
} }
else; else;
} }
- (BOOL) otherFilesWithCheckEnabled: (NSMutableDictionary *) item
{
NSMutableDictionary * parent = [item objectForKey: @"Parent"], * sibling;
NSEnumerator * enumerator = [(parent ? [parent objectForKey: @"Children"] : fFiles) objectEnumerator];
while ((sibling = [enumerator nextObject]))
{
if (sibling == item)
continue;
else if ([[sibling objectForKey: @"Check"] intValue] != NSOffState)
return YES;
else;
}
return parent ? [self otherFilesWithCheckEnabled: parent] : NO;
}
- (NSString *) outlineView: (NSOutlineView *) outlineView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect - (NSString *) outlineView: (NSOutlineView *) outlineView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
tableColumn: (NSTableColumn *) tableColumn item: (id) item mouseLocation: (NSPoint) mouseLocation tableColumn: (NSTableColumn *) tableColumn item: (id) item mouseLocation: (NSPoint) mouseLocation
{ {