Changeset 5149
- Timestamp:
- Feb 27, 2008, 7:34:55 PM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/AddWindowController.h
r4583 r5149 61 61 - (void) verifyLocalData: (id) sender; 62 62 63 - (void) updateStatusField: (NSNotification *) notification; 64 63 65 - (void) updateGroupMenu: (NSNotification *) notification; 64 66 - (void) showGroupsWindow: (id) sender; -
trunk/macosx/AddWindowController.m
r5030 r5149 70 70 - (void) awakeFromNib 71 71 { 72 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateStatusField:) 73 name: @"TorrentFileCheckChange" object: fTorrent]; 74 72 75 [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateGroupMenu:) 73 76 name: @"UpdateGroups" object: nil]; … … 84 87 [icon release]; 85 88 86 NSString * statusString = [NSString stringForFileSize: [fTorrent size]]; 87 if ([fTorrent folder]) 88 { 89 NSString * fileString; 90 int count = [fTorrent fileCount]; 91 if (count != 1) 92 fileString = [NSString stringWithFormat: NSLocalizedString(@"%d Files, ", "Add torrent -> info"), count]; 93 else 94 fileString = NSLocalizedString(@"1 File, ", "Add torrent -> info"); 95 statusString = [fileString stringByAppendingString: statusString]; 96 } 97 [fStatusField setStringValue: statusString]; 89 [self updateStatusField: nil]; 98 90 99 91 [self setGroupsMenu]; … … 213 205 } 214 206 207 - (void) updateStatusField: (NSNotification *) notification 208 { 209 NSString * statusString = [NSString stringForFileSize: [fTorrent size]]; 210 if ([fTorrent folder]) 211 statusString = [statusString stringByAppendingFormat: NSLocalizedString(@" (%@ selected)", "Add torrent -> info"), 212 [NSString stringForFileSize: [fTorrent totalSizeSelected]]]; 213 214 if ([fTorrent folder]) 215 { 216 NSString * fileString; 217 int count = [fTorrent fileCount]; 218 if (count != 1) 219 fileString = [NSString stringWithFormat: NSLocalizedString(@"%d Files, ", "Add torrent -> info"), count]; 220 else 221 fileString = NSLocalizedString(@"1 File, ", "Add torrent -> info"); 222 statusString = [fileString stringByAppendingString: statusString]; 223 } 224 225 [fStatusField setStringValue: statusString]; 226 } 227 215 228 - (void) updateGroupMenu: (NSNotification *) notification 216 229 { -
trunk/macosx/Torrent.h
r5139 r5149 217 217 - (uint64_t) haveVerified; 218 218 - (uint64_t) haveTotal; 219 - (uint64_t) totalSizeSelected; 219 220 - (uint64_t) downloadedTotal; 220 221 - (uint64_t) uploadedTotal; -
trunk/macosx/Torrent.m
r5143 r5149 810 810 { 811 811 return fStat->percentComplete; 812 //return (float)[self haveTotal] / [self size];813 812 } 814 813 … … 940 939 if ([fDefaults boolForKey: @"DisplayStatusProgressSelected"]) 941 940 { 942 uint64_t have = [self haveTotal];943 941 string = [NSString stringWithFormat: NSLocalizedString(@"%@ of %@ selected (%.2f%%)", "Torrent -> progress string"), 944 [NSString stringForFileSize: have], [NSString stringForFileSize: have + [self sizeLeft]],942 [NSString stringForFileSize: [self haveTotal]], [NSString stringForFileSize: [self totalSizeSelected]], 945 943 100.0 * [self progressDone]]; 946 944 } … … 1221 1219 } 1222 1220 1221 - (uint64_t) totalSizeSelected 1222 { 1223 return [self haveTotal] + [self sizeLeft]; 1224 } 1225 1223 1226 - (uint64_t) downloadedTotal 1224 1227 { … … 1353 1356 1354 1357 [self update]; 1358 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFileCheckChange" object: self]; 1355 1359 } 1356 1360
Note: See TracChangeset
for help on using the changeset viewer.