mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
re-add tooltips to file table
This commit is contained in:
parent
99c63daaea
commit
839a026fe7
2 changed files with 12 additions and 7 deletions
|
@ -644,7 +644,6 @@
|
|||
rect: (NSRectPointer) rect tableColumn: (NSTableColumn *) column
|
||||
row: (int) row mouseLocation: (NSPoint) mouseLocation
|
||||
{
|
||||
#warning tooltip for file table?
|
||||
if (tableView == fPeerTable)
|
||||
{
|
||||
NSDictionary * peerDic = [fPeers objectAtIndex: row];
|
||||
|
@ -680,8 +679,7 @@
|
|||
- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn
|
||||
byItem: (id) item
|
||||
{
|
||||
NSString * ident = [tableColumn identifier];
|
||||
if ([ident isEqualToString: @"Size"])
|
||||
if ([[tableColumn identifier] isEqualToString: @"Size"])
|
||||
return ![[item objectForKey: @"IsFolder"] boolValue]
|
||||
? [NSString stringForFileSize: [[item objectForKey: @"Size"] unsignedLongLongValue]] : @"";
|
||||
else
|
||||
|
@ -701,6 +699,17 @@
|
|||
[cell setImage: icon];
|
||||
}
|
||||
|
||||
- (NSString *) outlineView: (NSOutlineView *) outlineView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
|
||||
tableColumn: (NSTableColumn *) tableColumn item: (id) item mouseLocation: (NSPoint) mouseLocation
|
||||
{
|
||||
if ([[tableColumn identifier] isEqualToString: @"Size"])
|
||||
return ![[item objectForKey: @"IsFolder"] boolValue]
|
||||
? [[[item objectForKey: @"Size"] stringValue] stringByAppendingString: NSLocalizedString(@" bytes",
|
||||
"Inspector -> Files tab -> table row tooltip")] : @"";
|
||||
else
|
||||
return [item objectForKey: @"Name"];
|
||||
}
|
||||
|
||||
- (NSArray *) peerSortDescriptors
|
||||
{
|
||||
NSMutableArray * descriptors = [NSMutableArray array];
|
||||
|
|
|
@ -1074,10 +1074,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
{
|
||||
file = &fInfo->files[i];
|
||||
|
||||
/*[files addObject: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSString stringWithUTF8String: file->name], @"Name",
|
||||
[NSNumber numberWithUnsignedLongLong: file->length], @"Size", nil]];*/
|
||||
|
||||
pathComponents = [[[NSString stringWithUTF8String: file->name] pathComponents] mutableCopy];
|
||||
if (fInfo->multifile)
|
||||
[pathComponents removeObjectAtIndex: 0];
|
||||
|
|
Loading…
Add table
Reference in a new issue