when downloading the blocklist, show amounts instead of percent

This commit is contained in:
Mitchell Livingston 2008-04-06 03:35:18 +00:00
parent ea14cc231e
commit 8b627d3792
3 changed files with 5 additions and 4 deletions

View File

@ -162,9 +162,10 @@
NSString * string = NSLocalizedString(@"Downloading blocklist", "Blocklist -> message");
if (fExpectedSize != NSURLResponseUnknownLength)
{
double progress = (double)fCurrentSize / fExpectedSize;
string = [string stringByAppendingString: [NSString localizedStringWithFormat: @" (%.1f%%)", 100.0 * progress]];
[fProgressBar setDoubleValue: progress];
NSString * substring = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", "Blocklist -> message"),
[NSString stringForFileSize: fCurrentSize], [NSString stringForFileSize: fExpectedSize]];
string = [string stringByAppendingFormat: @" (%@)", substring];
[fProgressBar setDoubleValue: (double)fCurrentSize / fExpectedSize];
}
[fTextField setStringValue: string];

View File

@ -927,7 +927,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
NSString * error;
if (!(error = [NSString stringWithUTF8String: fStat->errorString])
&& !(error = [NSString stringWithCString: fStat->errorString encoding: NSISOLatin1StringEncoding]))
error = NSLocalizedString(@"(unreadable error)", "Torrent -> error string unreadable");
error = [NSString stringWithFormat: @"(%@)", NSLocalizedString(@"unreadable error", "Torrent -> error string unreadable")];
return error;
}