Changeset 9213


Ignore:
Timestamp:
Sep 28, 2009, 3:16:23 PM (13 years ago)
Author:
livings124
Message:

show N/A for peer counts when there hasn't been a scrape/announce yet

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r9190 r9213  
    317317    tracker->scrape = tr_strdup( scrape );
    318318    generateKeyParam( tracker->key_param, KEYLEN );
     319    tracker->seederCount = -1;
     320    tracker->leecherCount = -1;
     321    tracker->downloadCount = -1;
    319322    return tracker;
    320323}
  • trunk/libtransmission/transmission.h

    r9179 r9213  
    12331233typedef struct
    12341234{
    1235     /* how many downloads this tracker knows of */
     1235    /* how many downloads this tracker knows of (-1 means it does not know) */
    12361236    int downloadCount;
    12371237
     
    12941294    time_t lastScrapeTime;
    12951295
    1296     /* number of leechers this tracker knows of */
     1296    /* number of leechers this tracker knows of (-1 means it does not know) */
    12971297    int leecherCount;
    12981298
     
    13051305    time_t nextScrapeTime;
    13061306
    1307     /* number of seeders this tracker knows of */
     1307    /* number of seeders this tracker knows of (-1 means it does not know) */
    13081308    int seederCount;
    13091309
  • trunk/macosx/TrackerCell.m

    r9210 r9213  
    135135   
    136136    //count strings
    137     NSString * seederBaseString = [NSLocalizedString(@"Seeders", "tracker peer stat") stringByAppendingFormat: @": %d",
    138                                     [node totalSeeders]];
     137    NSString * seederBaseString = [NSLocalizedString(@"Seeders", "tracker peer stat") stringByAppendingFormat: @": %@",
     138                                    [node totalSeeders] != -1 ? [NSString stringWithFormat: @"%d", [node totalSeeders]]
     139                                                                : NSLocalizedString(@"N/A", "tracker peer stat")];
    139140    NSAttributedString * seederString = [self attributedStatusWithString: seederBaseString color: statusColor];
    140141    const NSRect seederRect = [self rectForCountWithString: seederString withAboveRect: nameRect inBounds: cellFrame];
    141142    [seederString drawInRect: seederRect];
    142143   
    143     NSString * leecherBaseString = [NSLocalizedString(@"Leechers", "tracker peer stat") stringByAppendingFormat: @": %d",
    144                                     [node totalLeechers]];
     144    NSString * leecherBaseString = [NSLocalizedString(@"Leechers", "tracker peer stat") stringByAppendingFormat: @": %@",
     145                                    [node totalLeechers] != -1 ? [NSString stringWithFormat: @"%d", [node totalLeechers]]
     146                                                                : NSLocalizedString(@"N/A", "tracker peer stat")];
    145147    NSAttributedString * leecherString = [self attributedStatusWithString: leecherBaseString color: statusColor];
    146148    const NSRect leecherRect = [self rectForCountWithString: leecherString withAboveRect: seederRect inBounds: cellFrame];
    147149    [leecherString drawInRect: leecherRect];
    148150   
    149     NSString * downloadedBaseString = [NSLocalizedString(@"Downloaded", "tracker peer stat") stringByAppendingFormat: @": %d",
    150                                     [node totalDownloaded]];
     151    NSString * downloadedBaseString = [NSLocalizedString(@"Downloaded", "tracker peer stat") stringByAppendingFormat: @": %@",
     152                                            [node totalDownloaded] != -1 ? [NSString stringWithFormat: @"%d", [node totalDownloaded]]
     153                                                                        : NSLocalizedString(@"N/A", "tracker peer stat")];
    151154    NSAttributedString * downloadedString = [self attributedStatusWithString: downloadedBaseString color: statusColor];
    152155    const NSRect downloadedRect = [self rectForCountWithString: downloadedString withAboveRect: leecherRect inBounds: cellFrame];
Note: See TracChangeset for help on using the changeset viewer.