Show swarm speed in inspector.

This commit is contained in:
Mitchell Livingston 2006-08-17 03:12:40 +00:00
parent 86d9310274
commit da555b7c6f
6 changed files with 12 additions and 2 deletions

View File

@ -39,6 +39,7 @@
fSeedersField = NSTextField;
fSizeField = NSTextField;
fStateField = NSTextField;
fSwarmSpeedField = NSTextField;
fTabView = NSTabView;
fTorrentLocationField = NSTextField;
fTrackerField = NSTextField;

View File

@ -44,7 +44,7 @@
* fStateField,
* fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField,
* fRatioField, * fSeedersField, * fLeechersField,
* fConnectedPeersField, * fDownloadingFromField, * fUploadingToField;
* fConnectedPeersField, * fDownloadingFromField, * fUploadingToField, * fSwarmSpeedField;
IBOutlet NSTableView * fPeerTable;
IBOutlet NSTextField * fPeerTableStatusField;

View File

@ -40,7 +40,7 @@
//15 spacing at the bottom of each tab
#define TAB_INFO_HEIGHT 182.0
#define TAB_ACTIVITY_HEIGHT 214.0
#define TAB_ACTIVITY_HEIGHT 230.0
#define TAB_PEERS_HEIGHT 255.0
#define TAB_FILES_HEIGHT 255.0
#define TAB_OPTIONS_HEIGHT 116.0
@ -166,6 +166,7 @@
[fConnectedPeersField setStringValue: @""];
[fDownloadingFromField setStringValue: @""];
[fUploadingToField setStringValue: @""];
[fSwarmSpeedField setStringValue: @""];
[fPeers removeAllObjects];
[fPeerTable reloadData];
@ -267,6 +268,8 @@
[fRatioField setStringValue: [NSString stringForRatioWithDownload: downloadedTotal upload: uploadedTotal]];
[fSwarmSpeedField setStringValue: [torrent isActive] ? [NSString stringForSpeed: [torrent swarmSpeed]] : @""];
//set peers table
[fPeers setArray: [torrent peers]];
[fPeers sortUsingDescriptors: [self peerSortDescriptors]];

View File

@ -132,6 +132,7 @@
- (float) downloadedValid;
- (uint64_t) downloadedTotal;
- (uint64_t) uploadedTotal;
- (float) swarmSpeed;
- (NSNumber *) orderValue;
- (void) setOrderValue: (int) orderValue;

View File

@ -612,6 +612,11 @@
return fStat->uploaded;
}
- (float) swarmSpeed
{
return fStat->swarmspeed;
}
- (NSNumber *) orderValue
{
return [NSNumber numberWithInt: fOrderValue];