Changeset 3862


Ignore:
Timestamp:
Nov 18, 2007, 12:09:37 AM (15 years ago)
Author:
livings124
Message:

add status field to peers table

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/English.lproj/InfoWindow.nib/info.nib

    r3850 r3862  
    1111        <key>IBOpenObjects</key>
    1212        <array>
    13                 <integer>935</integer>
     13                <integer>1030</integer>
    1414        </array>
    1515        <key>IBSystem Version</key>
  • trunk/macosx/InfoWindowController.m

    r3855 r3862  
    800800            return (rate = [peer objectForKey: @"DL From Rate"]) ? [NSString stringForSpeedAbbrev: [rate floatValue]] : @"";
    801801        }
     802        else if ([ident isEqualToString: @"Status"])
     803            return [peer objectForKey: @"Status"];
    802804        else
    803805            return [peer objectForKey: @"IP"];
  • trunk/macosx/Torrent.m

    r3816 r3862  
    809809        peer = &peers[i];
    810810       
     811        NSString * statusString;
     812        switch (peer->status)
     813        {
     814            case TR_PEER_STATUS_HANDSHAKE:
     815                statusString = NSLocalizedString(@"Handshaking", "peer -> status");
     816                break;
     817            case TR_PEER_STATUS_PEER_IS_CHOKED:
     818                statusString = NSLocalizedString(@"Peer is Choked", "peer -> status");
     819                break;
     820            case TR_PEER_STATUS_CLIENT_IS_CHOKED:
     821                statusString = NSLocalizedString(@"Choked", "peer -> status");
     822                break;
     823            case TR_PEER_STATUS_CLIENT_IS_INTERESTED:
     824                statusString = NSLocalizedString(@"Choked and Interested", "peer -> status");
     825                break;
     826            case TR_PEER_STATUS_READY:
     827                statusString = NSLocalizedString(@"Ready", "peer -> status");
     828                break;
     829            case TR_PEER_STATUS_REQUEST_SENT:
     830                statusString = NSLocalizedString(@"Request Sent", "peer -> status");
     831                break;
     832            case TR_PEER_STATUS_ACTIVE:
     833                statusString = NSLocalizedString(@"Active", "peer -> status");
     834                break;
     835            default:
     836                statusString = @"";
     837        }
     838       
    811839        dic = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    812840            [NSNumber numberWithInt: peer->from], @"From",
     
    815843            [NSNumber numberWithFloat: peer->progress], @"Progress",
    816844            [NSNumber numberWithBool: peer->isEncrypted], @"Encryption",
    817             [NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client", nil];
     845            [NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client",
     846            statusString, @"Status", nil];
    818847       
    819848        if (peer->isDownloading)
Note: See TracChangeset for help on using the changeset viewer.