Changeset 10197


Ignore:
Timestamp:
Feb 14, 2010, 4:48:12 AM (13 years ago)
Author:
livings124
Message:

#2902 New tracker addition field obscured when trackers vertically fill inspector view

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r10196 r10197  
    19341934            tr_strlcpy( st->host, tracker->host->name, sizeof( st->host ) );
    19351935            tr_strlcpy( st->announce, tracker->announce, sizeof( st->announce ) );
    1936             st->tier = i + 1;
     1936            st->tier = i;
    19371937            st->isBackup = tracker != tier->currentTracker;
    19381938            st->lastScrapeStartTime = tier->lastScrapeStartTime;
  • trunk/macosx/InfoWindowController.m

    r10190 r10197  
    711711    if (tableView == fTrackerTable)
    712712    {
    713         if (![[fTrackers objectAtIndex: row] isKindOfClass: [TrackerNode class]] && [tableView editedRow] != row)
     713        //check for NSDictionay instead of TrackerNode because of display issue when adding a row
     714        if ([[fTrackers objectAtIndex: row] isKindOfClass: [NSDictionary class]])
    714715            return TRACKER_GROUP_SEPARATOR_HEIGHT;
    715716    }
     
    17831784    [[self window] makeKeyWindow];
    17841785   
    1785     [fTrackers addObject: NSLocalizedString(@"New Tier", "inspector -> add tracker")];
     1786    NSAssert1([fTorrents count] == 1, @"Attempting to add tracker with %d transfers selected", [fTorrents count]);
     1787   
     1788    Torrent * torrent = [fTorrents objectAtIndex: 0];
     1789   
     1790    [fTrackers addObject: [NSDictionary dictionaryWithObject: [NSNumber numberWithInteger: [torrent numberOfTrackerTiers]+1]
     1791                                        forKey: @"Tier"]];
    17861792    [fTrackers addObject: @""];
    17871793   
  • trunk/macosx/Torrent.h

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

    r10190 r10197  
    594594    tr_tracker_stat * stats = tr_torrentTrackers(fHandle, &count);
    595595   
    596     NSMutableArray * trackers = [NSMutableArray arrayWithCapacity: (count > 0 ? count + stats[count-1].tier : 0)];
     596    NSMutableArray * trackers = [NSMutableArray arrayWithCapacity: (count > 0 ? count + (stats[count-1].tier + 1) : 0)];
    597597   
    598598    int prevTier = -1;
     
    601601        if (stats[i].tier != prevTier)
    602602        {
    603             [trackers addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInteger: stats[i].tier], @"Tier",
     603            [trackers addObject: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInteger: stats[i].tier + 1], @"Tier",
    604604                                    [self name], @"Name", nil]];
    605605            prevTier = stats[i].tier;
     
    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;
    625633}
    626634
  • trunk/macosx/en.lproj/Localizable.strings

    r10163 r10197  
    529529/* Prefs -> blocklist -> message */
    530530"Never" = "Never";
    531 
    532 /* inspector -> add tracker */
    533 "New Tier" = "New Tier";
    534531
    535532/* Tracker next announce */
Note: See TracChangeset for help on using the changeset viewer.