Changeset 780


Ignore:
Timestamp:
Aug 15, 2006, 12:59:44 AM (15 years ago)
Author:
livings124
Message:

Check for connected peers, as well as better peer table resizing behavior.

Location:
trunk
Files:
7 edited

Legend:

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

    r771 r780  
    256256                4DCCBB3C09C3D71100D3CABF /* TorrentCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = TorrentCell.m; path = macosx/TorrentCell.m; sourceTree = "<group>"; };
    257257                4DCCBB3D09C3D71100D3CABF /* TorrentCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = TorrentCell.h; path = macosx/TorrentCell.h; sourceTree = "<group>"; };
    258                 4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
     258                4DDBB71909E16BAE00284745 /* transmissioncli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = transmissioncli; sourceTree = BUILT_PRODUCTS_DIR; };
    259259                4DDBB71B09E16BF100284745 /* transmissioncli.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = transmissioncli.c; path = cli/transmissioncli.c; sourceTree = "<group>"; };
    260260                4DDFDD20099A5D8E00189D81 /* DownloadBadge.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DownloadBadge.png; path = macosx/Images/DownloadBadge.png; sourceTree = "<group>"; };
  • trunk/libtransmission/transmission.c

    r774 r780  
    507507                           sizeof( peers[i].addr ) );
    508508            }
     509           
    509510            peers[i].client = tr_clientForId(tr_peerId(peer));
     511           
     512            peers[i].isConnected = tr_peerIsConnected(peer);
    510513            peers[i].isDownloading = tr_peerIsDownloading(peer);
    511514            peers[i].isUploading = tr_peerIsUploading(peer);
  • trunk/libtransmission/transmission.h

    r774 r780  
    329329    char *  client;
    330330   
     331    int     isConnected;
    331332    int     isDownloading;
    332333    int     isUploading;
  • trunk/macosx/InfoWindowController.h

    r776 r780  
    3131    NSArray * fTorrents;
    3232    NSMutableArray * fPeers, * fFiles;
    33     NSImage * fAppIcon;
     33    NSImage * fAppIcon, * fCheckImage;
    3434   
    3535    IBOutlet NSTabView * fTabView;
  • trunk/macosx/InfoWindowController.m

    r776 r780  
    5757{
    5858    fAppIcon = [[NSApp applicationIconImage] copy];
     59    fCheckImage = [NSImage imageNamed: @"NSMenuCheckmark"];
    5960   
    6061    fTorrents = [[NSArray alloc] init];
     
    434435{
    435436    if (tableView == fPeerTable)
    436         return [fTorrents count] == 1 ? [[fTorrents objectAtIndex: 0] totalPeers] : 0;
     437        return [fPeers count];
    437438    else if (tableView == fFileTable)
    438439        return [fFiles count];
     
    448449        NSDictionary * peer = [fPeers objectAtIndex: row];
    449450       
    450         if ([ident isEqualToString: @"UL To"])
     451        if ([ident isEqualToString: @"Connected"])
     452            return [[peer objectForKey: @"Connected"] boolValue] ? fCheckImage : nil;
     453        else if ([ident isEqualToString: @"UL To"])
    451454            return [[peer objectForKey: @"UL To"] boolValue] ? @"Y" : @"";
    452455        else if ([ident isEqualToString: @"DL From"])
  • trunk/macosx/Torrent.m

    r775 r780  
    529529       
    530530        [peerDics addObject: [NSDictionary dictionaryWithObjectsAndKeys:
     531            [NSNumber numberWithBool: peer.isConnected], @"Connected",
    531532            [NSString stringWithCString: (char *) peer.addr encoding: NSUTF8StringEncoding], @"IP",
    532533            [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding], @"Client",
Note: See TracChangeset for help on using the changeset viewer.