1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

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

This commit is contained in:
Mitchell Livingston 2010-02-15 19:26:23 +00:00
parent 4bb5f833ef
commit 1ed383776f
4 changed files with 5 additions and 15 deletions

View file

@ -683,8 +683,10 @@ typedef enum
if ([item isKindOfClass: [NSDictionary class]]) if ([item isKindOfClass: [NSDictionary class]])
{ {
NSString * tierString = [NSString stringWithFormat: NSLocalizedString(@"Tier %d", "Inspector -> tracker table"), const NSInteger tier = [[item objectForKey: @"Tier"] integerValue];
[[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) if ([fTorrents count] > 1)
tierString = [tierString stringByAppendingFormat: @" - %@", [item objectForKey: @"Name"]]; tierString = [tierString stringByAppendingFormat: @" - %@", [item objectForKey: @"Name"]];
return tierString; return tierString;
@ -1785,10 +1787,7 @@ typedef enum
NSAssert1([fTorrents count] == 1, @"Attempting to add tracker with %d transfers selected", [fTorrents count]); 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: -1] forKey: @"Tier"]];
[fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: [torrent numberOfTrackerTiers]+1]
forKey: @"Tier"]];
[fTrackers addObject: @""]; [fTrackers addObject: @""];
[fTrackerTable setTrackers: fTrackers]; [fTrackerTable setTrackers: fTrackers];

View file

@ -130,7 +130,6 @@
- (NSMutableArray *) allTrackerStats; - (NSMutableArray *) allTrackerStats;
- (NSArray *) allTrackersFlat; //used by GroupRules - (NSArray *) allTrackersFlat; //used by GroupRules
- (NSUInteger) numberOfTrackerTiers;
- (BOOL) addTrackerToNewTier: (NSString *) tracker; - (BOOL) addTrackerToNewTier: (NSString *) tracker;
- (void) removeTrackersWithIdentifiers: (NSIndexSet *) removeIdentifiers; - (void) removeTrackersWithIdentifiers: (NSIndexSet *) removeIdentifiers;

View file

@ -624,14 +624,6 @@ int trashDataFile(const char * filename)
return allTrackers; return allTrackers;
} }
- (NSUInteger) numberOfTrackerTiers
{
if (fInfo->trackerCount == 0)
return 0;
return fInfo->trackers[fInfo->trackerCount-1].tier + 1;
}
- (BOOL) addTrackerToNewTier: (NSString *) tracker - (BOOL) addTrackerToNewTier: (NSString *) tracker
{ {
tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; tracker = [tracker stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];

Binary file not shown.