Changeset 1544


Ignore:
Timestamp:
Mar 8, 2007, 4:45:37 AM (15 years ago)
Author:
livings124
Message:

get the pex branch compiling on mac

Location:
branches/pex
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/pex/libtransmission/transmission.h

    r1540 r1544  
    5252#define TR_DEFAULT_PORT   9090
    5353
     54#define TR_PEER_FROM__MAX       4
    5455#define TR_PEER_FROM_INCOMING   0 /* connections made to the listening port */
    5556#define TR_PEER_FROM_TRACKER    1 /* peers received from a tracker */
    5657#define TR_PEER_FROM_CACHE      2 /* peers read from the peer cache */
    5758#define TR_PEER_FROM_PEX        3 /* peers discovered via PEX */
    58 #define TR_PEER_FROM__MAX       4
    5959
    6060/***********************************************************************
  • branches/pex/macosx/InfoWindowController.m

    r1533 r1544  
    667667    {
    668668        NSDictionary * peerDic = [fPeers objectAtIndex: row];
     669       
     670        NSString * fromString;
     671        int from = [[peerDic objectForKey: @"From"] intValue];
     672        if (from == TR_PEER_FROM_INCOMING)
     673            fromString = NSLocalizedString(@"incoming connection", "Inspector -> Peers tab -> table row tooltip");
     674        else if (from == TR_PEER_FROM_CACHE)
     675            fromString = NSLocalizedString(@"cache", "Inspector -> Peers tab -> table row tooltip");
     676        else if (from == TR_PEER_FROM_PEX)
     677            fromString = NSLocalizedString(@"PEX", "Inspector -> Peers tab -> table row tooltip");
     678        else
     679            fromString = NSLocalizedString(@"tracker", "Inspector -> Peers tab -> table row tooltip");
     680       
    669681        return [NSString stringWithFormat: NSLocalizedString(@"Progress: %.1f%%"
    670682                    "\nPort: %@"
    671                     "\nFrom %@ connection", "Inspector -> Peers tab -> table row tooltip"),
     683                    "\nFrom %@", "Inspector -> Peers tab -> table row tooltip"),
    672684                    [[peerDic objectForKey: @"Progress"] floatValue] * 100.0,
    673                     [peerDic objectForKey: @"Port"],
    674                     [[peerDic objectForKey: @"Incoming"] boolValue]
    675                         ? NSLocalizedString(@"incoming", "Inspector -> Peers tab -> table row tooltip")
    676                         : NSLocalizedString(@"outgoing", "Inspector -> Peers tab -> table row tooltip")];
     685                    [peerDic objectForKey: @"Port"], fromString];
    677686    }
    678687    return nil;
  • branches/pex/macosx/Torrent.h

    r1519 r1544  
    160160- (int) leechers;
    161161- (int) completedFromTracker;
     162
    162163- (int) totalPeers;
     164- (int) totalPeersTracker;
    163165- (int) totalPeersIncoming;
    164 - (int) totalPeersOutgoing;
     166- (int) totalPeersCache;
     167- (int) totalPeersPex;
     168
    165169- (int) peersUploading;
    166170- (int) peersDownloading;
  • branches/pex/macosx/Torrent.m

    r1538 r1544  
    933933        dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    934934            [NSNumber numberWithBool: peer->isConnected], @"Connected",
    935             [NSNumber numberWithBool: peer->isIncoming], @"Incoming",
     935            [NSNumber numberWithInt: peer->from], @"From",
    936936            [NSString stringWithCString: (char *) peer->addr encoding: NSUTF8StringEncoding], @"IP",
    937937            [NSString stringWithCString: (char *) peer->client encoding: NSUTF8StringEncoding], @"Client",
     
    994994}
    995995
     996- (int) totalPeersTracker
     997{
     998    return fStat->peersFrom[TR_PEER_FROM_TRACKER];
     999}
     1000
    9961001- (int) totalPeersIncoming
    9971002{
    998     return fStat->peersIncoming;
    999 }
    1000 
    1001 - (int) totalPeersOutgoing
    1002 {
    1003     return [self totalPeers] - [self totalPeersIncoming];
     1003    return fStat->peersFrom[TR_PEER_FROM_INCOMING];
     1004}
     1005
     1006- (int) totalPeersCache
     1007{
     1008    return fStat->peersFrom[TR_PEER_FROM_CACHE];
     1009}
     1010
     1011- (int) totalPeersPex
     1012{
     1013    return fStat->peersFrom[TR_PEER_FROM_PEX];
    10041014}
    10051015
Note: See TracChangeset for help on using the changeset viewer.