Changeset 9126


Ignore:
Timestamp:
Sep 17, 2009, 1:10:18 AM (13 years ago)
Author:
livings124
Message:

show a warning whenever removing any tracker, regardless of if it's built-in

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Defaults.plist

    r8924 r9126  
    193193        <key>WarningRemainingSpace</key>
    194194        <true/>
    195         <key>WarningRemoveBuiltInTracker</key>
     195        <key>WarningRemoveTrackers</key>
    196196        <true/>
    197197        <key>WarningResetStats</key>
  • trunk/macosx/InfoWindowController.m

    r9125 r9126  
    17451745    NSMutableIndexSet * indexes = [[[fTrackerTable selectedRowIndexes] mutableCopy] autorelease];
    17461746   
    1747     //get all rows to remove and determine if any built-in trackers are being remove
    1748     NSUInteger i = 0, numberBuiltIn = 0;
     1747    //get all rows to remove
     1748    NSUInteger i = 0, trackerCount = 0;
    17491749    while (i < [fTrackers count])
    17501750    {
    1751         const BOOL builtIn = i != 0 || [[fTrackers objectAtIndex: i] intValue] != 0;
    1752        
    17531751        //if a group is selected, remove all trackers in the group
    17541752        if ([indexes containsIndex: i])
     
    17571755            {
    17581756                [indexes addIndex: i];
    1759                 if (builtIn)
    1760                     numberBuiltIn++;
     1757                trackerCount++;
    17611758            }
    17621759        }
     
    17701767                if (![indexes containsIndex: j])
    17711768                    allSelected = NO;
    1772                 else if (builtIn)
    1773                     numberBuiltIn++;
    1774                 else;
     1769                else
     1770                    trackerCount++;
    17751771            }
    17761772           
     
    17821778    }
    17831779   
    1784     #warning show warning and allow?
    17851780    if ([fTrackers count] == [indexes count])
    17861781    {
     
    17911786    Torrent * torrent = [fTorrents objectAtIndex: 0];
    17921787   
    1793     //determine if removing trackers built into the torrent
    1794     #warning remove?
    1795     if (NO && numberBuiltIn > 0 && [[NSUserDefaults standardUserDefaults] boolForKey: @"WarningRemoveBuiltInTracker"])
     1788    if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningRemoveTrackers"])
    17961789    {
    17971790        NSAlert * alert = [[NSAlert alloc] init];
    17981791       
    1799         if (numberBuiltIn > 1)
    1800         {
    1801             [alert setMessageText: [NSString stringWithFormat:
    1802                                     NSLocalizedString(@"Are you sure you want to remove %d built-in trackers?",
    1803                                     "Remove built-in tracker alert -> title"), numberBuiltIn]];
    1804             [alert setInformativeText: NSLocalizedString(@"These tracker addresses are part of the torrent file."
    1805                 " Once removed, Transmission will no longer attempt to contact them.", "Remove built-in tracker alert -> message")];
     1792        if (trackerCount > 1)
     1793        {
     1794            [alert setMessageText: [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove %d trackers?",
     1795                                                                "Remove trackers alert -> title"), trackerCount]];
     1796            [alert setInformativeText: NSLocalizedString(@"Once removed, Transmission will no longer attempt to contact them."
     1797                                        " This cannot be undone.", "Remove trackers alert -> message")];
    18061798        }
    18071799        else
    18081800        {
    1809             [alert setMessageText: NSLocalizedString(@"Are you sure you want to remove a built-in tracker?",
    1810                                     "Remove built-in tracker alert -> title")];
    1811             [alert setInformativeText: NSLocalizedString(@"The tracker address is part of the torrent file."
    1812                 " Once removed, Transmission will no longer attempt to contact it.", "Remove built-in tracker alert -> message")];
    1813         }
    1814        
    1815         [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Remove built-in tracker alert -> button")];
    1816         [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Remove built-in tracker alert -> button")];
     1801            [alert setMessageText: NSLocalizedString(@"Are you sure you want to remove this tracker?", "Remove trackers alert -> title")];
     1802            [alert setInformativeText: NSLocalizedString(@"Once removed, Transmission will no longer attempt to contact it."
     1803                                        " This cannot be undone.", "Remove trackers alert -> message")];
     1804        }
     1805       
     1806        [alert addButtonWithTitle: NSLocalizedString(@"Remove", "Remove trackers alert -> button")];
     1807        [alert addButtonWithTitle: NSLocalizedString(@"Cancel", "Remove trackers alert -> button")];
    18171808       
    18181809        [alert setShowsSuppressionButton: YES];
     
    18201811        NSInteger result = [alert runModal];
    18211812        if ([[alert suppressionButton] state] == NSOnState)
    1822             [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningRemoveBuiltInTracker"];
     1813            [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningRemoveTrackers"];
    18231814        [alert release];
    18241815       
  • trunk/macosx/PrefsController.m

    r9020 r9126  
    676676    [fDefaults removeObjectForKey: @"WarningResetStats"];
    677677    [fDefaults removeObjectForKey: @"WarningCreatorBlankAddress"];
    678     [fDefaults removeObjectForKey: @"WarningRemoveBuiltInTracker"];
     678    [fDefaults removeObjectForKey: @"WarningRemoveTrackers"];
    679679    [fDefaults removeObjectForKey: @"WarningInvalidOpen"];
    680680    [fDefaults removeObjectForKey: @"WarningDonate"];
Note: See TracChangeset for help on using the changeset viewer.