1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-29 02:56:11 +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

@ -907,6 +907,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
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];
break; break;
@ -935,10 +939,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
[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)
@ -978,6 +979,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
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];
break; break;
@ -987,24 +992,18 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
"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])
{
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 = @""; string = @"";
} }
@ -1047,6 +1046,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
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%%)",
"Torrent -> status string"), 100.0 * fStat->recheckProgress]; "Torrent -> status string"), 100.0 * fStat->recheckProgress];
@ -1065,10 +1068,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
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");
} }