Changeset 10711
- Timestamp:
- May 31, 2010, 2:06:54 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/FileNameCell.m
r10432 r10711 30 30 #import "NSStringAdditions.h" 31 31 32 #import "transmission.h" // required by utils.h 33 #import "utils.h" 34 32 35 #define PADDING_HORIZONAL 2.0 33 36 #define IMAGE_FOLDER_SIZE 16.0 … … 204 207 205 208 const CGFloat progress = [torrent fileProgress: node]; 206 NSString * percentString = progress == 1.0 ? @"100%" : [NSString localizedStringWithFormat: @"%.2f%%", progress * 100.0]; 209 NSString * percentString = progress == 1.0 ? @"100%" 210 : [NSString localizedStringWithFormat: @"%.2f%%", tr_truncd(progress * 100.0, 2)]; 207 211 208 212 NSString * status = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@", -
trunk/macosx/InfoActivityViewController.m
r10522 r10711 125 125 [fStateField setStringValue: [torrent stateString]]; 126 126 127 #warning simplify 127 128 if ([torrent isFolder]) 128 129 [fProgressField setStringValue: [NSString localizedStringWithFormat: NSLocalizedString(@"%.2f%% (%.2f%% selected)", 129 "Inspector -> Activity tab -> progress"), 100.0 * [torrent progress], 100.0 * [torrent progressDone]]]; 130 "Inspector -> Activity tab -> progress"), tr_truncd(100.0 * [torrent progress], 2), 131 tr_truncd(100.0 * [torrent progressDone], 2)]]; 130 132 else 131 [fProgressField setStringValue: [NSString localizedStringWithFormat: @"%.2f%%", 100.0 * [torrent progress]]];133 [fProgressField setStringValue: [NSString localizedStringWithFormat: @"%.2f%%", tr_truncd(100.0 * [torrent progress], 2)]]; 132 134 133 135 [fRatioField setStringValue: [NSString stringForRatio: [torrent ratio]]]; -
trunk/macosx/InfoPeersViewController.m
r10666 r10711 29 29 #import "Torrent.h" 30 30 31 #import "transmission.h" // required by utils.h 32 #import "utils.h" 33 31 34 @interface InfoPeersViewController (Private) 32 35 … … 357 360 const CGFloat progress = [[peer objectForKey: @"Progress"] floatValue]; 358 361 NSString * progressString = [NSString localizedStringWithFormat: NSLocalizedString(@"Progress: %.1f%%", 359 "Inspector -> Peers tab -> table row tooltip"), progress * 100.0];362 "Inspector -> Peers tab -> table row tooltip"), tr_truncd(progress * 100.0, 1)]; 360 363 if (progress < 1.0 && [[peer objectForKey: @"Seed"] boolValue]) 361 364 progressString = [progressString stringByAppendingFormat: @" (%@)", NSLocalizedString(@"Partial Seed", -
trunk/macosx/PeerProgressIndicatorCell.m
r9844 r10711 25 25 #import "PeerProgressIndicatorCell.h" 26 26 #import "NSApplicationAdditions.h" 27 28 #import "transmission.h" // required by utils.h 29 #import "utils.h" 27 30 28 31 @implementation PeerProgressIndicatorCell … … 61 64 } 62 65 63 [[NSString localizedStringWithFormat: @"%.1f%%", [self floatValue] * 100.0] drawInRect: cellFrame withAttributes: fAttributes]; 66 [[NSString localizedStringWithFormat: @"%.1f%%", tr_truncd([self floatValue] * 100.0, 1)] drawInRect: cellFrame 67 withAttributes: fAttributes]; 64 68 } 65 69 else -
trunk/macosx/Torrent.m
r10637 r10711 768 768 - (CGFloat) progress 769 769 { 770 return fStat->percentComplete;770 return .9999999;//fStat->percentComplete; 771 771 } 772 772 … … 930 930 NSString * progressString = fStat->metadataPercentComplete > 0.0 931 931 ? [NSString localizedStringWithFormat: NSLocalizedString(@"%.2f%% of torrent metadata retrieved", 932 "Torrent -> progress string"), 100.0 * fStat->metadataPercentComplete]932 "Torrent -> progress string"), tr_truncd(100.0 * fStat->metadataPercentComplete, 2)] 933 933 : NSLocalizedString(@"torrent metadata needed", "Torrent -> progress string"); 934 934 … … 955 955 } 956 956 957 string = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", string, progress];957 string = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", string, tr_truncd(progress, 2)]; 958 958 } 959 959 else … … 970 970 [NSString stringForFileSize: [self haveTotal]], [NSString stringForFileSize: [self size]]]; 971 971 972 downloadString = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", downloadString, 100.0 * [self progress]]; 972 downloadString = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", 973 downloadString, tr_truncd(100.0 * [self progress], 2)]; 973 974 } 974 975 } … … 1031 1032 case TR_STATUS_CHECK: 1032 1033 string = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", 1033 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 100.0 * [self checkingProgress]]; 1034 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 1035 tr_truncd(100.0 * [self checkingProgress], 2)]; 1034 1036 break; 1035 1037 … … 1110 1112 case TR_STATUS_CHECK: 1111 1113 string = [NSString localizedStringWithFormat: @"%@ (%.2f%%)", 1112 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 100.0 * [self checkingProgress]]; 1114 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 1115 tr_truncd(100.0 * [self checkingProgress], 2)]; 1113 1116 break; 1114 1117 … … 1163 1166 case TR_STATUS_CHECK: 1164 1167 return [NSString localizedStringWithFormat: @"%@ (%.2f%%)", 1165 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 100.0 * [self checkingProgress]]; 1168 NSLocalizedString(@"Checking existing data", "Torrent -> status string"), 1169 tr_truncd(100.0 * [self checkingProgress], 2)]; 1166 1170 1167 1171 case TR_STATUS_DOWNLOAD:
Note: See TracChangeset
for help on using the changeset viewer.