Changeset 1006


Ignore:
Timestamp:
Oct 13, 2006, 6:58:12 PM (15 years ago)
Author:
livings124
Message:

in info show the number of incoming connections next to total connections

Location:
trunk
Files:
7 edited

Legend:

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

    r1003 r1006  
    287287                4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; };
    288288                4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; };
    289                 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
     289                4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
    290290                4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; };
    291291                4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; };
  • trunk/libtransmission/transmission.c

    r996 r1006  
    495495
    496496    s->peersTotal       = 0;
     497    s->peersIncoming    = 0;
    497498    s->peersUploading   = 0;
    498499    s->peersDownloading = 0;
     
    505506        {
    506507            (s->peersTotal)++;
     508           
     509            if( tr_peerIsIncoming( peer ) )
     510            {
     511                (s->peersIncoming)++;
     512            }
     513           
     514            if( tr_peerIsUploading( peer ) )
     515            {
     516                (s->peersUploading)++;
     517            }
     518           
    507519            if( tr_peerIsUploading( peer ) )
    508520            {
  • trunk/libtransmission/transmission.h

    r996 r1006  
    359359    int                 eta;
    360360    int                 peersTotal;
     361    int                 peersIncoming;
    361362    int                 peersUploading;
    362363    int                 peersDownloading;
  • trunk/macosx/InfoWindowController.m

    r988 r1006  
    273273        BOOL active = [torrent isActive];
    274274       
    275         [fConnectedPeersField setStringValue: active ? [NSString stringWithInt: [torrent totalPeers]] : @""];
     275        [fConnectedPeersField setStringValue: active ? [NSString stringWithFormat: @"%d (%d incoming)",
     276                                                        [torrent totalPeers], [torrent totalPeersIncoming]]: @""];
    276277        [fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersUploading]] : @""];
    277278        [fUploadingToField setStringValue: active ? [NSString stringWithInt: [torrent peersDownloading]] : @""];
  • trunk/macosx/Torrent.h

    r998 r1006  
    135135- (int) leechers;
    136136- (int) totalPeers;
     137- (int) totalPeersIncoming;
     138- (int) totalPeersOutgoing;
    137139- (int) peersUploading;
    138140- (int) peersDownloading;
  • trunk/macosx/Torrent.m

    r998 r1006  
    682682{
    683683    return fStat->peersTotal;
     684}
     685
     686- (int) totalPeersIncoming
     687{
     688    return fStat->peersIncoming;
     689}
     690
     691- (int) totalPeersOutgoing
     692{
     693    return [self totalPeers] - [self totalPeersIncoming];
    684694}
    685695
Note: See TracChangeset for help on using the changeset viewer.