display total ratio in the status bar

This commit is contained in:
Mitchell Livingston
2007-12-04 21:41:06 +00:00
parent 161db11c1e
commit 7c190b84f9
4 changed files with 25 additions and 10 deletions

View File

@@ -1400,14 +1400,25 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
else
[self sortTorrents];
//update the global DL/UL rates
//update status bar
if (![fStatusBar isHidden])
{
//set rates
float downloadRate, uploadRate;
tr_torrentRates(fLib, & downloadRate, & uploadRate);
[fTotalDLField setStringValue: [NSString stringForSpeed: downloadRate]];
[fTotalULField setStringValue: [NSString stringForSpeed: uploadRate]];
//set status button text
tr_session_stats stats;
tr_getCumulativeSessionStats(fLib, &stats);
NSString * statusString = [NSLocalizedString(@"Total Ratio: ", "status bar -> status button text")
stringByAppendingString: [NSString stringForRatio: stats.ratio]];
[fStatusButton setTitle: statusString];
[fStatusButton sizeToFit];
}
}