Changeset 7246
- Timestamp:
- Dec 3, 2008, 12:18:18 AM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/InfoWindowController.m
r7153 r7246 29 29 #import "FileOutlineController.h" 30 30 #import "FileListNode.h" 31 #import "PeerProgressIndicatorCell.h" 31 32 #import "TrackerTableView.h" 32 33 #import "PiecesView.h" … … 911 912 } 912 913 914 - (void) tableView: (NSTableView *) tableView willDisplayCell: (id) cell forTableColumn: (NSTableColumn *) tableColumn 915 row: (NSInteger) row 916 { 917 if (tableView == fPeerTable) 918 { 919 NSString * ident = [tableColumn identifier]; 920 921 if ([ident isEqualToString: @"Progress"]) 922 { 923 NSDictionary * peer = [fPeers objectAtIndex: row]; 924 [(PeerProgressIndicatorCell *)cell setSeed: [[peer objectForKey: @"Seed"] boolValue]]; 925 } 926 } 927 } 928 913 929 - (void) tableView: (NSTableView *) tableView didClickTableColumn: (NSTableColumn *) tableColumn 914 930 { … … 965 981 NSMutableArray * components = [NSMutableArray arrayWithCapacity: 5]; 966 982 967 [components addObject: [NSString localizedStringWithFormat: NSLocalizedString(@"Progress: %.1f%%", 968 "Inspector -> Peers tab -> table row tooltip"), [[peer objectForKey: @"Progress"] floatValue] * 100.0]]; 983 CGFloat progress = [[peer objectForKey: @"Progress"] floatValue]; 984 985 NSString * seedStatus; 986 if (progress < 1.0 && [[peer objectForKey: @"Seed"] boolValue]) 987 seedStatus = [NSString stringWithFormat: @" (%@)", NSLocalizedString(@"Partial Seed", 988 "Inspector -> Peers tab -> table row tooltip")]; 989 else 990 seedStatus = @""; 991 992 [components addObject: [NSString localizedStringWithFormat: NSLocalizedString(@"Progress: %.1f%%%@", 993 "Inspector -> Peers tab -> table row tooltip"), progress * 100.0, seedStatus]]; 969 994 970 995 if ([[peer objectForKey: @"Encryption"] boolValue]) -
trunk/macosx/PeerProgressIndicatorCell.h
r5349 r7246 28 28 { 29 29 NSDictionary * fAttributes; 30 BOOL fSeed; 30 31 } 31 32 33 - (void) setSeed: (BOOL) seed; 34 32 35 @end -
trunk/macosx/PeerProgressIndicatorCell.m
r6980 r7246 41 41 } 42 42 43 - (void) setSeed: (BOOL) seed 44 { 45 fSeed = seed; 46 } 47 43 48 - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView 44 49 { … … 59 64 60 65 [super drawWithFrame: cellFrame inView: controlView]; 61 if ( [self floatValue] >= 1.0f)66 if (fSeed) 62 67 { 63 68 NSImage * checkImage = [NSImage imageNamed: @"CompleteCheck.png"]; -
trunk/macosx/Torrent.m
r7199 r7246 1039 1039 { 1040 1040 tr_peer_stat * peer = &peers[i]; 1041 NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 9];1041 NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 10]; 1042 1042 1043 1043 [dict setObject: [NSNumber numberWithInt: peer->from] forKey: @"From"]; … … 1045 1045 [dict setObject: [NSNumber numberWithInt: peer->port] forKey: @"Port"]; 1046 1046 [dict setObject: [NSNumber numberWithFloat: peer->progress] forKey: @"Progress"]; 1047 [dict setObject: [NSNumber numberWithBool: peer->isSeed] forKey: @"Seed"]; 1047 1048 [dict setObject: [NSNumber numberWithBool: peer->isEncrypted] forKey: @"Encryption"]; 1048 1049 [dict setObject: [NSString stringWithUTF8String: peer->client] forKey: @"Client"];
Note: See TracChangeset
for help on using the changeset viewer.