Changeset 4100


Ignore:
Timestamp:
Dec 8, 2007, 8:42:34 PM (14 years ago)
Author:
livings124
Message:

display tooltip of the file in the message window

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r4098 r4100  
    339339                35F373000C2DA88F00DAA8F2 /* FilePriorityCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FilePriorityCell.h; path = macosx/FilePriorityCell.h; sourceTree = "<group>"; };
    340340                35F373010C2DA88F00DAA8F2 /* FilePriorityCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FilePriorityCell.m; path = macosx/FilePriorityCell.m; sourceTree = "<group>"; };
    341                 3C7A118D0D0B2EB800B5701F /* libnatpmp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libnatpmp.a; path = build/Release/libnatpmp.a; sourceTree = "<group>"; };
     341                3C7A118D0D0B2EB800B5701F /* libnatpmp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libnatpmp.a; sourceTree = BUILT_PRODUCTS_DIR; };
    342342                3C7A11910D0B2EE300B5701F /* getgateway.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = getgateway.c; path = "third-party/libnatpmp/getgateway.c"; sourceTree = "<group>"; };
    343343                3C7A11920D0B2EE300B5701F /* getgateway.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = getgateway.h; path = "third-party/libnatpmp/getgateway.h"; sourceTree = "<group>"; };
     
    836836                        isa = PBXGroup;
    837837                        children = (
    838                                 3C7A11880D0B2E6700B5701F /* libnatpmp */,
    839838                                BEFC1C0B0C07754700B0BB3C /* daemon */,
    840839                                4D1838DC09DEC04A0047D688 /* libtransmission */,
     
    844843                                BE75C3570C72A0D600DBEFE0 /* libevent */,
    845844                                BE1183410CE15DF00002D0F3 /* libminiupnp */,
     845                                3C7A11880D0B2E6700B5701F /* libnatpmp */,
    846846                                19C28FACFE9D520D11CA2CBB /* Products */,
    847847                        );
  • trunk/macosx/MessageWindowController.m

    r4097 r4100  
    3737- (void) resizeColumn;
    3838- (NSString *) stringForMessage: (NSDictionary *) message;
     39- (NSString *) fileForMessage: (NSDictionary *) message;
    3940
    4041@end
     
    198199    [fMessages sortUsingDescriptors: [fMessageTable sortDescriptors]];
    199200    [fMessageTable reloadData];
     201}
     202
     203- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
     204                tableColumn: (NSTableColumn *) column row: (int) row mouseLocation: (NSPoint) mouseLocation
     205{
     206    return [self fileForMessage: [fMessages objectAtIndex: row]];
    200207}
    201208
     
    319326    {
    320327        case TR_MSG_ERR:
    321             level = @"Error";
     328            level = @"[Error]";
    322329            break;
    323330        case TR_MSG_INF:
    324             level = @"Info";
     331            level = @"[Info]";
    325332            break;
    326333        case TR_MSG_DBG:
    327             level = @"Debug";
     334            level = @"[Debug]";
    328335            break;
    329336        default:
     
    331338    }
    332339   
    333     NSString * file = [message objectForKey: @"File"],
    334         * fileString = file ? [NSString stringWithFormat: @" %@:%@", [message objectForKey: @"File"], [message objectForKey: @"Line"]]
    335                             : @"";
    336    
    337     return [NSString stringWithFormat: @"%@%@ [%@] %@", [message objectForKey: @"Date"], fileString, level,
    338                                                             [message objectForKey: @"Message"]];
     340    NSMutableArray * strings = [NSMutableArray arrayWithObjects: [message objectForKey: @"Date"], level,
     341                                [message objectForKey: @"Message"], nil];
     342    NSString * file;
     343    if ((file = [self fileForMessage: message]))
     344        [strings insertObject: file atIndex: 1];
     345   
     346    return [strings componentsJoinedByString: @" "];
     347}
     348
     349- (NSString *) fileForMessage: (NSDictionary *) message
     350{
     351    NSString * file;
     352    if ((file = [message objectForKey: @"File"]))
     353        return [NSString stringWithFormat: @"%@:%@", [message objectForKey: @"File"], [message objectForKey: @"Line"]];
     354    else
     355        return nil;
    339356}
    340357
Note: See TracChangeset for help on using the changeset viewer.