diff --git a/macosx/Controller.m b/macosx/Controller.m index 351041d98..55dbcb7fc 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -2497,18 +2497,14 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi : [NSImage imageNamed: NSImageNameStopProgressTemplate]; } else if ([ident isEqualToString: @"DL Image"]) - return ![fDefaults boolForKey: @"DisplayGroupRowRatio"] ? [NSImage imageNamed: @"DownArrowGroupTemplate.png"] : nil; + return [NSImage imageNamed: @"DownArrowGroupTemplate.png"]; else if ([ident isEqualToString: @"UL Image"]) return [NSImage imageNamed: [fDefaults boolForKey: @"DisplayGroupRowRatio"] ? @"YingYangGroupTemplate.png" : @"UpArrowGroupTemplate.png"]; else { - BOOL upload = [ident isEqualToString: @"UL"]; if ([fDefaults boolForKey: @"DisplayGroupRowRatio"]) { - if (!upload) - return nil; - uint64_t uploaded = 0, downloaded = 0; NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator]; Torrent * torrent; @@ -2522,6 +2518,8 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi } else { + BOOL upload = [ident isEqualToString: @"UL"]; + float rate = 0.0; NSEnumerator * enumerator = [[item objectForKey: @"Torrents"] objectEnumerator]; Torrent * torrent; diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index fd63351ee..32bbe591e 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -48,6 +48,8 @@ - (BOOL) pointInGroupStatusRect: (NSPoint) point; +- (void) setGroupStatusColumns; + - (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files; - (void) resizePiecesBarIncrement; @@ -89,6 +91,10 @@ else fCollapsedGroups = [[NSMutableIndexSet alloc] init]; + //set group columns to show ratio (nib is set to speeds) + if ([fDefaults boolForKey: @"DisplayGroupRowRatio"]) + [self setGroupStatusColumns]; + fMouseControlRow = -1; fMouseRevealRow = -1; fMouseActionRow = -1; @@ -345,7 +351,8 @@ if ([self pointInGroupStatusRect: point]) { [fDefaults setBool: ![fDefaults boolForKey: @"DisplayGroupRowRatio"] forKey: @"DisplayGroupRowRatio"]; - [self reloadData]; + [self setGroupStatusColumns]; + return; } @@ -776,6 +783,23 @@ && ![fDefaults boolForKey: @"DisplayGroupRowRatio"]); } +- (void) setGroupStatusColumns +{ + BOOL ratio = [fDefaults boolForKey: @"DisplayGroupRowRatio"]; + + NSTableColumn * dlTableColumn = [self tableColumnWithIdentifier: @"DL"]; + if ([dlTableColumn isHidden] == ratio) + return; + + [dlTableColumn setHidden: ratio]; + [[self tableColumnWithIdentifier: @"DL Image"] setHidden: ratio]; + + [[self tableColumnWithIdentifier: @"UL Image"] setWidth: ratio ? 10.0 : 8.0]; + + NSTableColumn * groupTableColumn = [self tableColumnWithIdentifier: @"Group"]; + [groupTableColumn setWidth: [groupTableColumn width] + (ratio ? -2.0 : 2.0)]; +} + - (void) updateFileMenu: (NSMenu *) menu forFiles: (NSArray *) files { BOOL create = [menu numberOfItems] <= 0;