diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index d7e33f664..7dd00a890 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -683,8 +683,10 @@ typedef enum if ([item isKindOfClass: [NSDictionary class]]) { - NSString * tierString = [NSString stringWithFormat: NSLocalizedString(@"Tier %d", "Inspector -> tracker table"), - [[item objectForKey: @"Tier"] integerValue]]; + const NSInteger tier = [[item objectForKey: @"Tier"] integerValue]; + NSString * tierString = tier == -1 ? NSLocalizedString(@"New Tier", "Inspector -> tracker table") + : [NSString stringWithFormat: NSLocalizedString(@"Tier %d", "Inspector -> tracker table"), tier]; + if ([fTorrents count] > 1) tierString = [tierString stringByAppendingFormat: @" - %@", [item objectForKey: @"Name"]]; return tierString; @@ -1785,10 +1787,7 @@ typedef enum NSAssert1([fTorrents count] == 1, @"Attempting to add tracker with %d transfers selected", [fTorrents count]); - Torrent * torrent = [fTorrents objectAtIndex: 0]; - - [fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: [torrent numberOfTrackerTiers]+1] - forKey: @"Tier"]]; + [fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: -1] forKey: @"Tier"]]; [fTrackers addObject: @""]; [fTrackerTable setTrackers: fTrackers]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 5e83f1f96..8293c878d 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -130,7 +130,6 @@ - (NSMutableArray *) allTrackerStats; - (NSArray *) allTrackersFlat; //used by GroupRules -- (NSUInteger) numberOfTrackerTiers; - (BOOL) addTrackerToNewTier: (NSString *) tracker; - (void) removeTrackersWithIdentifiers: (NSIndexSet *) removeIdentifiers; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index ca8a7530a..f72bc25ab 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -624,14 +624,6 @@ int trashDataFile(const char * filename) return allTrackers; } -- (NSUInteger) numberOfTrackerTiers -{ - if (fInfo->trackerCount == 0) - return 0; - - return fInfo->trackers[fInfo->trackerCount-1].tier + 1; -} - - (BOOL) addTrackerToNewTier: (NSString *) tracker { tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; diff --git a/macosx/en.lproj/Localizable.strings b/macosx/en.lproj/Localizable.strings index 90668de17..9ce09ac18 100644 Binary files a/macosx/en.lproj/Localizable.strings and b/macosx/en.lproj/Localizable.strings differ