Changeset 7483


Ignore:
Timestamp:
Dec 24, 2008, 1:42:10 AM (12 years ago)
Author:
livings124
Message:

remove Mac's custom code to show a warning when a folder contains extra data when deleting (in preparation of implementing [7473])

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Defaults.plist

    r7370 r7483  
    175175        <key>UseIncompleteDownloadFolder</key>
    176176        <false/>
    177         <key>WarningCheckContentsForRemove</key>
    178         <true/>
    179177        <key>WarningCreatorBlankAddress</key>
    180178        <true/>
  • trunk/macosx/PrefsController.m

    r7468 r7483  
    636636    [fDefaults removeObjectForKey: @"WarningRemoveBuiltInTracker"];
    637637    [fDefaults removeObjectForKey: @"WarningInvalidOpen"];
    638     [fDefaults removeObjectForKey: @"WarningCheckContentsForRemove"];
    639638}
    640639
  • trunk/macosx/Torrent.m

    r7468 r7483  
    454454- (void) trashData
    455455{
    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 levels
    477                 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             else
    508                 [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             else
    518                 break;
    519         }
    520     }
    521    
    522456    [self trashFile: [self dataLocation]];
    523457}
  • trunk/macosx/en.lproj/Localizable.strings

    r7325 r7483  
    126126"\"%@\" cannot be used. The transfer will be paused." = "\"%@\" cannot be used. The transfer will be paused.";
    127127
    128 /* Delete folder with extra contents -> title */
    129 "\"%@\" contains extra content." = "\"%@\" contains extra content.";
    130 
    131128/* Open invalid alert -> title */
    132129"\"%@\" is not a valid torrent file." = "\"%@\" is not a valid torrent file.";
     
    156153"Add" = "Add";
    157154
    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";
    160157
    161158/* Groups -> Button */
     
    164161/* Torrent disk space alert -> button */
    165162"Always Download" = "Always Download";
     163
     164/* Groups -> rule editor -> all/any */
     165"Any" = "Any";
    166166
    167167/* All toolbar item -> label */
     
    282282"Creation of \"%@\" failed." = "Creation of \"%@\" failed.";
    283283
     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
    284287/* Inspector -> peer -> status */
    285288"Currently downloading (interested and not choked)" = "Currently downloading (interested and not choked)";
     
    298301   status bar -> status label */
    299302"DL" = "DL";
    300 
    301 /* Delete folder with extra contents -> button */
    302 "Do not check directory contents again" = "Do not check directory contents again";
    303303
    304304/* Torrent disk space alert -> button */
     
    441441"KB" = "KB";
    442442
    443 /* Delete folder with extra contents -> button */
    444 "Keep" = "Keep";
    445 
    446443/* Prefs -> blocklist -> message */
    447444"Last updated" = "Last updated";
     
    485482/* Prefs -> blocklist -> message */
    486483"Never" = "Never";
    487 
    488 /* Delete folder with extra contents -> button */
    489 "Never Check" = "Never Check";
    490484
    491485/* Group table row */
     
    543537"Open Torrent Address" = "Open Torrent Address";
    544538
     539/* Open toolbar item -> palette label */
     540"Open Torrent Files" = "Open Torrent Files";
     541
    545542/* Open toolbar item -> tooltip */
    546543"Open torrent files" = "Open torrent files";
    547 
    548 /* Open toolbar item -> palette label */
    549 "Open Torrent Files" = "Open Torrent Files";
    550544
    551545/* Open address toolbar item -> tooltip */
     
    714708"Seeding" = "Seeding";
    715709
     710/* Torrent -> status string */
     711"Seeding complete" = "Seeding complete";
     712
    716713/* Growl notification title */
    717714"Seeding Complete" = "Seeding Complete";
    718 
    719 /* Torrent -> status string */
    720 "Seeding complete" = "Seeding complete";
    721715
    722716/* Torrent -> status string */
     
    801795"The destination directory and root data directory have the same name." = "The destination directory and root data directory have the same name.";
    802796
    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 
    806797/* Default folder cannot be used alert -> message */
    807798"The download folder cannot be used. Choose a new location." = "The download folder cannot be used. Choose a new location.";
     
    932923"Transmission is already running." = "Transmission is already running.";
    933924
    934 /* Delete folder with extra contents -> button */
    935 "Trash" = "Trash";
    936 
    937925/* Torrent -> status string
    938926   status bar -> status label */
Note: See TracChangeset for help on using the changeset viewer.