Changeset 7153
- Timestamp:
- Nov 25, 2008, 3:04:17 AM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Defaults.plist
r6826 r7153 173 173 <key>UseIncompleteDownloadFolder</key> 174 174 <false/> 175 <key>WarningCheckContentsForRemove</key> 176 <true/> 175 177 <key>WarningCreatorBlankAddress</key> 176 178 <true/> -
trunk/macosx/FileListNode.h
r7007 r7153 53 53 - (NSArray *) children; 54 54 55 - (BOOL) containsPath: (NSString *) fullPath; 56 55 57 @end -
trunk/macosx/FileListNode.m
r7007 r7153 129 129 } 130 130 131 - (BOOL) containsPath: (NSString *) fullPath 132 { 133 if ([fullPath isEqualToString: fPath]) 134 return YES; 135 136 if (fIsFolder && [fullPath hasPrefix: fPath]) 137 { 138 NSEnumerator * enumerator = [fChildren objectEnumerator]; 139 FileListNode * node; 140 while ((node = [enumerator nextObject])) 141 if ([node containsPath: fullPath]) 142 return YES; 143 } 144 145 return NO; 146 } 147 131 148 @end 132 149 -
trunk/macosx/InfoWindowController.m
r7016 r7153 997 997 998 998 //determing status strings from flags 999 NSMutableArray * statusArray = [NSMutableArray arrayWithCapacity: 3];999 NSMutableArray * statusArray = [NSMutableArray arrayWithCapacity: 6]; 1000 1000 NSString * flags = [peer objectForKey: @"Flags"]; 1001 1001 … … 1003 1003 [statusArray addObject: NSLocalizedString(@"Currently downloading (interested and not choked)", 1004 1004 "Inspector -> peer -> status")]; 1005 elseif ([flags rangeOfString: @"d"].location != NSNotFound)1005 if ([flags rangeOfString: @"d"].location != NSNotFound) 1006 1006 [statusArray addObject: NSLocalizedString(@"You want to download, but peer does not want to send (interested and choked)", 1007 1007 "Inspector -> peer -> status")]; 1008 else;1009 1010 1008 if ([flags rangeOfString: @"U"].location != NSNotFound) 1011 1009 [statusArray addObject: NSLocalizedString(@"Currently uploading (interested and not choked)", 1012 1010 "Inspector -> peer -> status")]; 1013 elseif ([flags rangeOfString: @"u"].location != NSNotFound)1011 if ([flags rangeOfString: @"u"].location != NSNotFound) 1014 1012 [statusArray addObject: NSLocalizedString(@"Peer wants you to upload, but you do not want to (interested and choked)", 1015 1013 "Inspector -> peer -> status")]; 1016 else;1017 1018 1014 if ([flags rangeOfString: @"K"].location != NSNotFound) 1019 1015 [statusArray addObject: NSLocalizedString(@"Peer is unchoking you, but you are not interested", 1020 1016 "Inspector -> peer -> status")]; 1021 1022 1017 if ([flags rangeOfString: @"?"].location != NSNotFound) 1023 1018 [statusArray addObject: NSLocalizedString(@"You unchoked the peer, but the peer is not interested", … … 1025 1020 1026 1021 if ([statusArray count] > 0) 1027 [components addObject: [@"\n" stringByAppendingString: [statusArray componentsJoinedByString: @"\n\n"]]]; 1022 { 1023 NSString * statusStrings = [statusArray componentsJoinedByString: @"\n\n"]; 1024 [components addObject: [@"\n" stringByAppendingString: statusStrings]]; 1025 } 1028 1026 1029 1027 return [components componentsJoinedByString: @"\n"]; -
trunk/macosx/PrefsController.m
r7081 r7153 612 612 [fDefaults removeObjectForKey: @"WarningRemoveBuiltInTracker"]; 613 613 [fDefaults removeObjectForKey: @"WarningInvalidOpen"]; 614 [fDefaults removeObjectForKey: @"WarningCheckContentsForRemove"]; 614 615 } 615 616 -
trunk/macosx/Torrent.m
r7151 r7153 449 449 - (void) trashData 450 450 { 451 if ([self isFolder] && [fDefaults boolForKey: @"WarningCheckContentsForRemove"]) 452 { 453 NSEnumerator * enumerator = [[NSFileManager defaultManager] enumeratorAtPath: [self dataLocation]]; 454 NSString * file; 455 while ((file = [enumerator nextObject])) 456 { 457 if ([[file lastPathComponent] hasPrefix: @"."]) 458 continue; 459 460 file = [[self name] stringByAppendingPathComponent: file]; 461 BOOL isExtra = YES; 462 463 NSEnumerator * nodeEnumerator = [fFileList objectEnumerator]; 464 FileListNode * node; 465 while ((node = [nodeEnumerator nextObject])) 466 { 467 if ([node containsPath: file]) 468 { 469 isExtra = NO; 470 break; 471 } 472 } 473 474 if (!isExtra) 475 continue; 476 477 NSLog(@"Extra file found: %@", file); 478 479 NSAlert * alert = [[NSAlert alloc] init]; 480 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"\"%@\" contains extra content.", 481 "Delete folder with extra contents -> title"), [self name]]]; 482 [alert setInformativeText: NSLocalizedString(@"The directory contains data that is not part of the transfer." 483 " Are you sure you want to move this directory to the trash?", "Delete folder with extra contents -> message")]; 484 [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Delete folder with extra contents -> button")]; 485 [alert addButtonWithTitle: NSLocalizedString(@"Keep", "Delete folder with extra contents -> button")]; 486 487 BOOL onLeopard = [NSApp isOnLeopardOrBetter]; 488 if (onLeopard) 489 { 490 [alert setShowsSuppressionButton: YES]; 491 [[alert suppressionButton] setTitle: NSLocalizedString(@"Do not check directory contents again", 492 "Delete folder with extra contents -> button")]; 493 } 494 else 495 [alert addButtonWithTitle: NSLocalizedString(@"Never Check", "Delete folder with extra contents -> button")]; 496 497 NSInteger result = [alert runModal]; 498 if ((onLeopard ? [[alert suppressionButton] state] == NSOnState : result == NSAlertThirdButtonReturn)) 499 [fDefaults setBool: NO forKey: @"WarningCheckContentsForRemove"]; 500 [alert release]; 501 502 if (result == NSAlertSecondButtonReturn) 503 return; 504 else 505 break; 506 } 507 } 508 451 509 [self trashFile: [self dataLocation]]; 452 510 }
Note: See TracChangeset
for help on using the changeset viewer.