mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
redo the peer tooltip status strings
This commit is contained in:
parent
1d2d4eefde
commit
ae5fdbb958
2 changed files with 30 additions and 16 deletions
|
@ -758,19 +758,36 @@ typedef enum
|
|||
break;
|
||||
}
|
||||
|
||||
#warning redo
|
||||
NSMutableArray * peerStatusArray = [NSMutableArray arrayWithCapacity: 2];
|
||||
if ([[peer objectForKey: @"PeerChoked"] boolValue])
|
||||
[peerStatusArray addObject: NSLocalizedString(@"Refusing to send data to peer", "Inspector -> peer -> status")];
|
||||
if ([[peer objectForKey: @"PeerInterested"] boolValue])
|
||||
[peerStatusArray addObject: NSLocalizedString(@"Peer wants our data", "Inspector -> peer -> status")];
|
||||
if ([[peer objectForKey: @"ClientChoked"] boolValue])
|
||||
[peerStatusArray addObject: NSLocalizedString(@"Peer will not send us data", "Inspector -> peer -> status")];
|
||||
if ([[peer objectForKey: @"ClientInterested"] boolValue])
|
||||
[peerStatusArray addObject: NSLocalizedString(@"Waiting to request data from peer", "Inspector -> peer -> status")];
|
||||
//determing status strings from flags
|
||||
NSMutableArray * statusArray = [NSMutableArray arrayWithCapacity: 3];
|
||||
NSString * flags = [peer objectForKey: @"Flags"];
|
||||
|
||||
if ([peerStatusArray count] > 0)
|
||||
[components addObject: [@"\n" stringByAppendingString: [peerStatusArray componentsJoinedByString: @"\n"]]];
|
||||
if ([flags rangeOfString: @"D"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"Currently downloading (interested and not choked)",
|
||||
"Inspector -> peer -> status")];
|
||||
else if ([flags rangeOfString: @"d"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"You want to download, but peer does not want to send (interested and choked)",
|
||||
"Inspector -> peer -> status")];
|
||||
else;
|
||||
|
||||
if ([flags rangeOfString: @"U"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"Currently uploading (interested and not choked)",
|
||||
"Inspector -> peer -> status")];
|
||||
else if ([flags rangeOfString: @"u"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"Peer wants you to upload, but you do not want to (interested and choked)",
|
||||
"Inspector -> peer -> status")];
|
||||
else;
|
||||
|
||||
if ([flags rangeOfString: @"K"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"Peer is unchoking you, but you are not interested",
|
||||
"Inspector -> peer -> status")];
|
||||
|
||||
if ([flags rangeOfString: @"?"].location != NSNotFound)
|
||||
[statusArray addObject: NSLocalizedString(@"You unchoked the peer, but the peer is not interested",
|
||||
"Inspector -> peer -> status")];
|
||||
|
||||
if ([statusArray count] > 0)
|
||||
[components addObject: [@"\n" stringByAppendingString: [statusArray componentsJoinedByString: @"\n\n"]]];
|
||||
|
||||
return [components componentsJoinedByString: @"\n"];
|
||||
}
|
||||
|
|
|
@ -879,10 +879,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
[NSNumber numberWithFloat: peer->progress], @"Progress",
|
||||
[NSNumber numberWithBool: peer->isEncrypted], @"Encryption",
|
||||
[NSString stringWithCString: (char *)peer->client encoding: NSUTF8StringEncoding], @"Client",
|
||||
[NSNumber numberWithBool: peer->peerIsChoked], @"PeerChoked",
|
||||
[NSNumber numberWithBool: peer->peerIsInterested], @"PeerInterested",
|
||||
[NSNumber numberWithBool: peer->clientIsChoked], @"ClientChoked",
|
||||
[NSNumber numberWithBool: peer->clientIsInterested], @"ClientInterested", nil];
|
||||
[NSString stringWithCString: (char *)peer->flagStr encoding: NSUTF8StringEncoding], @"Flags", nil];
|
||||
|
||||
if (peer->isUploadingTo)
|
||||
[dic setObject: [NSNumber numberWithFloat: peer->uploadToRate] forKey: @"UL To Rate"];
|
||||
|
|
Loading…
Reference in a new issue