Changeset 7483
- Timestamp:
- Dec 24, 2008, 1:42:10 AM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Defaults.plist
r7370 r7483 175 175 <key>UseIncompleteDownloadFolder</key> 176 176 <false/> 177 <key>WarningCheckContentsForRemove</key>178 <true/>179 177 <key>WarningCreatorBlankAddress</key> 180 178 <true/> -
trunk/macosx/PrefsController.m
r7468 r7483 636 636 [fDefaults removeObjectForKey: @"WarningRemoveBuiltInTracker"]; 637 637 [fDefaults removeObjectForKey: @"WarningInvalidOpen"]; 638 [fDefaults removeObjectForKey: @"WarningCheckContentsForRemove"];639 638 } 640 639 -
trunk/macosx/Torrent.m
r7468 r7483 454 454 - (void) trashData 455 455 { 456 if ([self isFolder] && [fDefaults boolForKey: @"WarningCheckContentsForRemove"])457 {458 NSEnumerator * enumerator = [[NSFileManager defaultManager] enumeratorAtPath: [self dataLocation]];459 NSString * file;460 while ((file = [enumerator nextObject]))461 {462 NSArray * actualComponents = [file pathComponents];463 if ([[actualComponents lastObject] hasPrefix: @"."])464 continue;465 466 BOOL isExtra = YES;467 468 NSEnumerator * nodeEnumerator = [fFlatFileList objectEnumerator];469 FileListNode * node;470 while ((node = [nodeEnumerator nextObject]))471 {472 NSArray * listedComponents = [[node fullPath] pathComponents];473 if ([listedComponents count]-1 < [actualComponents count])474 continue;475 476 //remove first component (the folder name) and only include the same number of levels477 listedComponents = [listedComponents objectsAtIndexes: [NSIndexSet indexSetWithIndexesInRange:478 NSMakeRange(1, [actualComponents count])]];479 480 if ([listedComponents isEqualToArray: actualComponents])481 {482 isExtra = NO;483 break;484 }485 }486 487 if (!isExtra)488 continue;489 490 NSLog(@"Extra file found: %@", file);491 492 NSAlert * alert = [[NSAlert alloc] init];493 [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"\"%@\" contains extra content.",494 "Delete folder with extra contents -> title"), [self name]]];495 [alert setInformativeText: NSLocalizedString(@"The directory contains data that is not part of the transfer."496 " Are you sure you want to move this directory to the trash?", "Delete folder with extra contents -> message")];497 [alert addButtonWithTitle: NSLocalizedString(@"Trash", "Delete folder with extra contents -> button")];498 [alert addButtonWithTitle: NSLocalizedString(@"Keep", "Delete folder with extra contents -> button")];499 500 BOOL onLeopard = [NSApp isOnLeopardOrBetter];501 if (onLeopard)502 {503 [alert setShowsSuppressionButton: YES];504 [[alert suppressionButton] setTitle: NSLocalizedString(@"Do not check directory contents again",505 "Delete folder with extra contents -> button")];506 }507 else508 [alert addButtonWithTitle: NSLocalizedString(@"Never Check", "Delete folder with extra contents -> button")];509 510 NSInteger result = [alert runModal];511 if ((onLeopard ? [[alert suppressionButton] state] == NSOnState : result == NSAlertThirdButtonReturn))512 [fDefaults setBool: NO forKey: @"WarningCheckContentsForRemove"];513 [alert release];514 515 if (result == NSAlertSecondButtonReturn)516 return;517 else518 break;519 }520 }521 522 456 [self trashFile: [self dataLocation]]; 523 457 } -
trunk/macosx/en.lproj/Localizable.strings
r7325 r7483 126 126 "\"%@\" cannot be used. The transfer will be paused." = "\"%@\" cannot be used. The transfer will be paused."; 127 127 128 /* Delete folder with extra contents -> title */129 "\"%@\" contains extra content." = "\"%@\" contains extra content.";130 131 128 /* Open invalid alert -> title */ 132 129 "\"%@\" is not a valid torrent file." = "\"%@\" is not a valid torrent file."; … … 156 153 "Add" = "Add"; 157 154 158 /* Groups -> rule editor -> button*/159 "All criteria must be met to assign a transfer on add." = "All criteria must be met to assign a transfer on add.";155 /* Groups -> rule editor -> all/any */ 156 "All" = "All"; 160 157 161 158 /* Groups -> Button */ … … 164 161 /* Torrent disk space alert -> button */ 165 162 "Always Download" = "Always Download"; 163 164 /* Groups -> rule editor -> all/any */ 165 "Any" = "Any"; 166 166 167 167 /* All toolbar item -> label */ … … 282 282 "Creation of \"%@\" failed." = "Creation of \"%@\" failed."; 283 283 284 /* Groups -> rule editor -> button (All/Any criteria must....) */ 285 "criteria must be met to assign a transfer on add." = "criteria must be met to assign a transfer on add."; 286 284 287 /* Inspector -> peer -> status */ 285 288 "Currently downloading (interested and not choked)" = "Currently downloading (interested and not choked)"; … … 298 301 status bar -> status label */ 299 302 "DL" = "DL"; 300 301 /* Delete folder with extra contents -> button */302 "Do not check directory contents again" = "Do not check directory contents again";303 303 304 304 /* Torrent disk space alert -> button */ … … 441 441 "KB" = "KB"; 442 442 443 /* Delete folder with extra contents -> button */444 "Keep" = "Keep";445 446 443 /* Prefs -> blocklist -> message */ 447 444 "Last updated" = "Last updated"; … … 485 482 /* Prefs -> blocklist -> message */ 486 483 "Never" = "Never"; 487 488 /* Delete folder with extra contents -> button */489 "Never Check" = "Never Check";490 484 491 485 /* Group table row */ … … 543 537 "Open Torrent Address" = "Open Torrent Address"; 544 538 539 /* Open toolbar item -> palette label */ 540 "Open Torrent Files" = "Open Torrent Files"; 541 545 542 /* Open toolbar item -> tooltip */ 546 543 "Open torrent files" = "Open torrent files"; 547 548 /* Open toolbar item -> palette label */549 "Open Torrent Files" = "Open Torrent Files";550 544 551 545 /* Open address toolbar item -> tooltip */ … … 714 708 "Seeding" = "Seeding"; 715 709 710 /* Torrent -> status string */ 711 "Seeding complete" = "Seeding complete"; 712 716 713 /* Growl notification title */ 717 714 "Seeding Complete" = "Seeding Complete"; 718 719 /* Torrent -> status string */720 "Seeding complete" = "Seeding complete";721 715 722 716 /* Torrent -> status string */ … … 801 795 "The destination directory and root data directory have the same name." = "The destination directory and root data directory have the same name."; 802 796 803 /* Delete folder with extra contents -> message */804 "The directory contains data that is not part of the transfer. Are you sure you want to move this directory to the trash?" = "The directory contains data that is not part of the transfer. Are you sure you want to move this directory to the trash?";805 806 797 /* Default folder cannot be used alert -> message */ 807 798 "The download folder cannot be used. Choose a new location." = "The download folder cannot be used. Choose a new location."; … … 932 923 "Transmission is already running." = "Transmission is already running."; 933 924 934 /* Delete folder with extra contents -> button */935 "Trash" = "Trash";936 937 925 /* Torrent -> status string 938 926 status bar -> status label */
Note: See TracChangeset
for help on using the changeset viewer.