1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-23 06:30:38 +00:00

streamline the minimal status string code a little

This commit is contained in:
Mitchell Livingston 2007-09-30 13:41:26 +00:00
parent aaaa932625
commit 66bf641f5d
2 changed files with 5 additions and 14 deletions

View file

@ -1014,15 +1014,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
{ {
switch (fStat->status) switch (fStat->status)
{ {
case TR_STATUS_CHECK_WAIT:
return [NSLocalizedString(@"Waiting to check existing data", "Torrent -> status string") stringByAppendingEllipsis];
break;
case TR_STATUS_CHECK:
return [NSString stringWithFormat: NSLocalizedString(@"Checking existing data (%.2f%%)",
"Torrent -> status string"), 100.0 * fStat->recheckProgress];
break;
case TR_STATUS_DOWNLOAD: case TR_STATUS_DOWNLOAD:
return [self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time"); return [self eta] >= 0 ? [self etaString] : NSLocalizedString(@"Unknown", "Torrent -> remaining time");
break; break;
@ -1034,7 +1025,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
break; break;
default: default:
return @""; return [self shortStatusString];
} }
} }

View file

@ -120,8 +120,8 @@
- (NSRect) minimalStatusRectForBounds: (NSRect) bounds - (NSRect) minimalStatusRectForBounds: (NSRect) bounds
{ {
Torrent * torrent = [self representedObject]; Torrent * torrent = [self representedObject];
NSString * string = [torrent isActive] && ![fDefaults boolForKey: @"DisplaySmallStatusRegular"] NSString * string = [fDefaults boolForKey: @"DisplaySmallStatusRegular"]
? [torrent remainingTimeString] : [torrent shortStatusString]; ? [torrent shortStatusString] : [torrent remainingTimeString];
return [self rectForMinimalStatusWithString: [self attributedStatusString: string withColor: nil] inBounds: bounds]; return [self rectForMinimalStatusWithString: [self attributedStatusString: string withColor: nil] inBounds: bounds];
} }
@ -204,8 +204,8 @@
NSRect minimalStatusRect; NSRect minimalStatusRect;
if (minimal) if (minimal)
{ {
NSString * string = [torrent isActive] && ![fDefaults boolForKey: @"DisplaySmallStatusRegular"] NSString * string = [fDefaults boolForKey: @"DisplaySmallStatusRegular"]
? [torrent remainingTimeString] : [torrent shortStatusString]; ? [torrent shortStatusString] : [torrent remainingTimeString];
NSAttributedString * minimalString = [self attributedStatusString: string withColor: statusColor]; NSAttributedString * minimalString = [self attributedStatusString: string withColor: statusColor];
minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame]; minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame];