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
|
rect: (NSRectPointer) rect tableColumn: (NSTableColumn *) column
|
||||||
row: (int) row mouseLocation: (NSPoint) mouseLocation
|
row: (int) row mouseLocation: (NSPoint) mouseLocation
|
||||||
{
|
{
|
||||||
#warning tooltip for file table?
|
|
||||||
if (tableView == fPeerTable)
|
if (tableView == fPeerTable)
|
||||||
{
|
{
|
||||||
NSDictionary * peerDic = [fPeers objectAtIndex: row];
|
NSDictionary * peerDic = [fPeers objectAtIndex: row];
|
||||||
|
@ -680,8 +679,7 @@
|
||||||
- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn
|
- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn
|
||||||
byItem: (id) item
|
byItem: (id) item
|
||||||
{
|
{
|
||||||
NSString * ident = [tableColumn identifier];
|
if ([[tableColumn identifier] isEqualToString: @"Size"])
|
||||||
if ([ident isEqualToString: @"Size"])
|
|
||||||
return ![[item objectForKey: @"IsFolder"] boolValue]
|
return ![[item objectForKey: @"IsFolder"] boolValue]
|
||||||
? [NSString stringForFileSize: [[item objectForKey: @"Size"] unsignedLongLongValue]] : @"";
|
? [NSString stringForFileSize: [[item objectForKey: @"Size"] unsignedLongLongValue]] : @"";
|
||||||
else
|
else
|
||||||
|
@ -701,6 +699,17 @@
|
||||||
[cell setImage: icon];
|
[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
|
- (NSArray *) peerSortDescriptors
|
||||||
{
|
{
|
||||||
NSMutableArray * descriptors = [NSMutableArray array];
|
NSMutableArray * descriptors = [NSMutableArray array];
|
||||||
|
|
|
@ -1074,10 +1074,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
{
|
{
|
||||||
file = &fInfo->files[i];
|
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];
|
pathComponents = [[[NSString stringWithUTF8String: file->name] pathComponents] mutableCopy];
|
||||||
if (fInfo->multifile)
|
if (fInfo->multifile)
|
||||||
[pathComponents removeObjectAtIndex: 0];
|
[pathComponents removeObjectAtIndex: 0];
|
||||||
|
|
Loading…
Add table
Reference in a new issue