1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-28 10:38:45 +00:00

rearrange some status string code

This commit is contained in:
Mitchell Livingston 2007-09-30 13:33:50 +00:00
parent 6c962e15b1
commit aaaa932625

View file

@ -906,6 +906,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
else else
string = NSLocalizedString(@"Paused", "Torrent -> status string"); string = NSLocalizedString(@"Paused", "Torrent -> status string");
break; break;
case TR_STATUS_STOPPING:
string = [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
break;
case TR_STATUS_CHECK_WAIT: case TR_STATUS_CHECK_WAIT:
string = [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis]; string = [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis];
@ -934,10 +938,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
[self peersGettingFromUs]]; [self peersGettingFromUs]];
break; break;
case TR_STATUS_STOPPING:
string = [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
break;
default: default:
string = @""; string = @"";
@ -946,6 +946,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if (fStalled) if (fStalled)
string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string]; string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string];
//append even if error
if ([self isActive] && ![self isChecking]) if ([self isActive] && ![self isChecking])
{ {
if (fStat->status == TR_STATUS_DOWNLOAD) if (fStat->status == TR_STATUS_DOWNLOAD)
@ -977,6 +978,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
else else
string = NSLocalizedString(@"Paused", "Torrent -> status string"); string = NSLocalizedString(@"Paused", "Torrent -> status string");
break; break;
case TR_STATUS_STOPPING:
string = [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
break;
case TR_STATUS_CHECK_WAIT: case TR_STATUS_CHECK_WAIT:
string = [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis]; string = [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis];
@ -986,26 +991,20 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
string = [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)", string = [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",
"Torrent -> status string"), 100.0 * fStat->recheckProgress]; "Torrent -> status string"), 100.0 * fStat->recheckProgress];
break; break;
case TR_STATUS_STOPPING: case TR_STATUS_DOWNLOAD:
string = [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis]; string = [NSString stringWithFormat: NSLocalizedString(@"DL: %@, UL: %@", "Torrent -> status string"),
[NSString stringForSpeed: [self downloadRate]], [NSString stringForSpeed: [self uploadRate]]];
break;
case TR_STATUS_SEED:
case TR_STATUS_DONE:
string = [NSString stringWithFormat: NSLocalizedString(@"Ratio: %@, UL: %@", "Torrent -> status string"),
[NSString stringForRatio: [self ratio]], [NSString stringForSpeed: [self uploadRate]]];
break; break;
default: default:
if ([self isActive]) string = @"";
{
if (![self allDownloaded])
string = [NSString stringWithFormat: NSLocalizedString(@"DL: %@, ", "Torrent -> status string"),
[NSString stringForSpeed: [self downloadRate]]];
else
string = [NSString stringWithFormat: NSLocalizedString(@"Ratio: %@, ", "Torrent -> status string"),
[NSString stringForRatio: [self ratio]]];
string = [string stringByAppendingFormat: NSLocalizedString(@"UL: %@", "Torrent -> status string"),
[NSString stringForSpeed: [self uploadRate]]];
}
else
string = @"";
} }
return string; return string;
@ -1046,6 +1045,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
case TR_STATUS_STOPPED: case TR_STATUS_STOPPED:
return NSLocalizedString(@"Paused", "Torrent -> status string"); return NSLocalizedString(@"Paused", "Torrent -> status string");
break; break;
case TR_STATUS_STOPPING:
return [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
break;
case TR_STATUS_CHECK: case TR_STATUS_CHECK:
return [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)", return [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",
@ -1064,10 +1067,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
case TR_STATUS_DONE: case TR_STATUS_DONE:
return NSLocalizedString(@"Seeding", "Torrent -> status string"); return NSLocalizedString(@"Seeding", "Torrent -> status string");
break; break;
case TR_STATUS_STOPPING:
return [NSLocalizedString(@"Stopping", "Torrent -> status string") stringByAppendingEllipsis];
break;
default: default:
return NSLocalizedString(@"N/A", "Torrent -> status string"); return NSLocalizedString(@"N/A", "Torrent -> status string");