mirror of
https://github.com/transmission/transmission
synced 2025-03-06 11:38:21 +00:00
display tooltip of the file in the message window
This commit is contained in:
parent
60d6dc9a9a
commit
55dae577ef
2 changed files with 27 additions and 10 deletions
|
@ -338,7 +338,7 @@
|
||||||
35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOff.png; path = macosx/Images/ResumeNoWaitOff.png; sourceTree = "<group>"; };
|
35B037FA0AC5B53800A10FDF /* ResumeNoWaitOff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ResumeNoWaitOff.png; path = macosx/Images/ResumeNoWaitOff.png; sourceTree = "<group>"; };
|
||||||
35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilePriorityCell.h; path = macosx/FilePriorityCell.h; sourceTree = "<group>"; };
|
35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilePriorityCell.h; path = macosx/FilePriorityCell.h; sourceTree = "<group>"; };
|
||||||
35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FilePriorityCell.m; path = macosx/FilePriorityCell.m; sourceTree = "<group>"; };
|
35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FilePriorityCell.m; path = macosx/FilePriorityCell.m; sourceTree = "<group>"; };
|
||||||
3C7A118D0D0B2EB800B5701F /* libnatpmp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libnatpmp.a; path = build/Release/libnatpmp.a; sourceTree = "<group>"; };
|
3C7A118D0D0B2EB800B5701F /* libnatpmp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libnatpmp.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
3C7A11910D0B2EE300B5701F /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getgateway.c; path = "third-party/libnatpmp/getgateway.c"; sourceTree = "<group>"; };
|
3C7A11910D0B2EE300B5701F /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getgateway.c; path = "third-party/libnatpmp/getgateway.c"; sourceTree = "<group>"; };
|
||||||
3C7A11920D0B2EE300B5701F /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = getgateway.h; path = "third-party/libnatpmp/getgateway.h"; sourceTree = "<group>"; };
|
3C7A11920D0B2EE300B5701F /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = getgateway.h; path = "third-party/libnatpmp/getgateway.h"; sourceTree = "<group>"; };
|
||||||
3C7A11930D0B2EE300B5701F /* natpmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = natpmp.c; path = "third-party/libnatpmp/natpmp.c"; sourceTree = "<group>"; };
|
3C7A11930D0B2EE300B5701F /* natpmp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = natpmp.c; path = "third-party/libnatpmp/natpmp.c"; sourceTree = "<group>"; };
|
||||||
|
@ -835,7 +835,6 @@
|
||||||
29B97314FDCFA39411CA2CEA /* Transmission */ = {
|
29B97314FDCFA39411CA2CEA /* Transmission */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
3C7A11880D0B2E6700B5701F /* libnatpmp */,
|
|
||||||
BEFC1C0B0C07754700B0BB3C /* daemon */,
|
BEFC1C0B0C07754700B0BB3C /* daemon */,
|
||||||
4D1838DC09DEC04A0047D688 /* libtransmission */,
|
4D1838DC09DEC04A0047D688 /* libtransmission */,
|
||||||
4DDBB71F09E16BFE00284745 /* CLI */,
|
4DDBB71F09E16BFE00284745 /* CLI */,
|
||||||
|
@ -843,6 +842,7 @@
|
||||||
4DDBB71509E16B3F00284745 /* Libraries */,
|
4DDBB71509E16B3F00284745 /* Libraries */,
|
||||||
BE75C3570C72A0D600DBEFE0 /* libevent */,
|
BE75C3570C72A0D600DBEFE0 /* libevent */,
|
||||||
BE1183410CE15DF00002D0F3 /* libminiupnp */,
|
BE1183410CE15DF00002D0F3 /* libminiupnp */,
|
||||||
|
3C7A11880D0B2E6700B5701F /* libnatpmp */,
|
||||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||||
);
|
);
|
||||||
name = Transmission;
|
name = Transmission;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
- (void) resizeColumn;
|
- (void) resizeColumn;
|
||||||
- (NSString *) stringForMessage: (NSDictionary *) message;
|
- (NSString *) stringForMessage: (NSDictionary *) message;
|
||||||
|
- (NSString *) fileForMessage: (NSDictionary *) message;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -199,6 +200,12 @@
|
||||||
[fMessageTable reloadData];
|
[fMessageTable reloadData];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
|
||||||
|
tableColumn: (NSTableColumn *) column row: (int) row mouseLocation: (NSPoint) mouseLocation
|
||||||
|
{
|
||||||
|
return [self fileForMessage: [fMessages objectAtIndex: row]];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) copy: (id) sender
|
- (void) copy: (id) sender
|
||||||
{
|
{
|
||||||
NSPasteboard * pb = [NSPasteboard generalPasteboard];
|
NSPasteboard * pb = [NSPasteboard generalPasteboard];
|
||||||
|
@ -318,24 +325,34 @@
|
||||||
switch ([[message objectForKey: @"Level"] intValue])
|
switch ([[message objectForKey: @"Level"] intValue])
|
||||||
{
|
{
|
||||||
case TR_MSG_ERR:
|
case TR_MSG_ERR:
|
||||||
level = @"Error";
|
level = @"[Error]";
|
||||||
break;
|
break;
|
||||||
case TR_MSG_INF:
|
case TR_MSG_INF:
|
||||||
level = @"Info";
|
level = @"[Info]";
|
||||||
break;
|
break;
|
||||||
case TR_MSG_DBG:
|
case TR_MSG_DBG:
|
||||||
level = @"Debug";
|
level = @"[Debug]";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
level = @"";
|
level = @"";
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString * file = [message objectForKey: @"File"],
|
NSMutableArray * strings = [NSMutableArray arrayWithObjects: [message objectForKey: @"Date"], level,
|
||||||
* fileString = file ? [NSString stringWithFormat: @" %@:%@", [message objectForKey: @"File"], [message objectForKey: @"Line"]]
|
[message objectForKey: @"Message"], nil];
|
||||||
: @"";
|
NSString * file;
|
||||||
|
if ((file = [self fileForMessage: message]))
|
||||||
|
[strings insertObject: file atIndex: 1];
|
||||||
|
|
||||||
return [NSString stringWithFormat: @"%@%@ [%@] %@", [message objectForKey: @"Date"], fileString, level,
|
return [strings componentsJoinedByString: @" "];
|
||||||
[message objectForKey: @"Message"]];
|
}
|
||||||
|
|
||||||
|
- (NSString *) fileForMessage: (NSDictionary *) message
|
||||||
|
{
|
||||||
|
NSString * file;
|
||||||
|
if ((file = [message objectForKey: @"File"]))
|
||||||
|
return [NSString stringWithFormat: @"%@:%@", [message objectForKey: @"File"], [message objectForKey: @"Line"]];
|
||||||
|
else
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Reference in a new issue