Changeset 2255
- Timestamp:
- Jun 30, 2007, 9:53:45 PM (16 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.h
r2249 r2255 34 34 @interface Torrent : NSObject 35 35 { 36 tr_handle_t 36 tr_handle_t * fLib; 37 37 tr_torrent_t * fHandle; 38 tr_info_t* fInfo;39 tr_stat_t 38 const tr_info_t * fInfo; 39 tr_stat_t * fStat; 40 40 41 41 int fID; … … 223 223 224 224 - (int) torrentID; 225 - ( tr_info_t *) torrentInfo;225 - (const tr_info_t *) torrentInfo; 226 226 - (tr_stat_t *) torrentStat; 227 227 -
trunk/macosx/Torrent.m
r2251 r2255 819 819 return YES; 820 820 821 NSString * volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] 822 objectAtIndex: 0]; 823 NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]]; 824 uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue], 825 torrentRemaining = fStat->left; 826 827 if (volumeName && remainingSpace <= torrentRemaining) 828 { 829 NSAlert * alert = [[NSAlert alloc] init]; 830 [alert setMessageText: [NSString stringWithFormat: 831 NSLocalizedString(@"Not enough remaining disk space to download \"%@\" completely.", 832 "Torrent file disk space alert -> title"), [self name]]]; 833 [alert setInformativeText: [NSString stringWithFormat: 834 NSLocalizedString(@"The transfer will be paused. Clear up space on \"%@\" to continue.", 835 "Torrent file disk space alert -> message"), volumeName]]; 836 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file disk space alert -> button")]; 837 [alert addButtonWithTitle: NSLocalizedString(@"Download Anyway", "Torrent file disk space alert -> button")]; 838 [alert addButtonWithTitle: NSLocalizedString(@"Always Download", "Torrent file disk space alert -> button")]; 839 840 int result = [alert runModal]; 841 [alert release]; 842 843 if (result == NSAlertThirdButtonReturn) 844 [fDefaults setBool: NO forKey: @"WarningRemainingSpace"]; 845 846 return result != NSAlertFirstButtonReturn; 821 NSString * volumeName; 822 if ((volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] objectAtIndex: 0])) 823 { 824 NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]]; 825 uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue]; 826 827 if (remainingSpace <= fStat->left) 828 { 829 NSAlert * alert = [[NSAlert alloc] init]; 830 [alert setMessageText: [NSString stringWithFormat: 831 NSLocalizedString(@"Not enough remaining disk space to download \"%@\" completely.", 832 "Torrent file disk space alert -> title"), [self name]]]; 833 [alert setInformativeText: [NSString stringWithFormat: 834 NSLocalizedString(@"The transfer will be paused. Clear up space on \"%@\" to continue.", 835 "Torrent file disk space alert -> message"), volumeName]]; 836 [alert addButtonWithTitle: NSLocalizedString(@"OK", "Torrent file disk space alert -> button")]; 837 [alert addButtonWithTitle: NSLocalizedString(@"Download Anyway", "Torrent file disk space alert -> button")]; 838 [alert addButtonWithTitle: NSLocalizedString(@"Always Download", "Torrent file disk space alert -> button")]; 839 840 int result = [alert runModal]; 841 [alert release]; 842 843 if (result == NSAlertThirdButtonReturn) 844 [fDefaults setBool: NO forKey: @"WarningRemainingSpace"]; 845 846 return result != NSAlertFirstButtonReturn; 847 } 847 848 } 848 849 return YES; … … 1444 1445 } 1445 1446 1446 - ( tr_info_t *) torrentInfo1447 - (const tr_info_t *) torrentInfo 1447 1448 { 1448 1449 return fInfo;
Note: See TracChangeset
for help on using the changeset viewer.