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; fSeedersField = NSTextField;
fSizeField = NSTextField; fSizeField = NSTextField;
fStateField = NSTextField; fStateField = NSTextField;
fSwarmSpeedField = NSTextField;
fTabView = NSTabView; fTabView = NSTabView;
fTorrentLocationField = NSTextField; fTorrentLocationField = NSTextField;
fTrackerField = NSTextField; fTrackerField = NSTextField;

View File

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

View File

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

View File

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

View File

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