Changeset 2438
- Timestamp:
- Jul 19, 2007, 10:12:23 PM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/English.lproj/Localizable.strings
r2424 r2438 512 512 513 513 /* Torrent file disk space alert -> message */ 514 "The transfer will be paused. Clear up space on %@ to continue." = "The transfer will be paused. Clear up space on %@to continue.";514 "The transfer will be paused. Clear up space on %@ or deselect files in the torrent inspector to continue." = "The transfer will be paused. Clear up space on %@ or deselect files in the torrent inspector to continue."; 515 515 516 516 /* Removal confirm panel -> message part 1 */ -
trunk/macosx/Torrent.m
r2424 r2438 808 808 if ((volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] objectAtIndex: 0])) 809 809 { 810 NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]]; 811 uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue]; 812 813 #warning add file size to remaining space and add total size 814 if (remainingSpace <= fStat->left) 810 NSDictionary * systemAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]]; 811 uint64_t remainingSpace = [[systemAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue]; 812 813 uint64_t existingSize = 0; 814 NSDirectoryEnumerator * enumerator; 815 if (enumerator = [[NSFileManager defaultManager] enumeratorAtPath: 816 [[self downloadFolder] stringByAppendingPathComponent: [self name]]]) 817 { 818 NSDictionary * fileAttributes; 819 while ([enumerator nextObject]) 820 { 821 fileAttributes = [enumerator fileAttributes]; 822 if (![[fileAttributes objectForKey: NSFileType] isEqualTo: NSFileTypeDirectory]) 823 existingSize += [[fileAttributes objectForKey: NSFileSize] unsignedLongLongValue]; 824 } 825 } 826 827 #warning factor in checked files 828 if (remainingSpace + existingSize <= [self size]) 815 829 { 816 830 NSAlert * alert = [[NSAlert alloc] init]; … … 818 832 NSLocalizedString(@"Not enough remaining disk space to download \"%@\" completely.", 819 833 "Torrent file disk space alert -> title"), [self name]]]; 820 [alert setInformativeText: [NSString stringWithFormat: 821 NSLocalizedString(@"The transfer will be paused. Clear up space on %@to continue.",822 834 [alert setInformativeText: [NSString stringWithFormat: NSLocalizedString(@"The transfer will be paused." 835 " Clear up space on %@ or deselect files in the torrent inspector to continue.", 836 "Torrent file disk space alert -> message"), volumeName]]; 823 837 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file disk space alert -> button")]; 824 838 [alert addButtonWithTitle: NSLocalizedString(@"Download Anyway", "Torrent file disk space alert -> button")];
Note: See TracChangeset
for help on using the changeset viewer.