mirror of
https://github.com/transmission/transmission
synced 2025-03-12 23:23:54 +00:00
display all trackers in the announce list in the inspector's tooltip
This commit is contained in:
parent
e38311e64e
commit
d8e9c10a34
3 changed files with 26 additions and 1 deletions
|
@ -316,6 +316,13 @@ typedef enum
|
||||||
[fNameField setToolTip: name];
|
[fNameField setToolTip: name];
|
||||||
[fSizeField setStringValue: [NSString stringForFileSize: [torrent size]]];
|
[fSizeField setStringValue: [NSString stringForFileSize: [torrent size]]];
|
||||||
|
|
||||||
|
NSArray * allTrackers = [torrent allTrackers], * subTrackers;
|
||||||
|
NSMutableArray * trackerStrings = [NSMutableArray arrayWithCapacity: [allTrackers count]];
|
||||||
|
NSEnumerator * enumerator = [allTrackers objectEnumerator];
|
||||||
|
while ((subTrackers = [enumerator nextObject]))
|
||||||
|
[trackerStrings addObject: [subTrackers componentsJoinedByString: @", "]];
|
||||||
|
[fTrackerField setToolTip: [trackerStrings componentsJoinedByString: @"\n"]];
|
||||||
|
|
||||||
NSString * hashString = [torrent hashString];
|
NSString * hashString = [torrent hashString];
|
||||||
[fPiecesField setStringValue: [NSString stringWithFormat: @"%d, %@", [torrent pieceCount],
|
[fPiecesField setStringValue: [NSString stringWithFormat: @"%d, %@", [torrent pieceCount],
|
||||||
[NSString stringForFileSize: [torrent pieceSize]]]];
|
[NSString stringForFileSize: [torrent pieceSize]]]];
|
||||||
|
@ -1107,7 +1114,6 @@ typedef enum
|
||||||
|
|
||||||
NSString * tracker = [[torrent trackerAddress] stringByAppendingString: [torrent trackerAddressAnnounce]];
|
NSString * tracker = [[torrent trackerAddress] stringByAppendingString: [torrent trackerAddressAnnounce]];
|
||||||
[fTrackerField setStringValue: tracker];
|
[fTrackerField setStringValue: tracker];
|
||||||
[fTrackerField setToolTip: tracker];
|
|
||||||
|
|
||||||
NSString * location = [torrent dataLocation];
|
NSString * location = [torrent dataLocation];
|
||||||
[fDataLocationField setStringValue: [location stringByAbbreviatingWithTildeInPath]];
|
[fDataLocationField setStringValue: [location stringByAbbreviatingWithTildeInPath]];
|
||||||
|
|
|
@ -132,6 +132,7 @@ typedef enum
|
||||||
- (uint64_t) sizeLeft;
|
- (uint64_t) sizeLeft;
|
||||||
- (NSString *) trackerAddress;
|
- (NSString *) trackerAddress;
|
||||||
- (NSString *) trackerAddressAnnounce;
|
- (NSString *) trackerAddressAnnounce;
|
||||||
|
- (NSArray *) allTrackers;
|
||||||
|
|
||||||
- (NSString *) comment;
|
- (NSString *) comment;
|
||||||
- (NSString *) creator;
|
- (NSString *) creator;
|
||||||
|
|
|
@ -617,6 +617,24 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||||
return [NSString stringWithUTF8String: fStat->tracker->announce];
|
return [NSString stringWithUTF8String: fStat->tracker->announce];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *) allTrackers
|
||||||
|
{
|
||||||
|
NSMutableArray * trackers = [NSMutableArray arrayWithCapacity: fInfo->trackerTiers], * subTrackers;
|
||||||
|
|
||||||
|
int i, j;
|
||||||
|
for (i = 0; i < fInfo->trackerTiers; i++)
|
||||||
|
{
|
||||||
|
subTrackers = [NSMutableArray arrayWithCapacity: fInfo->trackerList[i].count];
|
||||||
|
for (j = 0; j < fInfo->trackerList[i].count; j++)
|
||||||
|
[subTrackers addObject: [NSString stringWithFormat: @"http://%s:%d",
|
||||||
|
fInfo->trackerList[i].list[j].address, fInfo->trackerList[i].list[j].port]];
|
||||||
|
|
||||||
|
[trackers addObject: subTrackers];
|
||||||
|
}
|
||||||
|
|
||||||
|
return trackers;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *) comment
|
- (NSString *) comment
|
||||||
{
|
{
|
||||||
return [NSString stringWithUTF8String: fInfo->comment];
|
return [NSString stringWithUTF8String: fInfo->comment];
|
||||||
|
|
Loading…
Add table
Reference in a new issue