mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
when adding a new tracker, display tier as "New Tier"
This commit is contained in:
parent
4bb5f833ef
commit
1ed383776f
4 changed files with 5 additions and 15 deletions
|
@ -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];
|
||||
|
|
|
@ -130,7 +130,6 @@
|
|||
|
||||
- (NSMutableArray *) allTrackerStats;
|
||||
- (NSArray *) allTrackersFlat; //used by GroupRules
|
||||
- (NSUInteger) numberOfTrackerTiers;
|
||||
- (BOOL) addTrackerToNewTier: (NSString *) tracker;
|
||||
- (void) removeTrackersWithIdentifiers: (NSIndexSet *) removeIdentifiers;
|
||||
|
||||
|
|
|
@ -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]];
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue