use the new status values in the inspector tooltips
This commit is contained in:
parent
f0f958d755
commit
b4d3c64e8e
|
@ -759,34 +759,18 @@ typedef enum
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*int status = [[peer objectForKey: @"Status"] intValue];
|
NSMutableArray * peerStatusArray = [NSMutableArray arrayWithCapacity: 2];
|
||||||
if (status & TR_PEER_STATUS_HANDSHAKE)
|
if ([[peer objectForKey: @"PeerChoked"] boolValue])
|
||||||
[components addObject: NSLocalizedString(@"Handshaking", "Inspector -> peer -> status")];
|
[peerStatusArray addObject: NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status")];
|
||||||
else
|
if ([[peer objectForKey: @"PeerInterested"] boolValue])
|
||||||
{
|
[peerStatusArray addObject: NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status")];
|
||||||
NSMutableArray * peerStatusArray = [NSMutableArray arrayWithCapacity: 2];
|
if ([[peer objectForKey: @"ClientChoked"] boolValue])
|
||||||
|
[peerStatusArray addObject: NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status")];
|
||||||
if (status & TR_PEER_STATUS_CLIENT_IS_SENDING)
|
if ([[peer objectForKey: @"ClientInterested"] boolValue])
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Uploading to peer", "Inspector -> peer -> status")];
|
[peerStatusArray addObject: NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status")];
|
||||||
else if (status & TR_PEER_STATUS_PEER_IS_INTERESTED)
|
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status")];
|
if ([peerStatusArray count] > 0)
|
||||||
else if (status & TR_PEER_STATUS_PEER_IS_CHOKED)
|
[components addObject: [@"\n" stringByAppendingString: [peerStatusArray componentsJoinedByString: @"\n"]]];
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status")];
|
|
||||||
else;
|
|
||||||
|
|
||||||
if (status & TR_PEER_STATUS_PEER_IS_SENDING)
|
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Downloading from peer", "Inspector -> peer -> status")];
|
|
||||||
else if (status & TR_PEER_STATUS_CLIENT_SENT_REQUEST)
|
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Requesting data from peer", "Inspector -> peer -> status")];
|
|
||||||
else if (status & TR_PEER_STATUS_CLIENT_IS_INTERESTED)
|
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status")];
|
|
||||||
else if (status & TR_PEER_STATUS_CLIENT_IS_CHOKED)
|
|
||||||
[peerStatusArray addObject: NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status")];
|
|
||||||
else;
|
|
||||||
|
|
||||||
if ([peerStatusArray count] > 0)
|
|
||||||
[components addObject: [peerStatusArray componentsJoinedByString: @" - "]];
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return [components componentsJoinedByString: @"\n"];
|
return [components componentsJoinedByString: @"\n"];
|
||||||
}
|
}
|
||||||
|
|
|
@ -874,7 +874,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||||
[NSNumber numberWithFloat: peer->progress], @"Progress",
|
[NSNumber numberWithFloat: peer->progress], @"Progress",
|
||||||
[NSNumber numberWithBool: peer->isEncrypted], @"Encryption",
|
[NSNumber numberWithBool: peer->isEncrypted], @"Encryption",
|
||||||
[NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client",
|
[NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client",
|
||||||
/*[NSNumber numberWithInt: peer->status], @"Status",*/ nil];
|
[NSNumber numberWithBool: peer->peerIsChoked], @"PeerChoked",
|
||||||
|
[NSNumber numberWithBool: peer->peerIsInterested], @"PeerInterested",
|
||||||
|
[NSNumber numberWithBool: peer->clientIsChoked], @"ClientChoked",
|
||||||
|
[NSNumber numberWithBool: peer->clientIsInterested], @"ClientInterested", nil];
|
||||||
|
|
||||||
if (peer->isDownloading)
|
if (peer->isDownloading)
|
||||||
[dic setObject: [NSNumber numberWithFloat: peer->uploadToRate] forKey: @"UL To Rate"];
|
[dic setObject: [NSNumber numberWithFloat: peer->uploadToRate] forKey: @"UL To Rate"];
|
||||||
|
|
Loading…
Reference in New Issue