Changeset 10212


Ignore:
Timestamp:
Feb 15, 2010, 7:26:23 PM (12 years ago)
Author:
livings124
Message:

when adding a new tracker, display tier as "New Tier"

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r10197 r10212  
    684684        if ([item isKindOfClass: [NSDictionary class]])
    685685        {
    686             NSString * tierString = [NSString stringWithFormat: NSLocalizedString(@"Tier %d", "Inspector -> tracker table"),
    687                                         [[item objectForKey: @"Tier"] integerValue]];
     686            const NSInteger tier = [[item objectForKey: @"Tier"] integerValue];
     687            NSString * tierString = tier == -1 ? NSLocalizedString(@"New Tier", "Inspector -> tracker table")
     688                                    : [NSString stringWithFormat: NSLocalizedString(@"Tier %d", "Inspector -> tracker table"), tier];
     689           
    688690            if ([fTorrents count] > 1)
    689691                tierString = [tierString stringByAppendingFormat: @" - %@", [item objectForKey: @"Name"]];
     
    17861788    NSAssert1([fTorrents count] == 1, @"Attempting to add tracker with %d transfers selected", [fTorrents count]);
    17871789   
    1788     Torrent * torrent = [fTorrents objectAtIndex: 0];
    1789    
    1790     [fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: [torrent numberOfTrackerTiers]+1]
    1791                                         forKey: @"Tier"]];
     1790    [fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: -1] forKey: @"Tier"]];
    17921791    [fTrackers addObject: @""];
    17931792   
  • trunk/macosx/Torrent.h

    r10197 r10212  
    131131- (NSMutableArray *) allTrackerStats;
    132132- (NSArray *) allTrackersFlat; //used by GroupRules
    133 - (NSUInteger) numberOfTrackerTiers;
    134133- (BOOL) addTrackerToNewTier: (NSString *) tracker;
    135134- (void) removeTrackersWithIdentifiers: (NSIndexSet *) removeIdentifiers;
  • trunk/macosx/Torrent.m

    r10206 r10212  
    623623   
    624624    return allTrackers;
    625 }
    626 
    627 - (NSUInteger) numberOfTrackerTiers
    628 {
    629     if (fInfo->trackerCount == 0)
    630         return 0;
    631    
    632     return fInfo->trackers[fInfo->trackerCount-1].tier + 1;
    633625}
    634626
  • trunk/macosx/en.lproj/Localizable.strings

    r10197 r10212  
    529529/* Prefs -> blocklist -> message */
    530530"Never" = "Never";
     531
     532/* Inspector -> tracker table */
     533"New Tier" = "New Tier";
    531534
    532535/* Tracker next announce */
Note: See TracChangeset for help on using the changeset viewer.