1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

fix bug when showing groups and changing sort type to queue order

This commit is contained in:
Mitchell Livingston 2008-01-24 21:14:02 +00:00
parent d922389c9d
commit 4ac75b1b80
3 changed files with 2035 additions and 2056 deletions

View file

@ -1609,6 +1609,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
sortType = SORT_ORDER; sortType = SORT_ORDER;
[fDefaults setBool: NO forKey: @"SortReverse"]; [fDefaults setBool: NO forKey: @"SortReverse"];
[fDefaults setBool: NO forKey: @"SortByGroup"]; [fDefaults setBool: NO forKey: @"SortByGroup"];
[self updateDisplay: nil]; //ensure groups are removed
break; break;
case SORT_DATE_TAG: case SORT_DATE_TAG:
sortType = SORT_DATE; sortType = SORT_DATE;

File diff suppressed because it is too large Load diff

View file

@ -105,12 +105,6 @@
fGroupIndexes = indexes; fGroupIndexes = indexes;
} }
#warning needed?
- (id) dataCellForRow: (NSInteger) row
{
return (row == -1 || ![fGroupIndexes containsIndex: row]) ? fTorrentCell : nil;
}
- (BOOL) tableView: (NSTableView *) tableView isGroupRow: (NSInteger) row - (BOOL) tableView: (NSTableView *) tableView isGroupRow: (NSInteger) row
{ {
return [fGroupIndexes containsIndex: row]; return [fGroupIndexes containsIndex: row];
@ -123,7 +117,7 @@
- (NSCell *) tableView: (NSTableView *) tableView dataCellForTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row - (NSCell *) tableView: (NSTableView *) tableView dataCellForTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row
{ {
return [self dataCellForRow: row]; return ![fGroupIndexes containsIndex: row] ? fTorrentCell : nil;
} }
- (void) tableView: (NSTableView *) tableView willDisplayCell: (id) cell forTableColumn: (NSTableColumn *) tableColumn row: (int) row - (void) tableView: (NSTableView *) tableView willDisplayCell: (id) cell forTableColumn: (NSTableColumn *) tableColumn row: (int) row
@ -449,7 +443,7 @@
[fActionMenu appendItemsFromMenu: fileMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange: range] atBottom: YES]; [fActionMenu appendItemsFromMenu: fileMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange: range] atBottom: YES];
//place menu below button //place menu below button
NSRect rect = [[self dataCellForRow: row] iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]; NSRect rect = [fTorrentCell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]];
NSPoint location = rect.origin; NSPoint location = rect.origin;
location.y += rect.size.height + 5.0; location.y += rect.size.height + 5.0;
location = [self convertPoint: location toView: nil]; location = [self convertPoint: location toView: nil];
@ -647,8 +641,7 @@
if (row < 0 || [fGroupIndexes containsIndex: row]) if (row < 0 || [fGroupIndexes containsIndex: row])
return NO; return NO;
TorrentCell * cell = [self dataCellForRow: row]; return NSPointInRect(point, [fTorrentCell controlButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
return NSPointInRect(point, [cell controlButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
} }
- (BOOL) pointInRevealRect: (NSPoint) point - (BOOL) pointInRevealRect: (NSPoint) point
@ -657,8 +650,7 @@
if (row < 0 || [fGroupIndexes containsIndex: row]) if (row < 0 || [fGroupIndexes containsIndex: row])
return NO; return NO;
TorrentCell * cell = [self dataCellForRow: row]; return NSPointInRect(point, [fTorrentCell revealButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
return NSPointInRect(point, [cell revealButtonRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
} }
- (BOOL) pointInActionRect: (NSPoint) point - (BOOL) pointInActionRect: (NSPoint) point
@ -667,8 +659,7 @@
if (row < 0 || [fGroupIndexes containsIndex: row]) if (row < 0 || [fGroupIndexes containsIndex: row])
return NO; return NO;
TorrentCell * cell = [self dataCellForRow: row]; return NSPointInRect(point, [fTorrentCell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
return NSPointInRect(point, [cell iconRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
} }
- (BOOL) pointInProgressRect: (NSPoint) point - (BOOL) pointInProgressRect: (NSPoint) point
@ -682,7 +673,7 @@
cell = (TorrentCell *)[self preparedCellAtColumn: 0 row: row]; cell = (TorrentCell *)[self preparedCellAtColumn: 0 row: row];
else else
{ {
cell = [self dataCellForRow: row]; cell = fTorrentCell;
[cell setRepresentedObject: [fTorrents objectAtIndex: row]]; [cell setRepresentedObject: [fTorrents objectAtIndex: row]];
} }
return NSPointInRect(point, [cell progressRectForBounds: [self frameOfCellAtColumn: 0 row: row]]); return NSPointInRect(point, [cell progressRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);
@ -699,7 +690,7 @@
cell = (TorrentCell *)[self preparedCellAtColumn: 0 row: row]; cell = (TorrentCell *)[self preparedCellAtColumn: 0 row: row];
else else
{ {
cell = [self dataCellForRow: row]; cell = fTorrentCell;
[cell setRepresentedObject: [fTorrents objectAtIndex: row]]; [cell setRepresentedObject: [fTorrents objectAtIndex: row]];
} }
return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]); return NSPointInRect(point, [cell minimalStatusRectForBounds: [self frameOfCellAtColumn: 0 row: row]]);