mirror of
https://github.com/transmission/transmission
synced 2025-03-16 00:39:34 +00:00
add table of trackers to the tracker inspector tab
This commit is contained in:
parent
8cc587a66f
commit
7e929d9d70
7 changed files with 3510 additions and 3313 deletions
1
NEWS
1
NEWS
|
@ -7,6 +7,7 @@ NEWS file for Transmission <http://www.transmissionbt.com/>
|
|||
+ Window when adding torrents to select files and other settings
|
||||
+ Leopard: Collapsable group dividers
|
||||
+ Use the file icon as the per-torrent action button
|
||||
+ Tracker tab in the inspector
|
||||
+ Updated images in the inspector
|
||||
+ Optional display of remaining time while seeding in Minimal View
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,6 +49,7 @@
|
|||
IBOutlet NSTextView * fCommentView;
|
||||
IBOutlet NSButton * fRevealDataButton, * fRevealTorrentButton;
|
||||
|
||||
IBOutlet NSTableView * fTrackerTable;
|
||||
IBOutlet NSTextField * fAnnounceAddressField, * fAnnounceLastField, * fAnnounceResponseField, * fAnnounceNextField,
|
||||
* fScrapeAddressField, * fScrapeLastField, * fScrapeResponseField, * fScrapeNextField;
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ typedef enum
|
|||
- (void) dealloc
|
||||
{
|
||||
//save resizeable view height
|
||||
if (fCurrentTabTag == TAB_PEERS_TAG || fCurrentTabTag == TAB_FILES_TAG)
|
||||
if (fCurrentTabTag == TAB_TRACKER_TAG || fCurrentTabTag == TAB_PEERS_TAG || fCurrentTabTag == TAB_FILES_TAG)
|
||||
[[NSUserDefaults standardUserDefaults] setFloat: [[self tabViewForTag: fCurrentTabTag] frame].size.height
|
||||
forKey: @"InspectorContentHeight"];
|
||||
|
||||
|
@ -251,7 +251,6 @@ typedef enum
|
|||
[fNameField setToolTip: nil];
|
||||
|
||||
[fTrackerField setStringValue: @""];
|
||||
[fTrackerField setToolTip: nil];
|
||||
[fPiecesField setStringValue: @""];
|
||||
[fHashField setStringValue: @""];
|
||||
[fHashField setToolTip: nil];
|
||||
|
@ -357,13 +356,6 @@ typedef enum
|
|||
[fBasicInfoField setToolTip: [NSString stringWithFormat: NSLocalizedString(@"%u bytes",
|
||||
"Inspector -> above tabs -> selected torrents"), [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];
|
||||
[fPiecesField setStringValue: [NSString stringWithFormat: @"%d, %@", [torrent pieceCount],
|
||||
[NSString stringForFileSize: [torrent pieceSize]]]];
|
||||
|
@ -417,6 +409,7 @@ typedef enum
|
|||
[self updateInfoStats];
|
||||
[self updateOptions];
|
||||
|
||||
[fTrackerTable reloadData];
|
||||
[fPeerTable reloadData];
|
||||
}
|
||||
|
||||
|
@ -580,12 +573,13 @@ typedef enum
|
|||
{
|
||||
[self updateInfoStats];
|
||||
|
||||
BOOL oldCanResizeVertical = fCurrentTabTag == TAB_PEERS_TAG || fCurrentTabTag == TAB_FILES_TAG, canResizeVertical;
|
||||
BOOL oldCanResizeVertical = fCurrentTabTag == TAB_TRACKER_TAG || fCurrentTabTag == TAB_PEERS_TAG || fCurrentTabTag == TAB_FILES_TAG,
|
||||
canResizeVertical;
|
||||
int oldTabTag = fCurrentTabTag;
|
||||
fCurrentTabTag = [fTabMatrix selectedTag];
|
||||
|
||||
NSView * view;
|
||||
NSString * identifier, * title;;
|
||||
NSString * identifier, * title;
|
||||
switch (fCurrentTabTag)
|
||||
{
|
||||
case TAB_INFO_TAG:
|
||||
|
@ -606,7 +600,7 @@ typedef enum
|
|||
view = fTrackerView;
|
||||
identifier = TAB_TRACKER_IDENT;
|
||||
title = NSLocalizedString(@"Tracker", "Inspector -> title");
|
||||
canResizeVertical = NO;
|
||||
canResizeVertical = YES;
|
||||
break;
|
||||
case TAB_PEERS_TAG:
|
||||
view = fPeersView;
|
||||
|
@ -719,6 +713,12 @@ typedef enum
|
|||
{
|
||||
if (tableView == fPeerTable)
|
||||
return fPeers ? [fPeers count] : 0;
|
||||
else if (tableView == fTrackerTable)
|
||||
{
|
||||
if ([fTorrents count] != 1)
|
||||
return 0;
|
||||
return [[[fTorrents objectAtIndex: 0] allTrackers] count];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -748,6 +748,14 @@ typedef enum
|
|||
else
|
||||
return [peer objectForKey: @"IP"];
|
||||
}
|
||||
else if (tableView == fTrackerTable)
|
||||
{
|
||||
id item = [[[fTorrents objectAtIndex: 0] allTrackers] objectAtIndex: row];
|
||||
if ([item isKindOfClass: [NSNumber class]])
|
||||
return [NSString stringWithFormat: @"Tier %d", [item intValue]+1];
|
||||
else
|
||||
return item;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -767,7 +775,14 @@ typedef enum
|
|||
|
||||
- (BOOL) tableView: (NSTableView *) tableView shouldSelectRow: (int) row
|
||||
{
|
||||
return tableView != fPeerTable;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) tableView: (NSTableView *) tableView isGroupRow: (NSInteger) row
|
||||
{
|
||||
if (tableView == fTrackerTable)
|
||||
return [[[[fTorrents objectAtIndex: 0] allTrackers] objectAtIndex: row] isKindOfClass: [NSNumber class]];
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
|
||||
|
|
|
@ -58,6 +58,8 @@ typedef enum
|
|||
|
||||
NSString * fNameString, * fHashString;
|
||||
|
||||
NSArray * fAllTrackers;
|
||||
|
||||
tr_file_stat * fileStat;
|
||||
NSArray * fFileList;
|
||||
|
||||
|
|
|
@ -189,6 +189,8 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
|
||||
[fIcon release];
|
||||
|
||||
[fAllTrackers release];
|
||||
|
||||
[fFileList release];
|
||||
[fFileMenu release];
|
||||
|
||||
|
@ -736,20 +738,23 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
|
||||
- (NSArray *) allTrackers
|
||||
{
|
||||
NSMutableArray * trackers = [NSMutableArray arrayWithCapacity: fInfo->trackerTiers], * subTrackers;
|
||||
|
||||
int i, j;
|
||||
for (i = 0; i < fInfo->trackerTiers; i++)
|
||||
if (!fAllTrackers)
|
||||
{
|
||||
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]];
|
||||
NSMutableArray * allTrackers = [NSMutableArray array];
|
||||
|
||||
[trackers addObject: subTrackers];
|
||||
int i, j;
|
||||
for (i = 0; i < fInfo->trackerTiers; i++)
|
||||
{
|
||||
[allTrackers addObject: [NSNumber numberWithInt: i]];
|
||||
for (j = 0; j < fInfo->trackerList[i].count; j++)
|
||||
[allTrackers addObject: [NSString stringWithFormat: @"http://%s:%d",
|
||||
fInfo->trackerList[i].list[j].address, fInfo->trackerList[i].list[j].port]];
|
||||
}
|
||||
|
||||
fAllTrackers = [[NSArray alloc] initWithArray: allTrackers];
|
||||
}
|
||||
|
||||
return trackers;
|
||||
return fAllTrackers;
|
||||
}
|
||||
|
||||
- (NSString *) comment
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#define ACTION_MENU_LIMIT_TAG 103
|
||||
|
||||
#define PIECE_CHANGE 0.1
|
||||
#define PIECE_TIME 0.01
|
||||
#define PIECE_TIME 0.005
|
||||
|
||||
@interface TorrentTableView (Private)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue