clean peer status tooltip

This commit is contained in:
Mitchell Livingston 2007-12-05 17:32:39 +00:00
parent 6776413a19
commit b7ae0657ca
1 changed files with 13 additions and 14 deletions

View File

@ -867,29 +867,28 @@ typedef enum
[components addObject: NSLocalizedString(@"Handshaking", "Inspector -> peer -> status")];
else
{
NSString * firstString;
NSMutableArray * peerStatusArray = [NSMutableArray arrayWithCapacity: 2];
if (status & TR_PEER_STATUS_CLIENT_IS_SENDING)
firstString = NSLocalizedString(@"Uploading to peer", "Inspector -> peer -> status");
[peerStatusArray addObject: NSLocalizedString(@"Uploading to peer", "Inspector -> peer -> status")];
else if (status & TR_PEER_STATUS_PEER_IS_INTERESTED)
firstString = NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status");
[peerStatusArray addObject: NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status")];
else if (status & TR_PEER_STATUS_PEER_IS_CHOKED)
firstString = NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status");
else
firstString = @"";
[peerStatusArray addObject: NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status")];
else;
NSString * secondString;
if (status & TR_PEER_STATUS_PEER_IS_SENDING)
secondString = NSLocalizedString(@"Downloading from peer", "Inspector -> peer -> status");
[peerStatusArray addObject: NSLocalizedString(@"Downloading from peer", "Inspector -> peer -> status")];
else if (status & TR_PEER_STATUS_CLIENT_SENT_REQUEST)
secondString = NSLocalizedString(@"Requesting data from peer", "Inspector -> peer -> status");
[peerStatusArray addObject: NSLocalizedString(@"Requesting data from peer", "Inspector -> peer -> status")];
else if (status & TR_PEER_STATUS_CLIENT_IS_INTERESTED)
secondString = NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status");
[peerStatusArray addObject: NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status")];
else if (status & TR_PEER_STATUS_CLIENT_IS_CHOKED)
secondString = NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status");
else
secondString = @"";
[peerStatusArray addObject: NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status")];
else;
[components addObject: [NSString stringWithFormat: @"%@ - %@", firstString, secondString]];
if ([peerStatusArray count] > 0)
[components addObject: [peerStatusArray componentsJoinedByString: @" - "]];
}
return [components componentsJoinedByString: @"\n"];