|
|
|
@ -357,12 +357,12 @@
|
|
|
|
|
|
|
|
|
|
NSArray *listItems = [stringData componentsSeparatedByString:@" "];
|
|
|
|
|
|
|
|
|
|
unsigned long long ifIn = strtoull([[listItems objectAtIndex:0] UTF8String], NULL, 0);
|
|
|
|
|
unsigned long long ifOut = strtoull([[listItems objectAtIndex:8] UTF8String], NULL, 0);
|
|
|
|
|
uint64_t ifIn = strtoull([[listItems objectAtIndex:0] UTF8String], NULL, 0);
|
|
|
|
|
uint64_t ifOut = strtoull([[listItems objectAtIndex:8] UTF8String], NULL, 0);
|
|
|
|
|
|
|
|
|
|
if (_lastInThroughput != 0) {
|
|
|
|
|
unsigned long long diffIn = ifIn - _lastInThroughput;
|
|
|
|
|
unsigned long long diffOut = ifOut - _lastOutThroughput;
|
|
|
|
|
uint64_t diffIn = ifIn - _lastInThroughput;
|
|
|
|
|
uint64_t diffOut = ifOut - _lastOutThroughput;
|
|
|
|
|
|
|
|
|
|
double timeDiff = fabs([_lastDateThroughput timeIntervalSinceNow]);
|
|
|
|
|
_lastDateThroughput = [[NSDate date] retain];
|
|
|
|
@ -432,8 +432,8 @@
|
|
|
|
|
memInfo = [filteredArray componentsJoinedByString:@""];
|
|
|
|
|
|
|
|
|
|
NSArray *memData = [memInfo componentsSeparatedByString:@","];
|
|
|
|
|
unsigned long memTotal = strtoull([[memData objectAtIndex:17] UTF8String], NULL, 0);
|
|
|
|
|
unsigned long memFree = strtoull([[memData objectAtIndex:21] UTF8String], NULL, 0);
|
|
|
|
|
unint32_t memTotal = strtoull([[memData objectAtIndex:17] UTF8String], NULL, 0);
|
|
|
|
|
unint32_t memFree = strtoull([[memData objectAtIndex:21] UTF8String], NULL, 0);
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -571,12 +571,12 @@
|
|
|
|
|
NSMenuItem *clientMenuItem;
|
|
|
|
|
NSMenuItem *clientItem;
|
|
|
|
|
|
|
|
|
|
unsigned long clientsCount = [clientsData count] / 4;
|
|
|
|
|
uint32_t clientsCount = [clientsData count] / 4;
|
|
|
|
|
[menuClientsCount setTitle:[NSString stringWithFormat:@"%lu Active Client%@", clientsCount, (clientsCount > 1 ? @"s" : @"")]];
|
|
|
|
|
|
|
|
|
|
// Clear the old client data
|
|
|
|
|
unsigned long clientIndex;
|
|
|
|
|
unsigned long firstItem = [menuClients indexOfItem:menuClientsSeparator];
|
|
|
|
|
uint32_t clientIndex;
|
|
|
|
|
uint32_t firstItem = [menuClients indexOfItem:menuClientsSeparator];
|
|
|
|
|
if ([menuClients numberOfItems] > firstItem) {
|
|
|
|
|
for (clientIndex = ([menuClients numberOfItems] - 1); clientIndex > (firstItem + 1); clientIndex--) {
|
|
|
|
|
[menuClients removeItemAtIndex:clientIndex];
|
|
|
|
@ -626,11 +626,11 @@
|
|
|
|
|
[clientMenu addItem:clientMenuItem];
|
|
|
|
|
|
|
|
|
|
// Connections
|
|
|
|
|
unsigned long conn = strtoull([[clientsData objectAtIndex:(clientIndex+3)] UTF8String], NULL, 0);
|
|
|
|
|
clientMenuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%d Connection%@", conn, (conn > 1 ? @"s" : @"")] action:nil keyEquivalent:@""];
|
|
|
|
|
uint32_t conn = strtoull([[clientsData objectAtIndex:(clientIndex+3)] UTF8String], NULL, 0);
|
|
|
|
|
clientMenuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"%lu Connection%@", conn, (conn > 1 ? @"s" : @"")] action:nil keyEquivalent:@""];
|
|
|
|
|
[clientMenu addItem:clientMenuItem];
|
|
|
|
|
|
|
|
|
|
clientItem = [[NSMenuItem alloc] initWithTitle:[clientsData objectAtIndex:clientIndex] action:nil keyEquivalent:@""];
|
|
|
|
|
clientItem = [[NSMenuItem alloc] initWithTitle:[clientsData objectAtIndex:clientIndex] action:nil keyEquivalent:@""];
|
|
|
|
|
[clientItem setSubmenu:clientMenu];
|
|
|
|
|
|
|
|
|
|
[menuClients addItem:clientItem];
|
|
|
|
@ -649,7 +649,7 @@
|
|
|
|
|
[pasteBoard setString:[[sender parentItem] title] forType:NSStringPboardType];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *) stringFromSize:(unsigned long long)theBytes
|
|
|
|
|
- (NSString *) stringFromSize:(uint64_t)theBytes
|
|
|
|
|
{
|
|
|
|
|
double floatSize = theBytes;
|
|
|
|
|
|
|
|
|
@ -669,7 +669,7 @@
|
|
|
|
|
return([NSString stringWithFormat:@"%1.2fTiB", floatSize]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *) stringFromSpeed:(unsigned long long)theBytes
|
|
|
|
|
- (NSString *) stringFromSpeed:(uint64_t)theBytes
|
|
|
|
|
{
|
|
|
|
|
unsigned int minSize = /*(useBytes ? */1023/* : 999)*/;
|
|
|
|
|
unsigned int divSize = /*(useBytes ? */1024/* : 1000)*/;
|
|
|
|
|